pressure23 2.1.0.0
Pressure 23 Click Driver

API for configuring and manipulating Pressure 23 Click driver. More...

Topics

 Pressure 23 Registers List
 List of registers of Pressure 23 Click driver.
 
 Pressure 23 Command List
 List of commands of Pressure 23 Click driver.
 
 Pressure 23 Registers Settings
 Settings for registers of Pressure 23 Click driver.
 
 Pressure 23 MikroBUS Map
 MikroBUS pin mapping of Pressure 23 Click driver.
 

Functions

void pressure23_cfg_setup (pressure23_cfg_t *cfg)
 Pressure 23 configuration object setup function.
 
void pressure23_drv_interface_selection (pressure23_cfg_t *cfg, pressure23_drv_t drv_sel)
 Pressure 23 driver interface setup function.
 
err_t pressure23_init (pressure23_t *ctx, pressure23_cfg_t *cfg)
 Pressure 23 initialization function.
 
err_t pressure23_default_cfg (pressure23_t *ctx)
 Pressure 23 default configuration function.
 
err_t pressure23_generic_write (pressure23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Pressure 23 data writing function.
 
err_t pressure23_generic_read (pressure23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Pressure 23 data reading function.
 
err_t pressure23_set_command (pressure23_t *ctx, uint8_t cmd)
 Pressure 23 set the command function.
 
err_t pressure23_sw_reset (pressure23_t *ctx)
 Pressure 23 software reset function.
 
err_t pressure23_read_memory (pressure23_t *ctx, uint8_t reg, uint16_t *prom)
 Pressure 23 read memory function.
 
err_t pressure23_start_conversion (pressure23_t *ctx, uint8_t sel_cnv)
 Pressure 23 start the conversion function.
 
err_t pressure23_write_config (pressure23_t *ctx, pressure23_sensor_cfg_t config)
 Pressure 23 configuration data writing function.
 
err_t pressure23_read_config (pressure23_t *ctx, uint8_t sel_cfg, pressure23_sensor_cfg_t *config)
 Pressure 23 configuration data reading function.
 
err_t pressure23_read_adc (pressure23_t *ctx, uint8_t sel_data, uint32_t *adc_data)
 Pressure 23 ADC data reading function.
 
err_t pressure23_write_op_reg (pressure23_t *ctx, uint8_t fifo_int_th, uint8_t fifo_mode, uint8_t delay)
 Pressure 23 operation register data writing function.
 
err_t pressure23_read_op_reg (pressure23_t *ctx, uint8_t *fifo_int_th, uint8_t *fifo_mode, uint8_t *delay)
 Pressure 23 operation register data reading function.
 
err_t pressure23_write_int_mask (pressure23_t *ctx, uint16_t int_mask_data)
 Pressure 23 interrupt mask data writing function.
 
err_t pressure23_read_int_mask (pressure23_t *ctx, uint16_t *int_mask_data)
 Pressure 23 interrupt mask data reading function.
 
err_t pressure23_write_int_reg (pressure23_t *ctx, uint16_t int_reg_data)
 Pressure 23 interrupt register data writing function.
 
err_t pressure23_read_int_reg (pressure23_t *ctx, uint16_t *int_reg_data)
 Pressure 23 interrupt register data reading function.
 
err_t pressure23_write_lim_reg (pressure23_t *ctx, uint8_t sel_adr, uint8_t sel_lim, uint16_t lim_reg_data)
 Pressure 23 limit register data writing function.
 
err_t pressure23_read_lim_reg (pressure23_t *ctx, uint8_t sel_adr, uint8_t sel_lim, uint16_t *lim_reg_data)
 Pressure 23 limit register data reading function.
 
err_t pressure23_get_adc_data_press (pressure23_t *ctx, uint32_t *pressure)
 Pressure 23 get the ADC pressure data function.
 
err_t pressure23_get_adc_data_temp (pressure23_t *ctx, uint32_t *temperature)
 Pressure 23 get the ADC temperature data function.
 
err_t pressure23_get_calibration_data (pressure23_t *ctx)
 Pressure 23 gets the calibration data function.
 
err_t pressure23_get_measurement_data (pressure23_t *ctx, float *pressure, float *temperature)
 Pressure 23 gets the measurement data function.
 
uint8_t pressure23_get_interrupt (pressure23_t *ctx)
 Pressure 23 gets the interrupt function.
 

Detailed Description

API for configuring and manipulating Pressure 23 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

◆ pressure23_cfg_setup()

void pressure23_cfg_setup ( pressure23_cfg_t * cfg)

Pressure 23 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ pressure23_default_cfg()

err_t pressure23_default_cfg ( pressure23_t * ctx)

Pressure 23 default configuration function.

This function executes a default configuration of Pressure 23 click board.

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

◆ pressure23_drv_interface_selection()

void pressure23_drv_interface_selection ( pressure23_cfg_t * cfg,
pressure23_drv_t drv_sel )

Pressure 23 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 pressure23_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See pressure23_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.

◆ pressure23_generic_read()

err_t pressure23_generic_read ( pressure23_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Pressure 23 data reading function.

This function reads a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]reg: Start register address.
[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.

◆ pressure23_generic_write()

err_t pressure23_generic_write ( pressure23_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Pressure 23 data writing function.

This function writes a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_get_adc_data_press()

err_t pressure23_get_adc_data_press ( pressure23_t * ctx,
uint32_t * pressure )

Pressure 23 get the ADC pressure data function.

This function reads a raw digital pressure value of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[out]pressure: Raw digital pressure value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_get_adc_data_temp()

err_t pressure23_get_adc_data_temp ( pressure23_t * ctx,
uint32_t * temperature )

Pressure 23 get the ADC temperature data function.

This function reads a raw digital temperature value of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[out]temperature: Raw digital temperature value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_get_calibration_data()

err_t pressure23_get_calibration_data ( pressure23_t * ctx)

Pressure 23 gets the calibration data function.

This function reads and store calibration data, factory calibrated from the PROM memory of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

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

◆ pressure23_get_interrupt()

uint8_t pressure23_get_interrupt ( pressure23_t * ctx)

Pressure 23 gets the interrupt function.

This function get states of the interrupt [INT] pin of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ pressure23_get_measurement_data()

err_t pressure23_get_measurement_data ( pressure23_t * ctx,
float * pressure,
float * temperature )

Pressure 23 gets the measurement data function.

This function reads temperature and pressure data conversion of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[out]pressure: Pressure data ( mbar ).
[out]temperature: Temperature data ( degree Celsius ).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_init()

err_t pressure23_init ( pressure23_t * ctx,
pressure23_cfg_t * cfg )

Pressure 23 initialization function.

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

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

◆ pressure23_read_adc()

err_t pressure23_read_adc ( pressure23_t * ctx,
uint8_t sel_data,
uint32_t * adc_data )

Pressure 23 ADC data reading function.

This function reads a desired ADC register data, converted pressure or/and temperature value of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]sel_data: ADC register data selection
  • 0x00 (PRESSURE23_CNV_ADC_SEL_PRESS) - Pressure,
  • 0x01 (PRESSURE23_CNV_ADC_SEL_TEMP) - Temperature.
[out]adc_data: Desired ADC raw data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_read_config()

err_t pressure23_read_config ( pressure23_t * ctx,
uint8_t sel_cfg,
pressure23_sensor_cfg_t * config )

Pressure 23 configuration data reading function.

This function reads a sensor configuration of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[out]config: Sensor configuration object. See pressure23_sensor_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_read_int_mask()

err_t pressure23_read_int_mask ( pressure23_t * ctx,
uint16_t * int_mask_data )

Pressure 23 interrupt mask data reading function.

This function reads a interrupt mask data which may trigger the application to execute specific actions of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[out]int_mask_data: Interrupt mask data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_read_int_reg()

err_t pressure23_read_int_reg ( pressure23_t * ctx,
uint16_t * int_reg_data )

Pressure 23 interrupt register data reading function.

This function reads a interrupt register data which may trigger the application to execute specific actions of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[out]int_reg_data: Interrupt register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_read_lim_reg()

err_t pressure23_read_lim_reg ( pressure23_t * ctx,
uint8_t sel_adr,
uint8_t sel_lim,
uint16_t * lim_reg_data )

Pressure 23 limit register data reading function.

This function reads a limit register data of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]sel_adr: Limit register data selection
  • 0x00 (PRESSURE23_LIM_REG_SEL_TEMP) - Temperature,
  • 0x01 (PRESSURE23_LIM_REG_SEL_PRESS) - Pressure.
[in]sel_lim: Limit selection
  • 0x00 (PRESSURE23_LIM_REG_LIM_LOW) - Low limit,
  • 0x01 (PRESSURE23_LIM_REG_LIM_HIGH) - High limit.
[out]lim_reg_data: Limit register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_read_memory()

err_t pressure23_read_memory ( pressure23_t * ctx,
uint8_t reg,
uint16_t * prom )

Pressure 23 read memory function.

This function reads memory is used to download coefficients programmed in the memory during factory calibration of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]reg: Register address.
[out]prom: Output read data from PROM.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_read_op_reg()

err_t pressure23_read_op_reg ( pressure23_t * ctx,
uint8_t * fifo_int_th,
uint8_t * fifo_mode,
uint8_t * delay )

Pressure 23 operation register data reading function.

This function reads a operation register data of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[out]fifo_int_th: FIFO Interrupt threshold [0-31].
[out]fifo_mode: FIFO mode [0-2].
[out]delay: Time between automatically triggered measurements [0-13].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_set_command()

err_t pressure23_set_command ( pressure23_t * ctx,
uint8_t cmd )

Pressure 23 set the command function.

This function writes the desired command of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

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

◆ pressure23_start_conversion()

err_t pressure23_start_conversion ( pressure23_t * ctx,
uint8_t sel_cnv )

Pressure 23 start the conversion function.

This function start the desired conversion, pressure or temperature conversion of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]sel_cnv: Conversion selection
  • 0x00 (PRESSURE23_CNV_ADC_SEL_PRESS) - Pressure conversion,
  • 0x01 (PRESSURE23_CNV_ADC_SEL_TEMP) - Temperature conversion.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_sw_reset()

