barometer6 2.0.0.0
Barometer 6 Click Driver

API for configuring and manipulating Barometer 6 Click driver. More...

Topics

 Barometer 6 Registers List
 List of registers of Barometer 6 Click driver.
 
 Barometer 6 Registers Settings
 Settings for registers of Barometer 6 Click driver.
 
 Barometer 6 MikroBUS Map
 MikroBUS pin mapping of Barometer 6 Click driver.
 

Functions

void barometer6_cfg_setup (barometer6_cfg_t *cfg)
 Barometer 6 configuration object setup function.
 
void barometer6_drv_interface_selection (barometer6_cfg_t *cfg, barometer6_drv_t drv_sel)
 Barometer 6 driver interface setup function.
 
err_t barometer6_init (barometer6_t *ctx, barometer6_cfg_t *cfg)
 Barometer 6 initialization function.
 
void barometer6_default_cfg (barometer6_t *ctx)
 Barometer 6 default configuration function.
 
err_t barometer6_generic_write (barometer6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Barometer 6 data writing function.
 
err_t barometer6_generic_read (barometer6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Barometer 6 data reading function.
 
void barometer6_write_register (barometer6_t *ctx, uint8_t reg, uint8_t data_in)
 Barometer 6 data writing function.
 
void barometer6_read_register (barometer6_t *ctx, uint8_t reg, uint16_t *data_out)
 Barometer 6 data reading function.
 
void barometer6_read_id (barometer6_t *ctx, uint8_t *data_out)
 Barometer 6 Id reading function.
 
void barometer6_software_reset (barometer6_t *ctx)
 Barometer 6 software reset function.
 
void barometer6_hardware_reset (barometer6_t *ctx)
 Barometer 6 hardware reset function.
 
void barometer6_set_avrege (barometer6_t *ctx, uint8_t temp_avg, uint8_t pressure_avg)
 Barometer 6 set average data function.
 
void barometer6_set_mode (barometer6_t *ctx, uint8_t mode)
 Barometer 6 set operation mode function.
 
void barometer6_set_standby_time (barometer6_t *ctx, uint8_t t_standby)
 Barometer 6 set standby time function.
 
uint8_t barometer6_check_ready (barometer6_t *ctx)
 Barometer 6 check if data is ready function.
 
void barometer6_read_raw_temp (barometer6_t *ctx, int32_t *data_out)
 Barometer 6 read raw temperature function.
 
void barometer6_read_raw_pressure (barometer6_t *ctx, float *data_out)
 Barometer 6 read raw pressure function.
 
void barometer6_read_conp_coef (barometer6_t *ctx, uint8_t reg, int16_t *data_out)
 Barometer 6 read conpensation coefficients data function.
 
void barometer6_get_conp_coef (barometer6_t *ctx, uint8_t reg, float a_coef, float s_coef, float *data_out)
 Barometer 6 calculate conpensation coefficients data function.
 
void barometer6_get_a0_b00_coef (barometer6_t *ctx, float *coef_a0, float *coef_b00)
 Barometer 6 calculate a0 and b00 conpensation coefficients data function.
 
void barometer6_get_conpesation_coe (barometer6_t *ctx)
 Barometer 6 get all conpensation coefficients data function.
 
void barometer6_get_temperature_data (barometer6_t *ctx, float *temp_out)
 Barometer 6 get temperature data function.
 
void barometer6_read_temperature_value (barometer6_t *ctx, float *temp_out)
 Barometer 6 get temperature value function.
 
void barometer6_read_preassure_data (barometer6_t *ctx, float *press_out)
 Barometer 6 get preassure data function.
 
void barometer6_read_preassure_value (barometer6_t *ctx, float *press_out)
 Barometer 6 get preassure mBar function.
 

Detailed Description

API for configuring and manipulating Barometer 6 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ barometer6_cfg_setup()

void barometer6_cfg_setup ( barometer6_cfg_t * cfg)

Barometer 6 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See barometer6_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ barometer6_check_ready()

uint8_t barometer6_check_ready ( barometer6_t * ctx)

Barometer 6 check if data is ready function.

This function is used for checking if data is ready to be read.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
Returns
  • 0 - Data not ready,
  • 1 - Data is ready.

◆ barometer6_default_cfg()

void barometer6_default_cfg ( barometer6_t * ctx)

Barometer 6 default configuration function.

This function executes a default configuration of Barometer 6 click board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
Returns
Nothing.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ barometer6_drv_interface_selection()

void barometer6_drv_interface_selection ( barometer6_cfg_t * cfg,
barometer6_drv_t drv_sel )

Barometer 6 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See barometer6_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See barometer6_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ barometer6_generic_read()

err_t barometer6_generic_read ( barometer6_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Barometer 6 data reading function.

This function reads a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ barometer6_generic_write()

err_t barometer6_generic_write ( barometer6_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Barometer 6 data writing function.

This function writes a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ barometer6_get_a0_b00_coef()

void barometer6_get_a0_b00_coef ( barometer6_t * ctx,
float * coef_a0,
float * coef_b00 )

Barometer 6 calculate a0 and b00 conpensation coefficients data function.

This function is used for calculate a0 and b00 conpensation coefficient's data of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]coef_a0: Conversion factor a0.
[out]coef_b00: Conversion factor b00.
Returns
Nothing.

◆ barometer6_get_conp_coef()

void barometer6_get_conp_coef ( barometer6_t * ctx,
uint8_t reg,
float a_coef,
float s_coef,
float * data_out )

Barometer 6 calculate conpensation coefficients data function.

This function is used for calculate conpensation coefficient's data of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]reg: Start register address.
[in]a_coef: Conversion factor A.
[in]s_coef: Conversion factor S.
[out]data_out: Output read data.
Returns
Nothing.

◆ barometer6_get_conpesation_coe()

void barometer6_get_conpesation_coe ( barometer6_t * ctx)

Barometer 6 get all conpensation coefficients data function.

This function is used for getting all conpensation coefficients data of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
Returns
Nothing.

◆ barometer6_get_temperature_data()

void barometer6_get_temperature_data ( barometer6_t * ctx,
float * temp_out )

Barometer 6 get temperature data function.

This function is used for temperature data of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]temp_out: Output read data.
Returns
Nothing.

◆ barometer6_hardware_reset()

void barometer6_hardware_reset ( barometer6_t * ctx)

Barometer 6 hardware reset function.

This function is used for performing hardware reset of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
Returns
Nothing.

◆ barometer6_init()

err_t barometer6_init ( barometer6_t * ctx,
barometer6_cfg_t * cfg )

Barometer 6 initialization function.

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

Parameters
[out]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See barometer6_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ barometer6_read_conp_coef()

void barometer6_read_conp_coef ( barometer6_t * ctx,
uint8_t reg,
int16_t * data_out )

Barometer 6 read conpensation coefficients data function.

This function is used for reading conpensation coefficient's data of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
Nothing.

◆ barometer6_read_id()

void barometer6_read_id ( barometer6_t * ctx,
uint8_t * data_out )

Barometer 6 Id reading function.

This function reads a chip id from the CHIP_ID register.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]data_out: Output read data.
Returns
Nothing.

◆ barometer6_read_preassure_data()

void barometer6_read_preassure_data ( barometer6_t * ctx,
float * press_out )

Barometer 6 get preassure data function.

This function is used for preassure data in degrees celsius of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]press_out: Output read data.
Returns
Nothing.

◆ barometer6_read_preassure_value()

void barometer6_read_preassure_value ( barometer6_t * ctx,
float * press_out )

Barometer 6 get preassure mBar function.

This function is used for preassure mBar in degrees celsius of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]press_out: Output read data in mBar.
Returns
Nothing.

