altitude2 2.0.0.0

Functions

void altitude2_cfg_setup (altitude2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t altitude2_init (altitude2_t *ctx, altitude2_cfg_t *cfg)
 Initialization function.
 
uint8_t altitude2_read_prom (altitude2_t *ctx, uint8_t select_data, uint16_t *data_out)
 Calibration data read function.
 
void altitude2_reset (altitude2_t *ctx)
 Reset function.
 
uint8_t altitude2_set_ratio (altitude2_t *ctx, uint8_t temp_ratio, uint8_t press_ratio)
 Set ratio function.
 
void altitude2_read_data (altitude2_t *ctx, float *temp_data, float *press_data, float *altitude_data)
 Data read function.
 

Detailed Description

Function Documentation

◆ altitude2_cfg_setup()

void altitude2_cfg_setup ( altitude2_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.

◆ altitude2_init()

err_t altitude2_init ( altitude2_t * ctx,
altitude2_cfg_t * cfg )

Initialization function.

Parameters
altitude2Click object.
cfgClick configuration structure.

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

◆ altitude2_read_data()

void altitude2_read_data ( altitude2_t * ctx,
float * temp_data,
float * press_data,
float * altitude_data )

Data read function.

Parameters
ctxClick object.
temp_dataStores temperature data in celsius.
press_dataStores pressure data in mbar.
altitude_dataStores altitude data in meters.

@description This function performs pressure and temperature measurements and calculates temperature data in celsius and pressure data in mbar. Depending on the temperature and pressure data, function calculates altitude in meters.

◆ altitude2_read_prom()

uint8_t altitude2_read_prom ( altitude2_t * ctx,
uint8_t select_data,
uint16_t * data_out )

Calibration data read function.

Parameters
ctxClick object.
select_dataSelect coefficient from 0 to 7.
data_outCoefficient returned by function.
Returns
0-Ok, 1 - Wrong select_data parameter. @description This function reads calibration data from PROM.

◆ altitude2_reset()

void altitude2_reset ( altitude2_t * ctx)

Reset function.

Parameters
ctxClick object.

@description This function resets the device and reads calibration coefficients after reset.

◆ altitude2_set_ratio()

uint8_t altitude2_set_ratio ( altitude2_t * ctx,
uint8_t temp_ratio,
uint8_t press_ratio )

Set ratio function.

Parameters
ctxClick object.
temp_ratioDetermines oversampling ratio for temperature measurement.
press_ratioDetermines oversampling ration for pressure measurement.
Returns
0-Ok, 1 - Wrong temp_ratio parameter, 2 - Wrong press_ratio parameter. @description This function determines oversampling ratio for temperature and pressure measurement.