altitude5 2.0.0.0
Altitude 5 Click Driver

API for configuring and manipulating Altitude 5 Click driver. More...

Topics

 Altitude 5 Registers List
 List of registers of Altitude 5 Click driver.
 
 Altitude 5 Registers Settings
 Settings for registers of Altitude 5 Click driver.
 
 Altitude 5 MikroBUS Map
 MikroBUS pin mapping of Altitude 5 Click driver.
 

Functions

void altitude5_cfg_setup (altitude5_cfg_t *cfg)
 Altitude 5 configuration object setup function.
 
err_t altitude5_init (altitude5_t *ctx, altitude5_cfg_t *cfg)
 Altitude 5 initialization function.
 
err_t altitude5_default_cfg (altitude5_t *ctx)
 Altitude 5 default configuration function.
 
err_t altitude5_get_adc (altitude5_t *ctx, uint16_t *data_out)
 Altitude 5 get ADC function.
 
err_t altitude5_read_an_pin_voltage (altitude5_t *ctx, float *data_out)
 Altitude 5 read AN pin voltage level function.
 
err_t altitude5_get_adc_voltage (altitude5_t *ctx, float *adc_vtg)
 Altitude 5 get ADC voltage function.
 
err_t altitude5_get_pressure (altitude5_t *ctx, float *pressure)
 Altitude 5 get pressure function.
 
err_t altitude5_get_altitude (altitude5_t *ctx, float *altitude)
 Altitude 5 get altitude function.
 

Detailed Description

API for configuring and manipulating Altitude 5 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

◆ altitude5_cfg_setup()

void altitude5_cfg_setup ( altitude5_cfg_t * cfg)

Altitude 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ altitude5_default_cfg()

err_t altitude5_default_cfg ( altitude5_t * ctx)

Altitude 5 default configuration function.

This function executes a default configuration of Altitude 5 click board.

Parameters
[in]ctx: Click context object. See altitude5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ altitude5_get_adc()

err_t altitude5_get_adc ( altitude5_t * ctx,
uint16_t * data_out )

Altitude 5 get ADC function.

This function reads 12-bit ADC data of the TKP236 Analog Absolute Pressure Sensor on the Altitude 5 click board™.

Parameters
[in]ctx: Click context object. See altitude5_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ altitude5_get_adc_voltage()

err_t altitude5_get_adc_voltage ( altitude5_t * ctx,
float * adc_vtg )

Altitude 5 get ADC voltage function.

This function reads 12-bit ADC data and calculate ADC voltage ( V ) of the TKP236 Analog Absolute Pressure Sensor on the Altitude 5 click board™.

Parameters
[in]ctx: Click context object. See altitude5_t object definition for detailed explanation.
[out]adc_vtg: Output ADC voltage ( V ) data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ altitude5_get_altitude()

err_t altitude5_get_altitude ( altitude5_t * ctx,
float * altitude )

Altitude 5 get altitude function.

This function reads 12-bit ADC data and calculate altitude ( meters ) of the TKP236 Analog Absolute Pressure Sensor on the Altitude 5 click board™.

Parameters
[in]ctx: Click context object. See altitude5_t object definition for detailed explanation.
[out]altitude: Output altitude ( m ) data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ altitude5_get_pressure()

err_t altitude5_get_pressure ( altitude5_t * ctx,
float * pressure )

Altitude 5 get pressure function.

This function reads 12-bit ADC data and calculate pressure ( hPa - mBar ) of the TKP236 Analog Absolute Pressure Sensor on the Altitude 5 click board™.

Parameters
[in]ctx: Click context object. See altitude5_t object definition for detailed explanation.
[out]pressure: Output pressure ( hPa - mBar ) data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ altitude5_init()

err_t altitude5_init ( altitude5_t * ctx,
altitude5_cfg_t * cfg )

Altitude 5 initialization function.

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

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

◆ altitude5_read_an_pin_voltage()

err_t altitude5_read_an_pin_voltage ( altitude5_t * ctx,
float * data_out )

Altitude 5 read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See altitude5_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin ( V ).
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.