environment 2.0.0.0

Functions

void environment_cfg_setup (environment_cfg_t *cfg)
 Config Object Initialization function.
 
ENVIRONMENT_RETVAL environment_init (environment_t *ctx, environment_cfg_t *cfg)
 Initialization function.
 
void environment_default_cfg (environment_t *ctx)
 Click Default Configuration function.
 
void environment_generic_write (environment_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void environment_generic_read (environment_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void environment_write_byte (environment_t *ctx, uint8_t reg_address, uint8_t write_data)
 Generic the write byte of data function.
 
uint8_t environment_read_byte (environment_t *ctx, uint8_t reg_address)
 Generic the read byte of data function.
 
uint8_t environment_check_id (environment_t *ctx)
 Check device ID function.
 
uint8_t environment_get_device_id (environment_t *ctx)
 Get device ID function.
 
void environment_soft_reset (environment_t *ctx)
 Software reset function.
 
void environment_get_calibration_data (environment_t *ctx)
 Get factory calibration parameters function.
 
void environment_default_config (environment_t *ctx)
 Set default configuration for the BMP680 sensor function.
 
float environment_get_ambient_data (environment_t *ctx, uint8_t data_in)
 Get ambient data function.
 
float environment_get_temperature (environment_t *ctx)
 Gets temperature in degrees Celsius function.
 
float environment_get_humidity (environment_t *ctx)
 Gets humidity in percentage [ % ] function.
 
float environment_get_pressure (environment_t *ctx)
 Gets pressure in degrees Celsius function.
 
uint32_t environment_get_gas_resistance (environment_t *ctx)
 Gets gas resistance data function.
 

Detailed Description

Function Documentation

◆ environment_cfg_setup()

void environment_cfg_setup ( environment_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ environment_check_id()

uint8_t environment_check_id ( environment_t * ctx)

Check device ID function.

Parameters
ctxClick object.
Returns
  • 0 : ERROR;
  • 1 : OK;

@description Function check device ID by read ID value from the sensor ID register address of BME680 chip on Environment Click board.

◆ environment_default_cfg()

void environment_default_cfg ( environment_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Environment click.

◆ environment_default_config()

void environment_default_config ( environment_t * ctx)

Set default configuration for the BMP680 sensor function.

Parameters
ctxClick object.

@description Function set default configuration to the sensor configuration register address of BME680 chip on Environment Click board.

Note
This function must be called at least once at the beginning of the program so that the sensor can be successfully configured for measurement.

◆ environment_generic_read()

void environment_generic_read ( environment_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function reads data from the desired register.

◆ environment_generic_write()

void environment_generic_write ( environment_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function writes data to the desired register.

◆ environment_get_ambient_data()

float environment_get_ambient_data ( environment_t * ctx,
uint8_t data_in )

Get ambient data function.

Parameters
ctxClick object.
dataInData for reading:
Returns
float ambient ( temperature, pressure or humidity ) data

@description Function get ambient data by sets device force mode and read data from the sensor temperature, pressure or humidity register address of BME680 chip on Environment Click board.

◆ environment_get_calibration_data()

void environment_get_calibration_data ( environment_t * ctx)

Get factory calibration parameters function.

Parameters
ctxClick object.

@description Function read factory calibration parameters value from the sensor calibration registers address of BME680 chip on Environment Click board.

Note
This function must be called at least once at the beginning of the program to read and store the calibration parameters in the memory.

◆ environment_get_device_id()

uint8_t environment_get_device_id ( environment_t * ctx)

Get device ID function.

Parameters
ctxClick object.
Returns
8-bit device ID value

@description Function read device ID from the sensor ID register address of BME680 chip on Environment Click board.

Note
Default device: ID = 0x61.

◆ environment_get_gas_resistance()

uint32_t environment_get_gas_resistance ( environment_t * ctx)

Gets gas resistance data function.

Parameters
ctxClick object.

@returnss 32-bite gas resistance data

@description Function get gas resistance value from the sensor gas resistance register address of BME680 chip on Environment Click board.

◆ environment_get_humidity()

float environment_get_humidity ( environment_t * ctx)

Gets humidity in percentage [ % ] function.

Parameters
ctxClick object.
Returns
float value of humidity in percentage [ % ]

@description Function get humidity value in percentage [ % ] from the sensor humidity register address of BME680 chip on Environment Click board.

◆ environment_get_pressure()

float environment_get_pressure ( environment_t * ctx)

Gets pressure in degrees Celsius function.

Parameters
ctxClick object.
Returns
float value of pressure in [ mbar ]

@description Function get pressure value in [ mbar ] from the sensor pressure register address of BME680 chip on Environment Click board.

◆ environment_get_temperature()

float environment_get_temperature ( environment_t * ctx)

Gets temperature in degrees Celsius function.

Parameters
ctxClick object.
Returns
float value of temperature in degrees Celsius

@description Function get temperature value in degrees Celsius [ �C ] from the sensor temperature register address of BME680 chip on Environment Click board.

◆ environment_init()

ENVIRONMENT_RETVAL environment_init ( environment_t * ctx,
environment_cfg_t * cfg )

Initialization function.

Parameters
environmentClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ environment_read_byte()

uint8_t environment_read_byte ( environment_t * ctx,
uint8_t reg_address )

Generic the read byte of data function.

Parameters
ctxClick object.
reg_addressRegister address

@returnss 8-bit read data

@description Function read the 8-bit of data from the target 8-bit register address of BME680 chip on Environment Click board.

◆ environment_soft_reset()

void environment_soft_reset ( environment_t * ctx)

Software reset function.

Parameters
ctxClick object.

@description Function software reset by write value of 0xB6 to the sensor reset register address of BME680 chip on Environment Click board.

◆ environment_write_byte()

void environment_write_byte ( environment_t * ctx,
uint8_t reg_address,
uint8_t write_data )

Generic the write byte of data function.

Parameters
ctxClick object.
reg_address8-bit register address
write_dataByte of data to write

@description Function write the 8-bit of data to the target 8-bit register address of BME680 chip on Environment Click board.