barometer 2.0.0.0
Public function

Functions

void barometer_cfg_setup (barometer_cfg_t *cfg)
 Config Object Initialization function.
 
BAROMETER_RETVAL barometer_init (barometer_t *ctx, barometer_cfg_t *cfg)
 Initialization function.
 
void barometer_default_cfg (barometer_t *ctx)
 Click Default Configuration function.
 
void barometer_generic_write (barometer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void barometer_generic_read (barometer_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t barometer_read_data (barometer_t *ctx, uint8_t address)
 Generic read 8-bit data function.
 
void barometer_set_active (barometer_t *ctx)
 Sets the module active function.
 
float barometer_get_temperature_c (barometer_t *ctx)
 Read temperature in degrees Celsius function.
 
float barometer_get_temperature_f (barometer_t *ctx)
 Read temperature in degrees of Fahrenheit function.
 
float barometer_get_pressure (barometer_t *ctx)
 Read pressure in milibars function.
 
uint8_t barometer_check_id (barometer_t *ctx)
 Check sensor id - Who Am I function.
 
uint8_t barometer_check_status (barometer_t *ctx)
 Check sensor status function.
 
uint8_t barometer_check_interrupt (barometer_t *ctx)
 State of interrupt pin function.
 

Detailed Description

Function Documentation

◆ barometer_cfg_setup()

void barometer_cfg_setup ( barometer_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ barometer_check_id()

uint8_t barometer_check_id ( barometer_t * ctx)

Check sensor id - Who Am I function.

Parameters
ctxClick object.
Returns
8-bit id data from Who Am I register

Function read sensor id ( Who Am I register ) from the LPS25HB sensor.

◆ barometer_check_interrupt()

uint8_t barometer_check_interrupt ( barometer_t * ctx)

State of interrupt pin function.

Parameters
ctxClick object.
Returns
State of INT pin - 0 or 1

Function checks is interrupt occurred and returns the state of the INT pin. INT pin can be configured to show are data registers updated with the new values or not.

◆ barometer_check_status()

uint8_t barometer_check_status ( barometer_t * ctx)

Check sensor status function.

Parameters
ctxClick object.
Returns
8-bit id data from status register

Function read sensor status ( status register ) from the LPS25HB sensor.

◆ barometer_default_cfg()

void barometer_default_cfg ( barometer_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Note
        set: BAROMETER_CTRL_REG1
               - BAROMETER_DEFAULT_CONFIG
*
@description This function executes default configuration for Barometer click.

◆ barometer_generic_read()

void barometer_generic_read ( barometer_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function reads data from the desired register.

◆ barometer_generic_write()

void barometer_generic_write ( barometer_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function writes data to the desired register.

◆ barometer_get_pressure()

float barometer_get_pressure ( barometer_t * ctx)

Read pressure in milibars function.

Parameters
ctxClick object.
Returns
float pressure data in milibars [ mbar ]

Function read and calculate pressure in milibars from the LPS25HB sensor.

◆ barometer_get_temperature_c()

float barometer_get_temperature_c ( barometer_t * ctx)

Read temperature in degrees Celsius function.

Parameters
ctxClick object.
Returns
float temperature data degrees Celsius [ �C ]

Function read and calculate temperature in degrees Celsius from the LPS25HB sensor.

◆ barometer_get_temperature_f()

float barometer_get_temperature_f ( barometer_t * ctx)

Read temperature in degrees of Fahrenheit function.

Parameters
ctxClick object.
Returns
float temperature data degrees Fahrenheit [ �F ]

Function read and calculate temperature in degrees Fahrenheit from the LPS25HB sensor.

◆ barometer_init()

BAROMETER_RETVAL barometer_init ( barometer_t * ctx,
barometer_cfg_t * cfg )

Initialization function.

Parameters
barometerClick object.
cfgClick configuration structure.

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

◆ barometer_read_data()

uint8_t barometer_read_data ( barometer_t * ctx,
uint8_t address )

Generic read 8-bit data function.

Parameters
ctxClick object.
addressRegister address
Returns
8-bit data from addressed register from the LPS25HB

Function read 8-bit data from register address of the LPS25HB sensor.

◆ barometer_set_active()

void barometer_set_active ( barometer_t * ctx)

Sets the module active function.

Parameters
ctxClick object. Function set active mode by writing configuration register from the LPS25HB sensor.