accel15 2.0.0.0
Accel 15 Click Driver

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

Topics

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

Functions

void accel15_cfg_setup (accel15_cfg_t *cfg)
 Accel 15 configuration object setup function.
 
void accel15_drv_interface_selection (accel15_cfg_t *cfg, accel15_drv_t drv_sel)
 Accel 15 driver interface setup function.
 
err_t accel15_init (accel15_t *ctx, accel15_cfg_t *cfg)
 Accel 15 initialization function.
 
err_t accel15_default_cfg (accel15_t *ctx)
 Accel 15 default configuration function.
 
err_t accel15_generic_write (accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Accel 15 data writing function.
 
err_t accel15_generic_read (accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Accel 15 data reading function.
 
void accel15_soft_reset (accel15_t *ctx)
 Accel 15 soft reset function.
 
err_t accel15_check_id (accel15_t *ctx)
 Accel 15 check ID function.
 
uint8_t accel15_get_error (accel15_t *ctx)
 Accel 15 get error function.
 
uint8_t accel15_get_status (accel15_t *ctx)
 Accel 15 status function.
 
void accel15_enable_accel (accel15_t *ctx)
 Accel 15 enable accel function.
 
void accel15_cfg_accel (accel15_t *ctx, uint8_t acc_odr, uint8_t g_range)
 Accel 15 config accel function.
 
uint8_t accel15_get_internal_status (accel15_t *ctx)
 Accel 15 internal status function.
 
err_t accel15_get_axis_data (accel15_t *ctx, accel15_axis_t *axis)
 Accel 15 get accelerometer axis function.
 
uint8_t accel15_get_int_1 (accel15_t *ctx)
 Accel 15 get Interrupt 1 function.
 
uint8_t accel15_get_int_2 (accel15_t *ctx)
 Accel 15 get Interrupt 1 function.
 

Detailed Description

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

◆ accel15_cfg_accel()

void accel15_cfg_accel ( accel15_t * ctx,
uint8_t acc_odr,
uint8_t g_range )

Accel 15 config accel function.

This function executes a configuration of the accelerometer data of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

Parameters
[in]ctx: Click context object. See accel15_t object definition for detailed explanation.
[in]acc_odr:
  • 0x05 - odr_12p5, 25/2.
  • 0x06 - odr_25, 25.
  • 0x07 - odr_50, 50.
  • 0x08 - odr_100, 100.
  • 0x09 - odr_200, 200.
  • 0x0a - odr_400, 400.
  • 0x0b - odr_800, 800.
  • 0x0c - odr_1k6, 1600.
[in]g_range:
  • 0x00 - range_16g, +/-16g.
  • 0x01 - range_8g, +/-8g.
  • 0x02 - range_4g, +/-4g.
  • 0x03 - range_2g, +/-2g.
Returns
Nothing.
Note
None.

◆ accel15_cfg_setup()

void accel15_cfg_setup ( accel15_cfg_t * cfg)

Accel 15 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ accel15_check_id()

err_t accel15_check_id ( accel15_t * ctx)

Accel 15 check ID function.

This function check ID and communication of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

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

◆ accel15_default_cfg()

err_t accel15_default_cfg ( accel15_t * ctx)

Accel 15 default configuration function.

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

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

◆ accel15_drv_interface_selection()

void accel15_drv_interface_selection ( accel15_cfg_t * cfg,
accel15_drv_t drv_sel )

Accel 15 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 accel15_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See accel15_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.

◆ accel15_enable_accel()

void accel15_enable_accel ( accel15_t * ctx)

Accel 15 enable accel function.

This function enable accelerometer data of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

Parameters
[in]ctx: Click context object. See accel15_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ accel15_generic_read()

err_t accel15_generic_read ( accel15_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Accel 15 data reading function.

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

Parameters
[in]ctx: Click context object. See accel15_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.

◆ accel15_generic_write()

err_t accel15_generic_write ( accel15_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Accel 15 data writing function.

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

Parameters
[in]ctx: Click context object. See accel15_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.

◆ accel15_get_axis_data()

err_t accel15_get_axis_data ( accel15_t * ctx,
accel15_axis_t * axis )

Accel 15 get accelerometer axis function.

This function get accelerometer data of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

Parameters
[in]ctx: Click context object. See accel15_t object definition for detailed explanation.
[in]axis: An object that contains X , Y and Z axis data.
Returns
  • 0 - Success,
  • -1 - Error.
Note
None.

◆ accel15_get_error()

uint8_t accel15_get_error ( accel15_t * ctx)

Accel 15 get error function.

This function get internal error flags of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

Parameters
[in]ctx: Click context object. See accel15_t object definition for detailed explanation.
Returns
Internal error flags.
Note
None.

◆ accel15_get_int_1()

uint8_t accel15_get_int_1 ( accel15_t * ctx)

Accel 15 get Interrupt 1 function.

This function get states of the Interrupt 1 ( INT pin ) BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

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

◆ accel15_get_int_2()

uint8_t accel15_get_int_2 ( accel15_t * ctx)

Accel 15 get Interrupt 1 function.

This function get states of the Interrupt 2 ( AN pin ) BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

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

◆ accel15_get_internal_status()

uint8_t accel15_get_internal_status ( accel15_t * ctx)

Accel 15 internal status function.

This function get internal status message of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

Parameters
[in]ctx: Click context object. See accel15_t object definition for detailed explanation.
Returns
Internal status message.
Note
None.

◆ accel15_get_status()

uint8_t accel15_get_status ( accel15_t * ctx)

Accel 15 status function.

This function get sensor status flags of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

Parameters
[in]ctx: Click context object. See accel15_t object definition for detailed explanation.
Returns
Sensor status flags.
Note
None.

◆ accel15_init()

err_t accel15_init ( accel15_t * ctx,
accel15_cfg_t * cfg )

Accel 15 initialization function.

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

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

◆ accel15_soft_reset()

void accel15_soft_reset ( accel15_t * ctx)

Accel 15 soft reset function.

This function executes a software reset of the BMA490L High-performance longevity acceleration sensor on the Accel 15 click board.

Parameters
[in]ctx: Click context object. See accel15_t object definition for detailed explanation.
Returns
Nothing.
Note
None.