ultralowpress 2.0.0.0
Ultra-Low Press Click Driver

API for configuring and manipulating Ultra-Low Press Click driver. More...

Topics

 Ultra-Low Press Registers List
 List of registers of Ultra-Low Press Click driver.
 
 Ultra-Low Press Registers Settings
 Settings for registers of Ultra-Low Press Click driver.
 
 Ultra-Low Press MikroBUS Map
 MikroBUS pin mapping of Ultra-Low Press Click driver.
 

Functions

void ultralowpress_cfg_setup (ultralowpress_cfg_t *cfg)
 Ultra-Low Press configuration object setup function.
 
err_t ultralowpress_init (ultralowpress_t *ctx, ultralowpress_cfg_t *cfg)
 Ultra-Low Press initialization function.
 
err_t ultralowpress_generic_write (ultralowpress_t *ctx, uint8_t reg, uint16_t tx_data)
 Writing function.
 
err_t ultralowpress_generic_read (ultralowpress_t *ctx, uint8_t reg, uint16_t *rx_data)
 Reading function.
 
void ultralowpress_clear_status (ultralowpress_t *ctx)
 Clear status.
 
uint8_t ultralowpress_ready_to_read (ultralowpress_t *ctx)
 Ready to read.
 
float ultralowpress_get_press (ultralowpress_t *ctx)
 Read pressure.
 
float ultralowpress_get_temp (ultralowpress_t *ctx)
 Read temperature.
 

Detailed Description

API for configuring and manipulating Ultra-Low Press 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

◆ ultralowpress_cfg_setup()

void ultralowpress_cfg_setup ( ultralowpress_cfg_t * cfg)

Ultra-Low Press configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation.
Returns
Nothing.

◆ ultralowpress_clear_status()

void ultralowpress_clear_status ( ultralowpress_t * ctx)

Clear status.

Clears status register by writing 0xFFFF to it.

Parameters
[out]cfg: Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation.
Returns
Nothing.

◆ ultralowpress_generic_read()

err_t ultralowpress_generic_read ( ultralowpress_t * ctx,
uint8_t reg,
uint16_t * rx_data )

Reading function.

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

Parameters
[in]ctx: Click context object. See ultralowpress_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_data: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.

◆ ultralowpress_generic_write()

err_t ultralowpress_generic_write ( ultralowpress_t * ctx,
uint8_t reg,
uint16_t tx_data )

Writing function.

This function writes a data word to register by using I2C serial interface.

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

◆ ultralowpress_get_press()

float ultralowpress_get_press ( ultralowpress_t * ctx)

Read pressure.

Reads pressure from register and calculates and converts data to Pascal data.

Parameters
[out]cfg: Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation.
Returns
Pressure data in Pascal.

◆ ultralowpress_get_temp()

float ultralowpress_get_temp ( ultralowpress_t * ctx)

Read temperature.

Reads temperature from register and calculates and converts data to Celzius data.

Parameters
[out]cfg: Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation.
Returns
Temperature data in Celzius.

◆ ultralowpress_init()

err_t ultralowpress_init ( ultralowpress_t * ctx,
ultralowpress_cfg_t * cfg )

Ultra-Low Press initialization function.

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

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

◆ ultralowpress_ready_to_read()

uint8_t ultralowpress_ready_to_read ( ultralowpress_t * ctx)

Ready to read.

Reads status and checks if status bits for temperature and pressure data is ready.

Parameters
[out]cfg: Click configuration structure. See ultralowpress_cfg_t object definition for detailed explanation.
Returns
  • 1 - Temperature and pressure data ready to read.
  • 0 - Temperature and pressure data not ready to read.