piezoaccel 2.0.0.0
Piezo Accel Click Driver

API for configuring and manipulating Piezo Accel Click driver. More...

Topics

 Piezo Accel MikroBUS Map
 MikroBUS pin mapping of Piezo Accel Click driver.
 
 Measurement_mode
 
 Sensor_voltage
 

Functions

void piezoaccel_cfg_setup (piezoaccel_cfg_t *cfg)
 Piezo Accel configuration object setup function.
 
err_t piezoaccel_init (piezoaccel_t *ctx, piezoaccel_cfg_t *cfg)
 Piezo Accel initialization function.
 
void piezoaccel_default_cfg (piezoaccel_t *ctx, piezoaccel_setup_t *setup_cfg_data)
 Piezo Accel default configuration function.
 
uint16_t piezoaccel_adc_raw_read (piezoaccel_t *ctx)
 Piezo Accel read raw adc function.
 
float piezoaccel_adc_voltage_read (piezoaccel_t *ctx)
 Piezo Accel read adc converted to voltage function.
 
err_t piezoaccel_read_an_pin_value (piezoaccel_t *ctx, uint16_t *data_out)
 Piezo Accel read AN pin value function.
 
err_t piezoaccel_read_an_pin_voltage (piezoaccel_t *ctx, float *data_out)
 Piezo Accel read AN pin voltage level function.
 
float piezoaccel_g_unit_read (piezoaccel_t *ctx, piezoaccel_setup_t *cfg_data)
 Piezo Accel read force of acceleration function.
 
void piezoaccel_calibration (piezoaccel_t *ctx, piezoaccel_setup_t *cfg_data)
 Piezo Accel calibration function.
 

Detailed Description

API for configuring and manipulating Piezo Accel 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

◆ piezoaccel_adc_raw_read()

uint16_t piezoaccel_adc_raw_read ( piezoaccel_t * ctx)

Piezo Accel read raw adc function.

This function returns raw value of LTC1864 adc.

Parameters
[in]ctx: Click context object. See piezoaccel_t object definition for detailed explanation.
Returns
Raw adc value.
Note
None.

◆ piezoaccel_adc_voltage_read()

float piezoaccel_adc_voltage_read ( piezoaccel_t * ctx)

Piezo Accel read adc converted to voltage function.

This function returns input voltage value of LTC1864 adc.

Parameters
[in]ctx: Click context object. See piezoaccel_t object definition for detailed explanation.
Returns
Voltage adc value [V].
Note
None.

◆ piezoaccel_calibration()

void piezoaccel_calibration ( piezoaccel_t * ctx,
piezoaccel_setup_t * cfg_data )

Piezo Accel calibration function.

This function performs calibration which updates the offset data in config structure. Used to correct the offset output voltage caused by the inaccurate power supply of the sensor.

Parameters
[in]ctx: Click context object. See #analogmux2_t object definition for detailed explanation.
cfg_data: Config data structure.
Note
None.

◆ piezoaccel_cfg_setup()

void piezoaccel_cfg_setup ( piezoaccel_cfg_t * cfg)

Piezo Accel configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ piezoaccel_default_cfg()

void piezoaccel_default_cfg ( piezoaccel_t * ctx,
piezoaccel_setup_t * setup_cfg_data )

Piezo Accel default configuration function.

This function executes a default configuration of Piezo Accel click board.

Parameters
[in]ctx: Click context object. See piezoaccel_t object definition for detailed explanation.
setup_cfg_data: Setup config structure.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ piezoaccel_g_unit_read()

float piezoaccel_g_unit_read ( piezoaccel_t * ctx,
piezoaccel_setup_t * cfg_data )

Piezo Accel read force of acceleration function.

This function returns the converted G-force of acceleration depending on the config settings. In addition, the configuration has to be set on the click board by soldering jumpers.

Parameters
[in]ctx: Click context object. See #analogmux2_t object definition for detailed explanation.
cfg_data: Config data structure.
Returns
G-force acceleration value.
Note
None.

◆ piezoaccel_init()

err_t piezoaccel_init ( piezoaccel_t * ctx,
piezoaccel_cfg_t * cfg )

Piezo Accel initialization function.

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

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

◆ piezoaccel_read_an_pin_value()

err_t piezoaccel_read_an_pin_value ( piezoaccel_t * ctx,
uint16_t * data_out )

Piezo Accel read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See #analogmux2_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ piezoaccel_read_an_pin_voltage()

err_t piezoaccel_read_an_pin_voltage ( piezoaccel_t * ctx,
float * data_out )

Piezo Accel read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See #analogmux2_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).