pressure16 2.0.0.0
Pressure 16 Click Driver

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

Topics

 Pressure 16 Registers List
 List of registers of Pressure 16 Click driver.
 
 Pressure 16 Registers Settings
 Settings for registers of Pressure 16 Click driver.
 
 Pressure 16 MikroBUS Map
 MikroBUS pin mapping of Pressure 16 Click driver.
 

Functions

void pressure16_cfg_setup (pressure16_cfg_t *cfg)
 Pressure 16 configuration object setup function.
 
void pressure16_drv_interface_selection (pressure16_cfg_t *cfg, pressure16_drv_t drv_sel)
 Pressure 16 driver interface setup function.
 
err_t pressure16_init (pressure16_t *ctx, pressure16_cfg_t *cfg)
 Pressure 16 initialization function.
 
err_t pressure16_default_cfg (pressure16_t *ctx)
 Pressure 16 default configuration function.
 
err_t pressure16_generic_write (pressure16_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Pressure 16 data writing function.
 
err_t pressure16_generic_read (pressure16_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Pressure 16 data reading function.
 
err_t pressure16_get_device_id (pressure16_t *ctx, uint8_t *dev_id)
 Pressure 16 get device ID function.
 
err_t pressure16_sw_reset (pressure16_t *ctx)
 Pressure 16 software reset function.
 
err_t pressure16_set_interrupt_config (pressure16_t *ctx, pressure16_int_cfg_t int_cfg_data)
 Pressure 16 set interrupt configuration function.
 
err_t pressure16_get_interrupt_config (pressure16_t *ctx, pressure16_int_cfg_t *int_cfg_data)
 Pressure 16 get interrupt configuration function.
 
err_t pressure16_set_ctrl_config (pressure16_t *ctx, pressure16_ctrl_cfg_t ctrl_cfg_data)
 Pressure 16 set control configuration function.
 
err_t pressure16_get_ctrl_config (pressure16_t *ctx, pressure16_ctrl_cfg_t *ctrl_cfg_data)
 Pressure 16 get control configuration function.
 
err_t pressure16_get_pressure (pressure16_t *ctx, float *pressure)
 Pressure 16 get pressure function.
 
err_t pressure16_get_temperature (pressure16_t *ctx, float *temperature)
 Pressure 16 get temperature function.
 
err_t pressure16_get_press_temp (pressure16_t *ctx, float *pressure, float *temperature)
 Pressure 16 get pressure and temperature function.
 
uint8_t pressure16_get_interrupt (pressure16_t *ctx)
 Pressure 16 get interrupt function.
 

Detailed Description

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

◆ pressure16_cfg_setup()

void pressure16_cfg_setup ( pressure16_cfg_t * cfg)

Pressure 16 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ pressure16_default_cfg()

err_t pressure16_default_cfg ( pressure16_t * ctx)

Pressure 16 default configuration function.

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

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

◆ pressure16_drv_interface_selection()

void pressure16_drv_interface_selection ( pressure16_cfg_t * cfg,
pressure16_drv_t drv_sel )

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

◆ pressure16_generic_read()

err_t pressure16_generic_read ( pressure16_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Pressure 16 data reading function.

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

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

◆ pressure16_generic_write()

err_t pressure16_generic_write ( pressure16_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Pressure 16 data writing function.

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

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

◆ pressure16_get_ctrl_config()

err_t pressure16_get_ctrl_config ( pressure16_t * ctx,
pressure16_ctrl_cfg_t * ctrl_cfg_data )

Pressure 16 get control configuration function.

This function get control configuration of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_get_device_id()

err_t pressure16_get_device_id ( pressure16_t * ctx,
uint8_t * dev_id )

Pressure 16 get device ID function.

This function reads a device ID from PRESSURE16_REG_DEVICE_ID register address of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_get_interrupt()

uint8_t pressure16_get_interrupt ( pressure16_t * ctx)

Pressure 16 get interrupt function.

This function get interrupt state of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

Parameters
[in]ctx: Click context object. See pressure16_t object definition for detailed explanation.
Returns
Interrupt state.

See #err_t definition for detailed explanation.

Note
None.

◆ pressure16_get_interrupt_config()

err_t pressure16_get_interrupt_config ( pressure16_t * ctx,
pressure16_int_cfg_t * int_cfg_data )

Pressure 16 get interrupt configuration function.

This function get interrupt configuration of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_get_press_temp()

err_t pressure16_get_press_temp ( pressure16_t * ctx,
float * pressure,
float * temperature )

Pressure 16 get pressure and temperature function.

This function get pressure and temperature data of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_get_pressure()

err_t pressure16_get_pressure ( pressure16_t * ctx,
float * pressure )

Pressure 16 get pressure function.

This function get pressure data of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_get_temperature()

err_t pressure16_get_temperature ( pressure16_t * ctx,
float * temperature )

Pressure 16 get temperature function.

This function get temperature data of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_init()

err_t pressure16_init ( pressure16_t * ctx,
pressure16_cfg_t * cfg )

Pressure 16 initialization function.

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

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

◆ pressure16_set_ctrl_config()

err_t pressure16_set_ctrl_config ( pressure16_t * ctx,
pressure16_ctrl_cfg_t ctrl_cfg_data )

Pressure 16 set control configuration function.

This function set control configuration of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_set_interrupt_config()

err_t pressure16_set_interrupt_config ( pressure16_t * ctx,
pressure16_int_cfg_t int_cfg_data )

Pressure 16 set interrupt configuration function.

This function set interrupt configuration of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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

◆ pressure16_sw_reset()

err_t pressure16_sw_reset ( pressure16_t * ctx)

Pressure 16 software reset function.

This function performs a software reset of the WSEN-PADS Absolute Pressure Sensor on the Pressure 16 Click board™.

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