pressure17 2.0.0.0
Pressure 17 Click Driver

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

Topics

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

Functions

void pressure17_cfg_setup (pressure17_cfg_t *cfg)
 Pressure 17 configuration object setup function.
 
err_t pressure17_init (pressure17_t *ctx, pressure17_cfg_t *cfg)
 Pressure 17 initialization function.
 
err_t pressure17_default_cfg (pressure17_t *ctx)
 Pressure 17 default configuration function.
 
err_t pressure17_generic_write (pressure17_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Pressure 17 I2C writing function.
 
err_t pressure17_generic_read (pressure17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Pressure 17 I2C reading function.
 
err_t pressure17_write_register (pressure17_t *ctx, uint8_t reg, uint8_t data_in)
 Pressure 17 write register function.
 
err_t pressure17_read_register (pressure17_t *ctx, uint8_t reg, uint8_t *data_out)
 Pressure 17 read register function.
 
err_t pressure17_check_communication (pressure17_t *ctx)
 Pressure 17 check communication function.
 
err_t pressure17_read_data (pressure17_t *ctx, float *pressure, float *temperature)
 Pressure 17 read data function.
 
uint8_t pressure17_get_int_pin (pressure17_t *ctx)
 Pressure 17 get int pin function.
 

Detailed Description

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

◆ pressure17_cfg_setup()

void pressure17_cfg_setup ( pressure17_cfg_t * cfg)

Pressure 17 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ pressure17_check_communication()

err_t pressure17_check_communication ( pressure17_t * ctx)

Pressure 17 check communication function.

This function checks the communication by reading and verifying the manufacturer and part IDs.

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

◆ pressure17_default_cfg()

err_t pressure17_default_cfg ( pressure17_t * ctx)

Pressure 17 default configuration function.

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

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

◆ pressure17_generic_read()

err_t pressure17_generic_read ( pressure17_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Pressure 17 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See pressure17_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ pressure17_generic_write()

err_t pressure17_generic_write ( pressure17_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Pressure 17 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

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

◆ pressure17_get_int_pin()

uint8_t pressure17_get_int_pin ( pressure17_t * ctx)

Pressure 17 get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See pressure17_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ pressure17_init()

err_t pressure17_init ( pressure17_t * ctx,
pressure17_cfg_t * cfg )

Pressure 17 initialization function.

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

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

◆ pressure17_read_data()

err_t pressure17_read_data ( pressure17_t * ctx,
float * pressure,
float * temperature )

Pressure 17 read data function.

This function checks if the data is ready and then reads the pressure and temperature raw data and converts them to millibar and Celsius respectfully.

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

◆ pressure17_read_register()

err_t pressure17_read_register ( pressure17_t * ctx,
uint8_t reg,
uint8_t * data_out )

Pressure 17 read register function.

This function reads data from the selected register by using I2C serial interface.

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

◆ pressure17_write_register()

err_t pressure17_write_register ( pressure17_t * ctx,
uint8_t reg,
uint8_t data_in )

Pressure 17 write register function.

This function writes a data byte to the selected register by using I2C serial interface.

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