accel19 2.0.0.0
Accel 19 Click Driver

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

Topics

 Accel 19 Registers List
 List of registers of Accel 19 Click driver.
 
 Accel 19 Registers Settings
 Settings for registers of Accel 19 Click driver.
 
 Accel 19 MikroBUS Map
 MikroBUS pin mapping of Accel 19 Click driver.
 

Functions

void accel19_cfg_setup (accel19_cfg_t *cfg)
 Accel 19 configuration object setup function.
 
void accel19_drv_interface_selection (accel19_cfg_t *cfg, accel19_drv_t drv_sel)
 Accel 19 driver interface setup function.
 
err_t accel19_init (accel19_t *ctx, accel19_cfg_t *cfg)
 Accel 19 initialization function.
 
err_t accel19_default_cfg (accel19_t *ctx)
 Accel 19 default configuration function.
 
err_t accel19_generic_write (accel19_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Accel 19 data writing function.
 
err_t accel19_generic_read (accel19_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Accel 19 data reading function.
 
err_t accel19_get_temperature (accel19_t *ctx, float *temperature)
 Accel 19 get temperature function.
 
err_t accel19_check_device_id (accel19_t *ctx)
 Accel 19 check device ID function.
 
err_t accel19_set_control (accel19_t *ctx, uint8_t odr, uint8_t op_mode, uint8_t lp_mode)
 Accel 19 set control function.
 
err_t accel19_soft_reset (accel19_t *ctx)
 Accel 19 soft reset function.
 
err_t accel19_get_status (accel19_t *ctx, uint8_t *status)
 Accel 19 get status function.
 
uint8_t accel19_data_ready (accel19_t *ctx)
 Accel 19 data ready function.
 
err_t accel19_set_full_scale (accel19_t *ctx, uint8_t full_scale)
 Accel 19 set full scale function.
 
err_t accel19_set_bw_filt_odr (accel19_t *ctx, uint8_t bw_filt_odr)
 Accel 19 set digital filtering cutoff function.
 
err_t accel19_get_axis_data (accel19_t *ctx, accel19_axis_t *axis)
 Accel 19 get accelerometer axis function.
 
uint8_t accel19_get_int_1 (accel19_t *ctx)
 Accel 19 get Interrupt 1 function.
 
uint8_t accel19_get_int_2 (accel19_t *ctx)
 Accel 19 get Interrupt 2 function.
 

Detailed Description

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

◆ accel19_cfg_setup()

void accel19_cfg_setup ( accel19_cfg_t * cfg)

Accel 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ accel19_check_device_id()

err_t accel19_check_device_id ( accel19_t * ctx)

Accel 19 check device ID function.

This function rcheck device ID and communication of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_data_ready()

uint8_t accel19_data_ready ( accel19_t * ctx)

Accel 19 data ready function.

This function check data ready interrupt reporte of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
Returns
  • 0 - Data is not ready,
  • 1 - Data is ready.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_default_cfg()

err_t accel19_default_cfg ( accel19_t * ctx)

Accel 19 default configuration function.

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

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ accel19_drv_interface_selection()

void accel19_drv_interface_selection ( accel19_cfg_t * cfg,
accel19_drv_t drv_sel )

Accel 19 driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See accel19_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See accel19_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ accel19_generic_read()

err_t accel19_generic_read ( accel19_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Accel 19 data reading function.

This function reads a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_generic_write()

err_t accel19_generic_write ( accel19_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Accel 19 data writing function.

This function writes a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_get_axis_data()

err_t accel19_get_axis_data ( accel19_t * ctx,
accel19_axis_t * axis )

Accel 19 get accelerometer axis function.

This function get accelerometer data of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[out]axis: An object that contains X , Y and Z axis data.
Returns
  • 0 - Data is not ready,
  • 1 - Data is ready.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_get_int_1()

uint8_t accel19_get_int_1 ( accel19_t * ctx)

Accel 19 get Interrupt 1 function.

This function get states of the Interrupt 1 ( INT pin ) of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • -1 - High pin state.
Note
None.

◆ accel19_get_int_2()

uint8_t accel19_get_int_2 ( accel19_t * ctx)

Accel 19 get Interrupt 2 function.

This function get states of the Interrupt 2 ( PWM pin ) of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • -1 - High pin state.
Note
None.

◆ accel19_get_status()

err_t accel19_get_status ( accel19_t * ctx,
uint8_t * status )

Accel 19 get status function.

This function reads status register of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[out]status: Status data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_get_temperature()

err_t accel19_get_temperature ( accel19_t * ctx,
float * temperature )

Accel 19 get temperature function.

This function reads a temperature data
of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[out]temperature: Temperature in degree Celsius.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_init()

err_t accel19_init ( accel19_t * ctx,
accel19_cfg_t * cfg )

Accel 19 initialization function.

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

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

◆ accel19_set_bw_filt_odr()

err_t accel19_set_bw_filt_odr ( accel19_t * ctx,
uint8_t bw_filt_odr )

Accel 19 set digital filtering cutoff function.

This function bandwidth selection of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[in]bw_filt_odr: Digital filtering cutoff selection.
Returns
  • 0 - Data is not ready,
  • 1 - Data is ready.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_set_control()

err_t accel19_set_control ( accel19_t * ctx,
uint8_t odr,
uint8_t op_mode,
uint8_t lp_mode )

Accel 19 set control function.

This function set control 1 register of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[in]odr: Data rate configuration.
[in]op_mode: Mode selection.
[in]lp_mode: Low-power mode selection.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_set_full_scale()

err_t accel19_set_full_scale ( accel19_t * ctx,
uint8_t full_scale )

Accel 19 set full scale function.

This function set full scales of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
[in]full_scale: Full scales of ±2g/±4g/±8g/±16g.
Returns
  • 0 - Data is not ready,
  • 1 - Data is ready.
See #err_t definition for detailed explanation.
Note
None.

◆ accel19_soft_reset()

err_t accel19_soft_reset ( accel19_t * ctx)

Accel 19 soft reset function.

This function executes a software reset of the LIS2DTW12 MEMS digital output dual motion and temperature sensor on the Accel 19 Click board™.

Parameters
[in]ctx: Click context object. See accel19_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.