altitude6 2.0.0.0
Altitude 6 Click Driver

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

Topics

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

Functions

void altitude6_cfg_setup (altitude6_cfg_t *cfg)
 Altitude 6 configuration object setup function.
 
void altitude6_drv_interface_selection (altitude6_cfg_t *cfg, altitude6_drv_t drv_sel)
 Altitude 6 driver interface setup function.
 
err_t altitude6_init (altitude6_t *ctx, altitude6_cfg_t *cfg)
 Altitude 6 initialization function.
 
err_t altitude6_default_cfg (altitude6_t *ctx)
 Altitude 6 default configuration function.
 
err_t altitude6_set_command (altitude6_t *ctx, uint8_t cmd)
 Altitude 6 set command function.
 
err_t altitude6_generic_read (altitude6_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len)
 Altitude 6 data reading function.
 
err_t altitude6_set_ratio (altitude6_t *ctx, uint8_t temp_ratio, uint8_t press_ratio)
 Altitude 6 set data ratio function.
 
err_t altitude6_sw_reset (altitude6_t *ctx)
 Altitude 6 software reset function.
 
err_t altitude6_get_calibration_data (altitude6_t *ctx)
 Altitude 6 get calibration data function.
 
err_t altitude6_get_raw_data (altitude6_t *ctx, uint32_t *temp_data, uint32_t *press_data)
 Altitude 6 get raw data function.
 
err_t altitude6_get_temperature (altitude6_t *ctx, float *temperature)
 Altitude 6 get temperature data function.
 
err_t altitude6_get_pressure (altitude6_t *ctx, float *pressure)
 Altitude 6 get pressure data function.
 
err_t altitude6_get_data (altitude6_t *ctx, float *temperature, float *pressure, float *altitude)
 Altitude 6 get data function.
 

Detailed Description

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

◆ altitude6_cfg_setup()

void altitude6_cfg_setup ( altitude6_cfg_t * cfg)

Altitude 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ altitude6_default_cfg()

err_t altitude6_default_cfg ( altitude6_t * ctx)

Altitude 6 default configuration function.

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

Parameters
[in]ctx: Click context object. See altitude6_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.

◆ altitude6_drv_interface_selection()

void altitude6_drv_interface_selection ( altitude6_cfg_t * cfg,
altitude6_drv_t drv_sel )

Altitude 6 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See altitude6_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See altitude6_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ altitude6_generic_read()

err_t altitude6_generic_read ( altitude6_t * ctx,
uint8_t cmd,
uint8_t * data_out,
uint8_t len )

Altitude 6 data reading function.

This function reads a desired number of data bytes starting from the selected register of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
[in]cmd: Desired command.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ altitude6_get_calibration_data()

err_t altitude6_get_calibration_data ( altitude6_t * ctx)

Altitude 6 get calibration data function.

This function read and store calibration data of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Executes a ADC conversion delay of the 10 milliseconds.

◆ altitude6_get_data()

err_t altitude6_get_data ( altitude6_t * ctx,
float * temperature,
float * pressure,
float * altitude )

Altitude 6 get data function.

This function read temperature and pressure data, convert temperature data to the degree Celsius and pressure data to the mbar of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™ Depending on the temperature and pressure data, function calculates altitude in meters

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
[out]temperature: Temperature in degree Celsius.
[out]pressure: Pressure in mbar.
[out]altitude: Altitude data in meters.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Executes a ADC conversion delay of the 20 milliseconds.

◆ altitude6_get_pressure()

err_t altitude6_get_pressure ( altitude6_t * ctx,
float * pressure )

Altitude 6 get pressure data function.

This function read pressure data and convert to the mbar of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
[out]pressure: Pressure in mbar.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Executes a ADC conversion delay of the 10 milliseconds.

◆ altitude6_get_raw_data()

err_t altitude6_get_raw_data ( altitude6_t * ctx,
uint32_t * temp_data,
uint32_t * press_data )

Altitude 6 get raw data function.

This function read raw temperature and pressure data of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
[out]temp_data: Raw temperature data.
[out]press_data: Raw pressure data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Executes a ADC conversion delay of the 20 milliseconds.

◆ altitude6_get_temperature()

err_t altitude6_get_temperature ( altitude6_t * ctx,
float * temperature )

Altitude 6 get temperature data function.

This function read temperature data and convert to the degree Celsius of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
[out]temperature: Temperature in degree Celsius.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Executes a ADC conversion delay of the 10 milliseconds.

◆ altitude6_init()

err_t altitude6_init ( altitude6_t * ctx,
altitude6_cfg_t * cfg )

Altitude 6 initialization function.

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

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

◆ altitude6_set_command()

err_t altitude6_set_command ( altitude6_t * ctx,
uint8_t cmd )

Altitude 6 set command function.

This function writes a desired command of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
[in]cmd: Desired command.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ altitude6_set_ratio()

err_t altitude6_set_ratio ( altitude6_t * ctx,
uint8_t temp_ratio,
uint8_t press_ratio )

Altitude 6 set data ratio function.

This function set data ratio of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
[in]temp_ratio: Determines oversampling ratio for temperature measurement.
[in]press_ratio: Determines oversampling ration for pressure measurement.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ altitude6_sw_reset()

err_t altitude6_sw_reset ( altitude6_t * ctx)

Altitude 6 software reset function.

This function performs a software reset of the MS5611 Barometric Pressure Sensor, with stainless steel cap on the Altitude 6 click board™

Parameters
[in]ctx: Click context object. See altitude6_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Executes a reset - reload delay of the 3 milliseconds.