err_t pressure23_sw_reset ( pressure23_t * ctx)

Pressure 23 software reset function.

This function performs the reset sequence shall be sent once after power-on to make sure that the calibration data gets loaded into the internal register of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

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

◆ pressure23_write_config()

err_t pressure23_write_config ( pressure23_t * ctx,
pressure23_sensor_cfg_t config )

Pressure 23 configuration data writing function.

This function writes a desired sensor configuration of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]config: Sensor configuration object. See pressure23_sensor_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_write_int_mask()

err_t pressure23_write_int_mask ( pressure23_t * ctx,
uint16_t int_mask_data )

Pressure 23 interrupt mask data writing function.

This function writes a interrupt mask data to enable interruptions which may trigger the application to execute specific actions of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]int_mask_data: Interrupt mask data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_write_int_reg()

err_t pressure23_write_int_reg ( pressure23_t * ctx,
uint16_t int_reg_data )

Pressure 23 interrupt register data writing function.

This function writes a interrupt register data to enable interruptions which may trigger the application to execute specific actions of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]int_reg_data: Interrupt register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_write_lim_reg()

err_t pressure23_write_lim_reg ( pressure23_t * ctx,
uint8_t sel_adr,
uint8_t sel_lim,
uint16_t lim_reg_data )

Pressure 23 limit register data writing function.

