accel 2.0.0.0
Public function

Functions

void accel_cfg_setup (accel_cfg_t *cfg)
 Config Object Initialization function.
 
err_t accel_init (accel_t *ctx, accel_cfg_t *cfg)
 Initialization function.
 
void accel_default_cfg (accel_t *ctx)
 Click Default Configuration function.
 
void accel_generic_write (accel_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void accel_generic_read (accel_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
int16_t accel_read_x_axis (accel_t *ctx)
 Function raw read X axis.
 
int16_t accel_read_y_axis (accel_t *ctx)
 Function raw read Y axis.
 
int16_t accel_read_z_axis (accel_t *ctx)
 Function raw read Z axis.
 
uint8_t accel_check_int_pin (accel_t *ctx)
 INT Pin Get function.
 

Detailed Description

Function Documentation

◆ accel_cfg_setup()

void accel_cfg_setup ( accel_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ accel_check_int_pin()

uint8_t accel_check_int_pin ( accel_t * ctx)

INT Pin Get function.

Parameters
ctxClick object.
Returns
Pin state [bool].

@description This function returns true if the high voltage level detected on the INT pin, or returns false if the low voltage level detected on the INT pin.

◆ accel_default_cfg()

void accel_default_cfg ( accel_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Accel click.

  ACCEL_REG_POWER_CTL
-------------------------------------------
  ACCEL_POWER_CTL_WAKEUP_1

ACCEL_REG_DATA_FORMAT

  ACCEL_DATA_FORMAT_FULL_RES
  ACCEL_DATA_FORMAT_RANGE_16
  ACCEL_REG_BW_RATE
-------------------------------------------
  ACCEL_BW_RATE_RATE_50

ACCEL_REG_FIFO_CTL

  ACCEL_FIFO_CTL_FIFO_MODE_STREAM
  ACCEL_REG_POWER_CTL
-------------------------------------------
  ACCEL_POWER_CTL_MEASURE

◆ accel_generic_read()

void accel_generic_read ( accel_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function reads data from the desired register.

◆ accel_generic_write()

void accel_generic_write ( accel_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function writes data to the desired register.

◆ accel_init()

err_t accel_init ( accel_t * ctx,
accel_cfg_t * cfg )

Initialization function.

Parameters
accelClick object.
cfgClick configuration structure.

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

◆ accel_read_x_axis()

int16_t accel_read_x_axis ( accel_t * ctx)

Function raw read X axis.

Parameters
ctxClick object.
Returns
Value X axis.

@description Function reads X axis value from Accel.

◆ accel_read_y_axis()

int16_t accel_read_y_axis ( accel_t * ctx)

Function raw read Y axis.

Parameters
ctxClick object.
Returns
Value Y axis.

@description Function reads Y axis value from Accel.

◆ accel_read_z_axis()

int16_t accel_read_z_axis ( accel_t * ctx)

Function raw read Z axis.

Parameters
ctxClick object.
Returns
Value Z axis.

@description Function reads Z axis value from Accel.