accel30 2.1.0.0
Accel 30 Click Driver

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

Topics

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

Functions

void accel30_cfg_setup (accel30_cfg_t *cfg)
 Accel 30 configuration object setup function.
 
void accel30_drv_interface_selection (accel30_cfg_t *cfg, accel30_drv_t drv_sel)
 Accel 30 driver interface setup function.
 
err_t accel30_init (accel30_t *ctx, accel30_cfg_t *cfg)
 Accel 30 initialization function.
 
err_t accel30_default_cfg (accel30_t *ctx)
 Accel 30 default configuration function.
 
err_t accel30_generic_write (accel30_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Accel 30 data writing function.
 
err_t accel30_generic_read (accel30_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Accel 30 data reading function.
 
err_t accel30_set_mode (accel30_t *ctx, accel30_op_mode_t mode)
 Accel 30 set operating mode function.
 
err_t accel30_set_range_ctrl (accel30_t *ctx, accel30_range_t range)
 Accel 30 set range control function.
 
err_t accel30_soft_reset (accel30_t *ctx)
 Accel 30 soft reset function.
 
err_t accel30_set_sniff_gain (accel30_t *ctx, accel30_gain_t gain)
 Accel 30 set sniff gain function.
 
err_t accel30_set_wake_gain (accel30_t *ctx, accel30_gain_t gain)
 Accel 30 set wake gain function.
 
err_t accel30_set_resolution_ctrl (accel30_t *ctx, accel30_resolution_t resolution)
 Accel 30 set resolution control function.
 
err_t accel30_set_sample_rate (accel30_t *ctx, accel30_cwake_t sample_rate)
 Accel 30 set sampling rate function.
 
err_t accel30_set_sniff_sample_rate (accel30_t *ctx, accel30_sniff_sr_t sample_rate)
 Accel 30 set sniff sampling rate function.
 
err_t accel30_set_pwr_mode (accel30_t *ctx, accel30_power_mode_t pwr_mode)
 Accel 30 set power mode function.
 
err_t accel30_get_axis (accel30_t *ctx, accel30_axis_t *acc_axis)
 Accel 30 get accel data function.
 
err_t accel30_get_avg_axes (accel30_t *ctx, accel30_avg_axis_t *acc_avg_axis)
 Accel 30 get accel averaged data function.
 
uint8_t accel30_get_int_pin (accel30_t *ctx)
 Accel 30 get interrupt function.
 

Detailed Description

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

◆ accel30_cfg_setup()

void accel30_cfg_setup ( accel30_cfg_t * cfg)

Accel 30 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ accel30_default_cfg()

err_t accel30_default_cfg ( accel30_t * ctx)

Accel 30 default configuration function.

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

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

◆ accel30_drv_interface_selection()

void accel30_drv_interface_selection ( accel30_cfg_t * cfg,
accel30_drv_t drv_sel )

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

◆ accel30_generic_read()

err_t accel30_generic_read ( accel30_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Accel 30 data reading function.

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

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

◆ accel30_generic_write()

err_t accel30_generic_write ( accel30_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Accel 30 data writing function.

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

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

◆ accel30_get_avg_axes()

err_t accel30_get_avg_axes ( accel30_t * ctx,
accel30_avg_axis_t * acc_avg_axis )

Accel 30 get accel averaged data function.

This function reads accel averaged data for all three axis of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

Parameters
[in]ctx: Click context object. See accel30_t object definition for detailed explanation.
[out]acc_avg_axis: Accel averaged axis output.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ accel30_get_axis()

err_t accel30_get_axis ( accel30_t * ctx,
accel30_axis_t * acc_axis )

Accel 30 get accel data function.

This function reads accel data for all three axis of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_get_int_pin()

uint8_t accel30_get_int_pin ( accel30_t * ctx)

Accel 30 get interrupt function.

This function get states of the Interrupt ( INT ) pin of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_init()

err_t accel30_init ( accel30_t * ctx,
accel30_cfg_t * cfg )

Accel 30 initialization function.

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

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

◆ accel30_set_mode()

err_t accel30_set_mode ( accel30_t * ctx,
accel30_op_mode_t mode )

Accel 30 set operating mode function.

This function set the desired operating mode value of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_set_pwr_mode()

err_t accel30_set_pwr_mode ( accel30_t * ctx,
accel30_power_mode_t pwr_mode )

Accel 30 set power mode function.

This function set the desired power mode of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_set_range_ctrl()

err_t accel30_set_range_ctrl ( accel30_t * ctx,
accel30_range_t range )

Accel 30 set range control function.

This function set the desired range control value of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_set_resolution_ctrl()

err_t accel30_set_resolution_ctrl ( accel30_t * ctx,
accel30_resolution_t resolution )

Accel 30 set resolution control function.

This function set the desired resolution control value of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_set_sample_rate()

err_t accel30_set_sample_rate ( accel30_t * ctx,
accel30_cwake_t sample_rate )

Accel 30 set sampling rate function.

This function set the desired sampling rate value of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_set_sniff_gain()

err_t accel30_set_sniff_gain ( accel30_t * ctx,
accel30_gain_t gain )

Accel 30 set sniff gain function.

This function set the desired sniff gain value of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_set_sniff_sample_rate()

err_t accel30_set_sniff_sample_rate ( accel30_t * ctx,
accel30_sniff_sr_t sample_rate )

Accel 30 set sniff sampling rate function.

This function set the desired sniff sampling rate value of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_set_wake_gain()

err_t accel30_set_wake_gain ( accel30_t * ctx,
accel30_gain_t gain )

Accel 30 set wake gain function.

This function set the desired wake gain value of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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

◆ accel30_soft_reset()

err_t accel30_soft_reset ( accel30_t * ctx)

Accel 30 soft reset function.

This function perform a software reset of MC3635 3-Axis Accelerometer on the Accel 30 Click board™.

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