barometer3 2.0.0.0

Functions

void barometer3_cfg_setup (barometer3_cfg_t *cfg)
 Config Object Initialization function.
 
BAROMETER3_RETVAL barometer3_init (barometer3_t *ctx, barometer3_cfg_t *cfg)
 Initialization function.
 
void barometer3_generic_write (barometer3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void barometer3_generic_read (barometer3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t barometer3_read_byte (barometer3_t *ctx, uint8_t reg_adr)
 Read byte function.
 
void barometer3_read_coeffs (barometer3_t *ctx)
 Read Calculation Coefficients function.
 
void barometer3_set_op_mode (barometer3_t *ctx, uint8_t op_mode)
 Set mode of operation function.
 
void barometer3_flush_fifo (barometer3_t *ctx)
 Flush FIFO function.
 
void barometer3_disable_fifo (barometer3_t *ctx)
 Disable FIFO function.
 
void barometer3_standby (barometer3_t *ctx)
 Standby function.
 
void barometer3_cfg_temp (barometer3_t *ctx, uint8_t temp_mr, uint8_t temp_osr)
 Temperature Measurement Configuration function.
 
void barometer3_cfg_pres (barometer3_t *ctx, uint8_t prs_mr, uint8_t prs_osr)
 Pressure Measurement Configuration function.
 
uint8_t barometer3_st_meas_temp_once (barometer3_t *ctx, uint8_t temp_osr)
 Start Measure Temperature Once function.
 
uint8_t barometer3_st_meas_pres_once (barometer3_t *ctx, uint8_t prs_osr)
 Start Measure Pressure Once function.
 
void barometer3_get_raw_res (barometer3_t *ctx, uint8_t reg_adr, int32_t *raw)
 Get Raw Measurement results.
 
float barometer3_calc_temp (barometer3_t *ctx, int32_t raw)
 Temperature Calculation function.
 
float barometer3_calc_pres (barometer3_t *ctx, int32_t raw)
 Pressure Calculation function.
 
uint8_t barometer3_get_single_res (barometer3_t *ctx, float *result)
 Get Single measurement function.
 
uint8_t barometer3_meas_temp_once (barometer3_t *ctx, float *result, uint8_t temp_osr)
 Get Temperature Measurement Once function.
 
uint8_t barometer3_meas_prs_once (barometer3_t *ctx, float *result, uint8_t prs_osr)
 Get Pressure Measurement Once function.
 
void barometer3_def_cfg (barometer3_t *ctx)
 Apply Default Configuration function.
 
uint8_t barometer3_get_fifo_val (barometer3_t *ctx, int32_t *value)
 Get FIFO Value function.
 
uint8_t barometer3_get_cont_res (barometer3_t *ctx, float *temp_buf, float *prs_buf)
 Get Continuous results function.
 
uint8_t barometer3_check_int (barometer3_t *ctx)
 Check interrupt ststus function.
 

Detailed Description

Function Documentation

◆ barometer3_calc_pres()

float barometer3_calc_pres ( barometer3_t * ctx,
int32_t raw )

Pressure Calculation function.

Parameters
ctxClick object.
rawraw result.
Returns
float pressure data [ Pa ].

@description Function calculate the pressure.

◆ barometer3_calc_temp()

float barometer3_calc_temp ( barometer3_t * ctx,
int32_t raw )

Temperature Calculation function.

Parameters
ctxClick object.
rawraw result.
Returns
float temperature data [ degree Celsius ].

@description Function calculate the temperature.

◆ barometer3_cfg_pres()

void barometer3_cfg_pres ( barometer3_t * ctx,
uint8_t prs_mr,
uint8_t prs_osr )

Pressure Measurement Configuration function.

Parameters
ctxClick object.
prs_mr8-bit measuremetns pressure rate
prs_osr8-bit pressure oversampling rate

@description Function set configuration for pressure measurement.

◆ barometer3_cfg_setup()

void barometer3_cfg_setup ( barometer3_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.

◆ barometer3_cfg_temp()

void barometer3_cfg_temp ( barometer3_t * ctx,
uint8_t temp_mr,
uint8_t temp_osr )

Temperature Measurement Configuration function.

Parameters
ctxClick object.
temp_mr8-bit measuremetns temperature rate
temp_osr8-bit temperature oversampling rate

@description Function set configuration for temperature measurement.

◆ barometer3_check_int()

uint8_t barometer3_check_int ( barometer3_t * ctx)

Check interrupt ststus function.

Parameters
ctxClick object.
Returns
Interrupt state:
  • 0 : No active.
  • 1 : Active.

@description Function check interrupt state by return state.

◆ barometer3_def_cfg()

void barometer3_def_cfg ( barometer3_t * ctx)

Apply Default Configuration function.

Parameters
ctxClick object.

@description Function apply default configuration.

◆ barometer3_disable_fifo()

void barometer3_disable_fifo ( barometer3_t * ctx)

Disable FIFO function.

Parameters
ctxClick object.

@description Function disable FIFO.

◆ barometer3_flush_fifo()

void barometer3_flush_fifo ( barometer3_t * ctx)

Flush FIFO function.

Parameters
ctxClick object.

@description Function flush FIFO.

◆ barometer3_generic_read()

void barometer3_generic_read ( barometer3_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.

◆ barometer3_generic_write()

void barometer3_generic_write ( barometer3_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.

◆ barometer3_get_cont_res()

uint8_t barometer3_get_cont_res ( barometer3_t * ctx,
float * temp_buf,
float * prs_buf )

Get Continuous results function.

Parameters
ctxClick object.
resultpointer to the memory location where temperature data be stored.
resultpointer to the memory location where pressure data be stored.
Returns
Measure pressure status:
  • 0x00 ( BAROMETER3_SUCCESS ) : Success.
  • 0x01 ( BAROMETER3_BUSY ) : Busy.
  • 0x02 ( BAROMETER3_FAIL ) : Fail.
  • 0x03 ( BAROMETER3_UNFIN ) : Unfin.

@description Function get continuous results.

◆ barometer3_get_fifo_val()

uint8_t barometer3_get_fifo_val ( barometer3_t * ctx,
int32_t * value )

Get FIFO Value function.

Parameters
ctxClick object.
valuepointer to the memory location where data be stored.
Returns
Measure pressure status:
  • 0x00 ( BAROMETER3_SUCCESS ) : Success.
  • 0x01 ( BAROMETER3_BUSY ) : Busy.
  • 0x02 ( BAROMETER3_FAIL ) : Fail.
  • 0x03 ( BAROMETER3_UNFIN ) : Unfin.

@description Function perform pressure measurement once.

◆ barometer3_get_raw_res()

void barometer3_get_raw_res ( barometer3_t * ctx,
uint8_t reg_adr,
int32_t * raw )

Get Raw Measurement results.

Parameters
ctxClick object.
reg8-bit register address
rawpointer to the memory location where data be stored.

@description Function get raw measurement results.

◆ barometer3_get_single_res()

uint8_t barometer3_get_single_res ( barometer3_t * ctx,
float * result )

Get Single measurement function.

Parameters
ctxClick object.
resultfloat result data.
Returns
Measure result status:
  • 0x00 ( BAROMETER3_SUCCESS ) : Success.
  • 0x01 ( BAROMETER3_BUSY ) : Busy.
  • 0x02 ( BAROMETER3_FAIL ) : Fail.
  • 0x03 ( BAROMETER3_UNFIN ) : Unfin.

@description Function get single measurement.

◆ barometer3_init()

BAROMETER3_RETVAL barometer3_init ( barometer3_t * ctx,
barometer3_cfg_t * cfg )

Initialization function.

Parameters
barometer3Click object.
cfgClick configuration structure.

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

◆ barometer3_meas_prs_once()

uint8_t barometer3_meas_prs_once ( barometer3_t * ctx,
float * result,
uint8_t prs_osr )

Get Pressure Measurement Once function.

Parameters
ctxClick object.
resultpointer to the memory location where pressure data be stored.
prs_osr8-bit pressure oversampling rat
Returns
Measure pressure status:
  • 0x00 ( BAROMETER3_SUCCESS ) : Success.
  • 0x01 ( BAROMETER3_BUSY ) : Busy.
  • 0x02 ( BAROMETER3_FAIL ) : Fail.
  • 0x03 ( BAROMETER3_UNFIN ) : Unfin.

@description Function perform pressure measurement once.

◆ barometer3_meas_temp_once()

uint8_t barometer3_meas_temp_once ( barometer3_t * ctx,
float * result,
uint8_t temp_osr )

Get Temperature Measurement Once function.

Parameters
ctxClick object.
result
pointer to the memory location where temperature data be stored.
temp_osr8-bit temperature oversampling rat
Returns
Measure temperature status:
  • 0x00 ( BAROMETER3_SUCCESS ) : Success.
  • 0x01 ( BAROMETER3_BUSY ) : Busy.
  • 0x02 ( BAROMETER3_FAIL ) : Fail.
  • 0x03 ( BAROMETER3_UNFIN ) : Unfin.

@description Function perform temperature measurement once.

◆ barometer3_read_byte()

uint8_t barometer3_read_byte ( barometer3_t * ctx,
uint8_t reg_adr )

Read byte function.

Parameters
ctxClick object.
reg_adr8-bit value that defines the register
Returns
rx_buf 8-bit value that defines the output data

@description Function is used to read single byte of data from user defined register.

◆ barometer3_read_coeffs()

void barometer3_read_coeffs ( barometer3_t * ctx)

Read Calculation Coefficients function.

Parameters
ctxClick object.

@description Function read calculation coefficients.

◆ barometer3_set_op_mode()

void barometer3_set_op_mode ( barometer3_t * ctx,
uint8_t op_mode )

Set mode of operation function.

Parameters
ctxClick object.
op_mode8-bit register address

@description Function set mode of operation.

◆ barometer3_st_meas_pres_once()

uint8_t barometer3_st_meas_pres_once ( barometer3_t * ctx,
uint8_t prs_osr )

Start Measure Pressure Once function.

Parameters
ctxClick object.
temp_osr8-bit pressure oversampling rate
Returns
Measure pressure status:
  • 0x00 ( BAROMETER3_SUCCESS ) : Success.
  • 0x01 ( BAROMETER3_BUSY ) : Busy.
  • 0x02 ( BAROMETER3_FAIL ) : Fail.
  • 0x03 ( BAROMETER3_UNFIN ) : Unfin.

@description Function start measure pressure once.

◆ barometer3_st_meas_temp_once()

uint8_t barometer3_st_meas_temp_once ( barometer3_t * ctx,
uint8_t temp_osr )

Start Measure Temperature Once function.

Parameters
ctxClick object.
temp_osr8-bit temperature oversampling rate
Returns
Measure temperature status:
  • 0x00 ( BAROMETER3_SUCCESS ) : Success.
  • 0x01 ( BAROMETER3_BUSY ) : Busy.
  • 0x02 ( BAROMETER3_FAIL ) : Fail.
  • 0x03 ( BAROMETER3_UNFIN ) : Unfin.

@description Function start measure temperature once.

◆ barometer3_standby()

void barometer3_standby ( barometer3_t * ctx)

Standby function.

Parameters
ctxClick object.

@description Function standby.