altitude 2.0.0.0
Public Function

Functions

void altitude_cfg_setup (altitude_cfg_t *cfg)
 Configuration Object Setup function.
 
altitude_err_t altitude_init (altitude_t *ctx, altitude_cfg_t *cfg)
 Click Initialization function.
 
void altitude_default_cfg (altitude_t *ctx)
 Click Default Configuration function.
 
altitude_err_t altitude_generic_single_write (altitude_t *ctx, uint8_t reg_addr, uint8_t data_in)
 Generic Single Write function.
 
altitude_err_t altitude_generic_multiple_write (altitude_t *ctx, uint8_t reg_addr, uint8_t *data_in, uint8_t n_data)
 Generic Mutiple Write function.
 
altitude_err_t altitude_generic_multiple_read (altitude_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint8_t n_data)
 Generic Multiple Read function.
 
void altitude_set_system_mode (altitude_t *ctx, altitude_sys_mode_t mode)
 System Mode Set function.
 
void altitude_set_sensor_mode (altitude_t *ctx, altitude_sens_mode_t mode)
 Sensor Mode Set function.
 
void altitude_sw_reset (altitude_t *ctx)
 Software Reset function.
 
uint8_t altitude_get_drdy_status (altitude_t *ctx, uint8_t flag_mask)
 Data Ready Status Get function.
 
uint8_t altitude_get_int_status (altitude_t *ctx, uint8_t flag_mask)
 Interrupt Status Get function.
 
uint8_t altitude_get_int1_pin (altitude_t *ctx)
 INT1 Pin Get function.
 
uint8_t altitude_get_int2_pin (altitude_t *ctx)
 INT2 Pin Get function.
 
float altitude_get_altitude (altitude_t *ctx)
 Altitude Get function.
 
float altitude_get_pressure (altitude_t *ctx)
 Pressure Get function.
 
float altitude_get_temperature (altitude_t *ctx)
 Temperature Get function.
 

Detailed Description

Function Documentation

◆ altitude_cfg_setup()

void altitude_cfg_setup ( altitude_cfg_t * cfg)

Configuration Object Setup function.

Parameters
cfgClick configuration structure.

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

Note
All used pins will be set to unconnected state.

◆ altitude_default_cfg()

void altitude_default_cfg ( altitude_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes a default configuration for Altitude click.

Note
This function sets click to active mode, and sensor will measure the altitude by default. All necessary interrupts will be enabled in this function.

◆ altitude_generic_multiple_read()

altitude_err_t altitude_generic_multiple_read ( altitude_t * ctx,
uint8_t reg_addr,
uint8_t * data_out,
uint8_t n_data )

Generic Multiple Read function.

Parameters
ctxClick object.
reg_addrRegister address.
data_outMemory where read data be stored.
n_dataNumber of data bytes to be read.
Returns
0x0 - Ok, 0xFE - Invalid register address, 0xFF - Number of bytes is out of range.

@description This function executes a read operation of multiple data bytes starting from the selected register.

◆ altitude_generic_multiple_write()

altitude_err_t altitude_generic_multiple_write ( altitude_t * ctx,
uint8_t reg_addr,
uint8_t * data_in,
uint8_t n_data )

Generic Mutiple Write function.

Parameters
ctxClick object.
reg_addrRegister address.
data_inData to be written.
n_dataNumber of data bytes to be written.
Returns
0x0 - Ok, 0xFE - Invalid register address, 0xFF - Number of bytes is out of range.

@description This function executes a write operation of multiple data bytes starting from the selected register.

◆ altitude_generic_single_write()

altitude_err_t altitude_generic_single_write ( altitude_t * ctx,
uint8_t reg_addr,
uint8_t data_in )

Generic Single Write function.

Parameters
ctxClick object.
reg_addrRegister address.
data_inData to be written.
Returns
0x0 - Ok, 0xFE - Invalid register address.

@description This function executes a single write operation to the desired register.

◆ altitude_get_altitude()

float altitude_get_altitude ( altitude_t * ctx)

Altitude Get function.

Parameters
ctxClick object.
Returns
Altitude value in meters [m].

@description This function reads the altitude and converts this value to meters.

◆ altitude_get_drdy_status()

uint8_t altitude_get_drdy_status ( altitude_t * ctx,
uint8_t flag_mask )

Data Ready Status Get function.

Parameters
ctxClick object.
flag_maskSelects a bits which will be compared.
Returns
Status byte.

@description This function reads Status register and allows comparison of the selected data ready flags.

◆ altitude_get_int1_pin()

uint8_t altitude_get_int1_pin ( altitude_t * ctx)

INT1 Pin Get function.

Parameters
ctxClick object.
Returns
Pin state [bool].

@description This function returns a true value if high voltage level was detected on the pin, or returns a false value if low voltage level was detected on the pin.

◆ altitude_get_int2_pin()

uint8_t altitude_get_int2_pin ( altitude_t * ctx)

INT2 Pin Get function.

Parameters
ctxClick object.
Returns
Pin state [bool].

@description This function returns a true value if high voltage level was detected on the pin, or returns a false value if low voltage level was detected on the pin.

◆ altitude_get_int_status()

uint8_t altitude_get_int_status ( altitude_t * ctx,
uint8_t flag_mask )

Interrupt Status Get function.

Parameters
ctxClick object.
flag_maskSelects a bits which will be compared.
Returns
Status byte.

@description This function reads Interrupt Source register and allows comparison of the selected interrupt flags.

◆ altitude_get_pressure()

float altitude_get_pressure ( altitude_t * ctx)

Pressure Get function.

Parameters
ctxClick object.
Returns
Pressure value in millibars [mbar].

@description This function reads the pressure and converts this value to millibars.

◆ altitude_get_temperature()

float altitude_get_temperature ( altitude_t * ctx)

Temperature Get function.

Parameters
ctxClick object.
Returns
Temeprature value in Celsius degrees [deg C].

@description This function reads the temperature and converts this value to Celsius degrees.

◆ altitude_init()

altitude_err_t altitude_init ( altitude_t * ctx,
altitude_cfg_t * cfg )

Click Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
0x0 - Ok, 0xFD - Driver init error.

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

◆ altitude_set_sensor_mode()

void altitude_set_sensor_mode ( altitude_t * ctx,
altitude_sens_mode_t mode )

Sensor Mode Set function.

Parameters
ctxClick object.
mode0 - Barometer, 1 - Altimeter.

@description This function sets the sensor (measurement) mode.

◆ altitude_set_system_mode()

void altitude_set_system_mode ( altitude_t * ctx,
altitude_sys_mode_t mode )

System Mode Set function.

Parameters
ctxClick object.
mode0 - Standby mode, 1 - Active mode.

@description This function sets the system mode.

◆ altitude_sw_reset()

void altitude_sw_reset ( altitude_t * ctx)

Software Reset function.

Parameters
ctxClick object.

@description This function sets the all registers to default configuration state.