pressure 2.0.0.0
Public Function

Functions

void pressure_cfg_setup (pressure_cfg_t *cfg)
 Configuration Object Setup function.
 
pressure_err_t pressure_init (pressure_t *ctx, pressure_cfg_t *cfg)
 Click Initialization function.
 
void pressure_default_cfg (pressure_t *ctx)
 Click Default Configuration function.
 
pressure_err_t pressure_generic_single_write (pressure_t *ctx, uint8_t reg_addr, uint8_t data_in)
 Generic Single Write function.
 
pressure_err_t pressure_generic_multiple_write (pressure_t *ctx, uint8_t reg_addr, uint8_t *data_in, uint8_t n_data)
 Generic Multiple Write function.
 
pressure_err_t pressure_generic_multiple_read (pressure_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint8_t n_data)
 Generic Multiple Read function.
 
uint8_t pressure_read_id (pressure_t *ctx)
 ID Read function.
 
void pressure_set_odr (pressure_t *ctx, pressure_odr_t odr)
 Output Data Rate Set function.
 
void pressure_pwr_ctrl (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Device Power Control function.
 
void pressure_pwr_ctrl_interrupt (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Interrupt Power Control function.
 
void pressure_block_data_update (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Data Update Block function.
 
void pressure_pwr_ctrl_delta_pressure (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Delta Pressure Power Control function.
 
void pressure_reboot_memory (pressure_t *ctx)
 Memory Reboot function.
 
void pressure_sw_reset (pressure_t *ctx)
 Software Reset function.
 
float pressure_get_pressure (pressure_t *ctx)
 Pressure Get function.
 
float pressure_get_temperature (pressure_t *ctx)
 Temperature Get function.
 
uint8_t pressure_get_status (pressure_t *ctx, uint8_t bit_mask)
 Status Get function.
 
uint8_t pressure_get_int_pin (pressure_t *ctx)
 INT Pin Get function.
 

Detailed Description

Function Documentation

◆ pressure_block_data_update()

void pressure_block_data_update ( pressure_t * ctx,
pressure_pwr_ctrl_t state )

Data Update Block function.

Parameters
ctxClick object.
state0 - Not blocked, 1 - Blocked.

@description This function allows output registers to not be updated until MSB and LSB reading was done.

Note
In other case the continuous data update will be performed.

◆ pressure_cfg_setup()

void pressure_cfg_setup ( pressure_cfg_t * cfg)

Configuration Object Setup function.

Parameters
cfgClick configuration structure.

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

Note
All used pins will be set to unconnected state.

◆ pressure_default_cfg()

void pressure_default_cfg ( pressure_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Pressure click.

Note
Pressure click will be set to work in the default normal mode.

◆ pressure_generic_multiple_read()

pressure_err_t pressure_generic_multiple_read ( pressure_t * ctx,
uint8_t reg_addr,
uint8_t * data_out,
uint8_t n_data )

Generic Multiple Read function.

Parameters
ctxClick object.
reg_addrRegister address.
data_outMemory where read data be stored.
n_dataNumber of bytes to be read.
Returns
0x0 - Ok, 0xFE - Invalid register address, 0xFF - Number of bytes is out of range.

@description This function reads one or more data bytes starting from the selected register.

◆ pressure_generic_multiple_write()

pressure_err_t pressure_generic_multiple_write ( pressure_t * ctx,
uint8_t reg_addr,
uint8_t * data_in,
uint8_t n_data )

Generic Multiple Write function.

Parameters
ctxClick object.
reg_addrRegister address.
data_inData to be written.
n_dataNumber of bytes to be written.
Returns
0x0 - Ok, 0xFE - Invalid register address, 0xFF - Number of bytes is out of range.

@description This function writes one or more data bytes starting from the selected register.

◆ pressure_generic_single_write()

pressure_err_t pressure_generic_single_write ( pressure_t * ctx,
uint8_t reg_addr,
uint8_t data_in )

Generic Single Write function.

Parameters
ctxClick object.
reg_addrRegister address.
data_inData to be written.
Returns
0x0 - Ok, 0xFE - Invalid register address.

@description This function writes one data byte to the desired register.

◆ pressure_get_int_pin()

uint8_t pressure_get_int_pin ( pressure_t * ctx)

INT Pin Get function.

Parameters
ctxClick object.
Returns
Pin state [bool].

@description This function returns true if the high voltage level detected on the INT pin, or returns false if the low voltage level detected on the INT pin.

◆ pressure_get_pressure()

float pressure_get_pressure ( pressure_t * ctx)

Pressure Get function.

Parameters
ctxClick object.
Returns
Pressure [mbar].

@description This function returns the pressure converted to mbar.

◆ pressure_get_status()

uint8_t pressure_get_status ( pressure_t * ctx,
uint8_t bit_mask )

Status Get function.

Parameters
ctxClick object.
bit_maskSelects the flag bits which will be checked in status byte.
Returns
Status byte.

@description This function allows user to check the desired flags in Status register.

◆ pressure_get_temperature()

float pressure_get_temperature ( pressure_t * ctx)

Temperature Get function.

Parameters
ctxClick object.
Returns
Temperature [Celsius degrees].

@description This function returns the temperature converted to Celsius degrees.

◆ pressure_init()

pressure_err_t pressure_init ( pressure_t * ctx,
pressure_cfg_t * cfg )

Click Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.
Returns
0x0 - Ok, 0xFD - Driver init error.

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

Note
All configuration settings will be entered from the configuration structure.

◆ pressure_pwr_ctrl()

void pressure_pwr_ctrl ( pressure_t * ctx,
pressure_pwr_ctrl_t state )

Device Power Control function.

Parameters
ctxClick object.
statePower state of the device [0 - Disable, 1 - Enable].

@description This function performs the power control of the device.

◆ pressure_pwr_ctrl_delta_pressure()

void pressure_pwr_ctrl_delta_pressure ( pressure_t * ctx,
pressure_pwr_ctrl_t state )

Delta Pressure Power Control function.

Parameters
ctxClick object.
statePower state of delta pressure [0 - Disable, 1 - Enable].

@description This function performs the power control of delta pressure registers.

◆ pressure_pwr_ctrl_interrupt()

void pressure_pwr_ctrl_interrupt ( pressure_t * ctx,
pressure_pwr_ctrl_t state )

Interrupt Power Control function.

Parameters
ctxClick object.
stateInterrupt power state [0 - Disable, 1 - Enable].

@description This function performs the power control of the interrupt.

◆ pressure_read_id()

uint8_t pressure_read_id ( pressure_t * ctx)

ID Read function.

Parameters
ctxClick object.
Returns
Device ID byte.

@description This function reads the device ID.

◆ pressure_reboot_memory()

void pressure_reboot_memory ( pressure_t * ctx)

Memory Reboot function.

Parameters
ctxClick object.

@description This function is used to refresh the content of the internal registers stored in the Flash memory block.

◆ pressure_set_odr()

void pressure_set_odr ( pressure_t * ctx,
pressure_odr_t odr )

Output Data Rate Set function.

Parameters
ctxClick object.
odrData Rate value.

@description This function executes output data rate setting.

◆ pressure_sw_reset()

void pressure_sw_reset ( pressure_t * ctx)

Software Reset function.

Parameters
ctxClick object.

@description This function allows device to be reset to the power on configuration.