altitude3 2.0.0.0

Functions

void altitude3_cfg_setup (altitude3_cfg_t *cfg)
 Config Object Initialization function.
 
ALTITUDE3_RETVAL altitude3_init (altitude3_t *ctx, altitude3_cfg_t *cfg)
 Initialization function.
 
void altitude3_default_cfg (altitude3_t *ctx)
 Click Default Configuration function.
 
void altitude3_generic_write (altitude3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void altitude3_generic_read (altitude3_t *ctx, uint8_t *reg_buf, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t altitude3_measurement_mode (altitude3_t *ctx, uint16_t mode_cmd)
 Set Measurement Mode function.
 
void altitude3_soft_reset (altitude3_t *ctx)
 Software Reset function.
 
uint8_t altitude3_read_adc_results (altitude3_t *ctx, uint8_t read_order, int16_t *temperature, uint32_t *pressure)
 Read AD Conversion function.
 
void altitude3_init_cfg (altitude3_t *ctx, altitude3_param_t *s)
 Init configuration function.
 
uint8_t altitude3_get_data (altitude3_t *ctx, uint8_t read_order)
 Get Data function.
 

Detailed Description

Function Documentation

◆ altitude3_cfg_setup()

void altitude3_cfg_setup ( altitude3_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.

◆ altitude3_default_cfg()

void altitude3_default_cfg ( altitude3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Altitude3 click.

◆ altitude3_generic_read()

void altitude3_generic_read ( altitude3_t * ctx,
uint8_t * reg_buf,
uint8_t * data_buf,
uint8_t len )

Generic read function.

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

@description This function reads data from the desired register.

◆ altitude3_generic_write()

void altitude3_generic_write ( altitude3_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

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

@description This function writes data to the desired register.

◆ altitude3_get_data()

uint8_t altitude3_get_data ( altitude3_t * ctx,
uint8_t read_order )

Get Data function.

Parameters
read_orderDetermines in which order data be read
temperatureMemory where temperature data calculated to Celsius degrees be stored
pressureMemory where pressure data calculated to mbar[hPa] be stored
altitudeMemory where altitude data calculated to meters be stored
Returns
0x00 - OK, 0x03 - Calibration Done, 0xFF - Data Order Error

@description Function performs a calibration data reading, only once, and then reads a temperature and pressure data and calculates these values to standard units. Also calculates the altitude depending on the temperature and pressure data.

◆ altitude3_init()

ALTITUDE3_RETVAL altitude3_init ( altitude3_t * ctx,
altitude3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ altitude3_init_cfg()

void altitude3_init_cfg ( altitude3_t * ctx,
altitude3_param_t * s )

Init configuration function.

Parameters
sObject where initialization data and data from OTP sensor be stored

@description Function sends a command to read calibration data from OTP sensor and other initialization data, which is necessary for calculations.

Note
The reading from OTP sensor should be performed after power up or after SW reset.

◆ altitude3_measurement_mode()

uint8_t altitude3_measurement_mode ( altitude3_t * ctx,
uint16_t mode_cmd )

Set Measurement Mode function.

Parameters
ctxClick object.
modeCmdCommand which selects a measurement mode
Returns
0x01 - Temperature goes first, 0x02 - Pressure goes first, 0xFF - Command Error

@description Function sends a command which selects a measurement mode and data reading order.

◆ altitude3_read_adc_results()

uint8_t altitude3_read_adc_results ( altitude3_t * ctx,
uint8_t read_order,
int16_t * temperature,
uint32_t * pressure )

Read AD Conversion function.

Parameters
ctxClick object.
read_orderDetermines in which order data be read
temperatureMemory where temperature converted data be stored
pressureMemory where pressure converted data be stored
Returns
0x00 - OK, 0xFF - Data Order Error

@description Function reads results of AD conversion, which consists of the 16bit temperature and 24bit pressure data in determined order.

◆ altitude3_soft_reset()

void altitude3_soft_reset ( altitude3_t * ctx)

Software Reset function.

Parameters
ctxClick object.

@description Function sends a command to perform a SW Reset of the device.

Note
This command triggers the sensor to reset all internal state machines and reload calibration data from the memory.