accel17 2.0.0.0
Accel 17 Click Driver

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

Topics

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

Functions

void accel17_cfg_setup (accel17_cfg_t *cfg)
 Accel 17 configuration object setup function.
 
err_t accel17_init (accel17_t *ctx, accel17_cfg_t *cfg)
 Accel 17 initialization function.
 
err_t accel17_default_cfg (accel17_t *ctx)
 Accel 17 default configuration function.
 
err_t accel17_generic_write (accel17_t *ctx, uint8_t reg, uint8_t tx_data)
 Accel 17 I2C writing function.
 
err_t accel17_generic_read (accel17_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Accel 17 I2C reading function.
 
err_t accel17_get_axes_data (accel17_t *ctx, accel17_axes_t *axes)
 Accel data reading.
 

Detailed Description

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

◆ accel17_cfg_setup()

void accel17_cfg_setup ( accel17_cfg_t * cfg)

Accel 17 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ accel17_default_cfg()

err_t accel17_default_cfg ( accel17_t * ctx)

Accel 17 default configuration function.

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

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

◆ accel17_generic_read()

err_t accel17_generic_read ( accel17_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Accel 17 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

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

◆ accel17_generic_write()

err_t accel17_generic_write ( accel17_t * ctx,
uint8_t reg,
uint8_t tx_data )

Accel 17 I2C writing function.

This function writes a byte of data to the selected register.

Parameters
[in]ctx: Click context object. See accel17_t object definition for detailed explanation.
[in]reg: Register address.
[in]tx_data: Data to write.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ accel17_get_axes_data()

err_t accel17_get_axes_data ( accel17_t * ctx,
accel17_axes_t * axes )

Accel data reading.

This function reads a accel data and calculates it with resolution set in ctx object. Data will be set in axes object.

Parameters
[in]ctx: Click context object. See accel17_t object definition for detailed explanation.
[out]axes: Axes data object. See accel17_axes_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ accel17_init()

err_t accel17_init ( accel17_t * ctx,
accel17_cfg_t * cfg )

Accel 17 initialization function.

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

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