accel28 2.1.0.0
Accel 28 Click Driver

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

Topics

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

Functions

void accel28_cfg_setup (accel28_cfg_t *cfg)
 Accel 28 configuration object setup function.
 
void accel28_drv_interface_selection (accel28_cfg_t *cfg, accel28_drv_t drv_sel)
 Accel 28 driver interface setup function.
 
err_t accel28_init (accel28_t *ctx, accel28_cfg_t *cfg)
 Accel 28 initialization function.
 
err_t accel28_default_cfg (accel28_t *ctx)
 Accel 28 default configuration function.
 
err_t accel28_generic_write (accel28_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Accel 28 data writing function.
 
err_t accel28_generic_read (accel28_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Accel 28 data reading function.
 
uint8_t accel28_get_int_state (accel28_t *ctx)
 Accel 28 interrupt reading function.
 
err_t accel28_get_raw_data (accel28_t *ctx, accel28_data_t *data_out)
 Accel 28 raw data reading function.
 
err_t accel28_get_data (accel28_t *ctx, accel28_data_t *data_out)
 Accel 28 data reading function.
 
err_t accel28_write_reg (accel28_t *ctx, uint8_t reg, uint8_t data_in)
 Accel 28 register data writing function.
 
err_t accel28_read_reg (accel28_t *ctx, uint8_t reg, uint8_t *data_out)
 Accel 28 register data reading function.
 
err_t accel28_sw_reset (accel28_t *ctx)
 Accel 28 SW reset function.
 

Detailed Description

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

◆ accel28_cfg_setup()

void accel28_cfg_setup ( accel28_cfg_t * cfg)

Accel 28 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ accel28_default_cfg()

err_t accel28_default_cfg ( accel28_t * ctx)

Accel 28 default configuration function.

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

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

◆ accel28_drv_interface_selection()

void accel28_drv_interface_selection ( accel28_cfg_t * cfg,
accel28_drv_t drv_sel )

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

◆ accel28_generic_read()

err_t accel28_generic_read ( accel28_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Accel 28 data reading function.

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

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

◆ accel28_generic_write()

err_t accel28_generic_write ( accel28_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Accel 28 data writing function.

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

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

◆ accel28_get_data()

err_t accel28_get_data ( accel28_t * ctx,
accel28_data_t * data_out )

Accel 28 data reading function.

This function reads the accel data.

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

◆ accel28_get_int_state()

uint8_t accel28_get_int_state ( accel28_t * ctx)

Accel 28 interrupt reading function.

This function reads the interrupt state data.

Parameters
[in]ctx: Click context object. See accel28_t object definition for detailed explanation.
Returns
State of the INT pin.
Note
None.

◆ accel28_get_raw_data()

err_t accel28_get_raw_data ( accel28_t * ctx,
accel28_data_t * data_out )

Accel 28 raw data reading function.

This function reads the raw accel data.

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

◆ accel28_init()

err_t accel28_init ( accel28_t * ctx,
accel28_cfg_t * cfg )

Accel 28 initialization function.

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

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

◆ accel28_read_reg()

err_t accel28_read_reg ( accel28_t * ctx,
uint8_t reg,
uint8_t * data_out )

Accel 28 register data reading function.

This function reads a byte of data from the selected register.

Parameters
[in]ctx: Click context object. See accel28_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ accel28_sw_reset()

err_t accel28_sw_reset ( accel28_t * ctx)

Accel 28 SW reset function.

This function performes software reset.

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

◆ accel28_write_reg()

err_t accel28_write_reg ( accel28_t * ctx,
uint8_t reg,
uint8_t data_in )

Accel 28 register data writing function.

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

Parameters
[in]ctx: Click context object. See accel28_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.