◆ barometer6_read_raw_pressure()

void barometer6_read_raw_pressure ( barometer6_t * ctx,
float * data_out )

Barometer 6 read raw pressure function.

This function is used for reading raw pressure walue of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]data_out: Raw pressure data.
Returns
Nothing.

◆ barometer6_read_raw_temp()

void barometer6_read_raw_temp ( barometer6_t * ctx,
int32_t * data_out )

Barometer 6 read raw temperature function.

This function is used for reading raw temperature walue of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]data_out: Raw temperature data.
Returns
Nothing.

◆ barometer6_read_register()

void barometer6_read_register ( barometer6_t * ctx,
uint8_t reg,
uint16_t * data_out )

Barometer 6 data reading function.

This function reads a 16 bits of data starting from the selected register.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
Returns
Nothing.

◆ barometer6_read_temperature_value()

void barometer6_read_temperature_value ( barometer6_t * ctx,
float * temp_out )

Barometer 6 get temperature value function.

This function is used for temperature value in degrees celsius of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[out]temp_out: Output read data in degrees celsius.
Returns
Nothing.

◆ barometer6_set_avrege()

void barometer6_set_avrege ( barometer6_t * ctx,
uint8_t temp_avg,
uint8_t pressure_avg )

Barometer 6 set average data function.

This function is used for setting average data of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]temp_avg: Average data for the temperaature.
[in]pressure_avg: Average data for the preassure.
Returns
Nothing.
Note
If you set up an average below BAROMETER6_AVG_4, data read for temperature and pressure becomes 23bit for BAROMETER6_AVG_2, and 22bit for BAROMETER6_AVG_1.

◆ barometer6_set_mode()

void barometer6_set_mode ( barometer6_t * ctx,
uint8_t mode )

Barometer 6 set operation mode function.

This function is used for setting operating mode of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]mode: Selected operation mode.
Returns
Nothing.

◆ barometer6_set_standby_time()

void barometer6_set_standby_time ( barometer6_t * ctx,
uint8_t t_standby )

Barometer 6 set standby time function.

This function is used for setting standby time of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]t_standby: Selected standby time.
Returns
Nothing.

◆ barometer6_software_reset()

void barometer6_software_reset ( barometer6_t * ctx)

Barometer 6 software reset function.

This function is used for performing software reset of the Barometer 6 Clock Board.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
Returns
Nothing.

◆ barometer6_write_register()

void barometer6_write_register ( barometer6_t * ctx,
uint8_t reg,
uint8_t data_in )

Barometer 6 data writing function.

This function writes a byte data into the selected register.

Parameters
[in]ctx: Click context object. See barometer6_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
Returns
Nothing.