pressure2 2.0.0.0

Functions

void pressure2_cfg_setup (pressure2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t pressure2_init (pressure2_t *ctx, pressure2_cfg_t *cfg)
 Initialization function.
 
err_t pressure2_default_cfg (pressure2_t *ctx)
 Click Default Configuration function.
 
void pressure2_reset (pressure2_t *ctx)
 Functions for reset chip.
 
void pressure2_read_data (pressure2_t *ctx, uint8_t cmd, uint8_t *buffer, uint8_t n_bytes)
 Generic transfer function.
 
void pressure2_write_bytes (pressure2_t *ctx, uint8_t cmd)
 Sends command.
 
uint16_t pressure2_read_coefficient (pressure2_t *ctx, uint8_t index)
 Read calibration coefficients and return coefficient.
 
uint32_t pressure2_send_cmd_adc (pressure2_t *ctx, uint8_t cmd)
 ADC conversion and return 24bit result.
 
void pressure2_read_sensor (pressure2_t *ctx, float *press, float *temp)
 Read sensor.
 

Detailed Description

Function Documentation

◆ pressure2_cfg_setup()

void pressure2_cfg_setup ( pressure2_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ pressure2_default_cfg()

err_t pressure2_default_cfg ( pressure2_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for Pressure 2 click.

◆ pressure2_init()

err_t pressure2_init ( pressure2_t * ctx,
pressure2_cfg_t * cfg )

Initialization function.

Parameters
pressure2Click object.
cfgClick configuration structure.

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

◆ pressure2_read_coefficient()

uint16_t pressure2_read_coefficient ( pressure2_t * ctx,
uint8_t index )

Read calibration coefficients and return coefficient.

Parameters
ctxClick object.
index
Returns
Coefficient.

This function read calibration coefficients and return coefficient.

◆ pressure2_read_data()

void pressure2_read_data ( pressure2_t * ctx,
uint8_t cmd,
uint8_t * buffer,
uint8_t n_bytes )

Generic transfer function.

Parameters
ctxClick object.
reg_addrAddress which from data be read.
bufferMemory where data be stored.
n_bytesNumber of bytes to be read.

Reads multiple registries depending on the specified number of bytes.

◆ pressure2_read_sensor()

void pressure2_read_sensor ( pressure2_t * ctx,
float * press,
float * temp )

Read sensor.

Parameters
ctxClick object.
pressPressure to be calculate;
tempPressure to be calculate;

Functions for readding sensor.

◆ pressure2_reset()

void pressure2_reset ( pressure2_t * ctx)

Functions for reset chip.

Parameters
ctxClick object.

Functions for reset chip.

◆ pressure2_send_cmd_adc()

uint32_t pressure2_send_cmd_adc ( pressure2_t * ctx,
uint8_t cmd )

ADC conversion and return 24bit result.

Parameters
ctxClick object.
cmdCommand to be send.
Returns
24bit result.

This function preforms ADC conversion and return 24bit result.

◆ pressure2_write_bytes()

void pressure2_write_bytes ( pressure2_t * ctx,
uint8_t cmd )

Sends command.

Parameters
ctxClick object.
cmdCommand to be written.

Sends command using SPI protocol.