This function writes a limit register data to allow to automatically rise an interrupt if one or both converted values does exceed the limits programmed in the registers which may trigger the application to execute specific actions of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]sel_adr: Limit register data selection
  • 0x00 (PRESSURE23_LIM_REG_SEL_TEMP) - Temperature,
  • 0x01 (PRESSURE23_LIM_REG_SEL_PRESS) - Pressure.
[in]sel_lim: Limit selection
  • 0x00 (PRESSURE23_LIM_REG_LIM_LOW) - Low limit,
  • 0x01 (PRESSURE23_LIM_REG_LIM_HIGH) - High limit.
[in]lim_reg_data: Limit register data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ pressure23_write_op_reg()

err_t pressure23_write_op_reg ( pressure23_t * ctx,
uint8_t fifo_int_th,
uint8_t fifo_mode,
uint8_t delay )

Pressure 23 operation register data writing function.

This function writes a operation register to control behavior of the FIFO and the automatic mode of the MS5849-30BA, Ultra-compact, chlorine resistant, absolute pressure sensor on the Pressure 23 Click board™.

Parameters
[in]ctx: Click context object. See pressure23_t object definition for detailed explanation.
[in]fifo_int_th: FIFO Interrupt threshold [0-31].
[in]fifo_mode: FIFO mode [0-2].
[in]delay: Time between automatically triggered measurements [0-13].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.