accel10 2.0.0.0
Public function

Functions

void accel10_cfg_setup (accel10_cfg_t *cfg)
 Config Object Initialization function.
 
ACCEL10_RETVAL accel10_init (accel10_t *ctx, accel10_cfg_t *cfg)
 Initialization function.
 
void accel10_default_cfg (accel10_t *ctx)
 Click Default Configuration function.
 
void accel10_generic_write (accel10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void accel10_generic_read (accel10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
ACCEL10_RETVAL accel10_check_id (accel10_t *ctx)
 Check ID function.
 
uint8_t accel10_check_data_ready (accel10_t *ctx)
 Check data ready function.
 
void accel10_soft_reset (accel10_t *ctx)
 Soft reset function.
 
void accel10_get_data (accel10_t *ctx, accel10_data_t *p_accel_data)
 Read Accel data function.
 
int8_t accel10_read_temperature (accel10_t *ctx)
 Read temperature function.
 
uint8_t accel10_check_it1 (accel10_t *ctx)
 Get interrupt 1 ststus function.
 
uint8_t accel10_check_it2 (accel10_t *ctx)
 Get interrupt 2 ststus function.
 

Detailed Description

Function Documentation

◆ accel10_cfg_setup()

void accel10_cfg_setup ( accel10_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.

◆ accel10_check_data_ready()

uint8_t accel10_check_data_ready ( accel10_t * ctx)

Check data ready function.

Parameters
ctxClick object.
Returns
Data ready:
  • 0 : Not ready;
  • 1 : X-, Y- and Z-axis new data available;

@description This function check accel data ready of LIS2DW12 3-axis MEMS acceleromete on Accel 10 Click board.

◆ accel10_check_id()

ACCEL10_RETVAL accel10_check_id ( accel10_t * ctx)

Check ID function.

Parameters
ctxClick object.
Returns
ID status:
  • 0 ( ACCEL10_ERROR ) : Check ID Error;
  • 1 ( ACCEL10_SUCCESS ) : Check ID Success;

@description This function check device ID by read ID value from the sensor ACCEL10_WHO_AM_I register address of LIS2DW12 3-axis MEMS acceleromete on Accel 10 Click board.

◆ accel10_check_it1()

uint8_t accel10_check_it1 ( accel10_t * ctx)

Get interrupt 1 ststus function.

Parameters
ctxClick object.
Returns
Interrupt 1 state:
  • 0 : No active;
  • 1 : Active;

@description This function check interrupt 1 state by return state of the PWM pin of Accel 10 Click board.

◆ accel10_check_it2()

uint8_t accel10_check_it2 ( accel10_t * ctx)

Get interrupt 2 ststus function.

Parameters
ctxClick object.
Returns
Interrupt 2 state:
  • 0 : No active;
  • 1 : Active;

@description This function check interrupt 1 state by return state of the INT pin of Accel 10 Click board.

◆ accel10_default_cfg()

void accel10_default_cfg ( accel10_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Accel 10 click.

Note

Click default configuration:

- Set Low-power mode selection           : Low-Power Mode 2 (14-bit resolution);
- Set Mode selection                     : Low-Power Mode (12/14-bit resolution);
- Set Data rate configuration            : Low-Power mode 100 Hz;

reg : ACCEL10_REG_CTRL1

   tx_data : ACCEL10_LP_MODE_2 
           | ACCEL10_MODE_LOW_POWER 
           | ACCEL10_ODR_100Hz
- Set Low-noise configuration            : Disable;
- Set Filtered data type selection       : Low-pass filter path selected;
- Set Full-scale selection               : ±2 g;
- Set Digital filtering cutoff selection : ODR/2;

reg : ACCEL10_REG_CTRL6

   tx_data : ACCEL10_LOW_NOISE_DISABLE 
           | ACCEL10_FSD_LOW_PASS
           | ACCEL10_FS_2G 
           | ACCEL10_BW_FILT_ODR2

◆ accel10_generic_read()

void accel10_generic_read ( accel10_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.

◆ accel10_generic_write()

void accel10_generic_write ( accel10_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.

◆ accel10_get_data()

void accel10_get_data ( accel10_t * ctx,
accel10_data_t * p_accel_data )

Read Accel data function.

Parameters
ctxClick object.
p_accel_dataPointer to memory location where Accel data be stored.

@description This function read Accel data X-axis, Y-axis data and Z-axis data from the 6 targeted starts from ACCEL10_OUT_X_L register address of LIS2DW12 3-axis MEMS acceleromete on Accel 10 Click board.

◆ accel10_init()

ACCEL10_RETVAL accel10_init ( accel10_t * ctx,
accel10_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ accel10_read_temperature()

int8_t accel10_read_temperature ( accel10_t * ctx)

Read temperature function.

Parameters
ctxClick object.
Returns
temperature ( degrees Celsius )

@description This function read temperature data in degrees Celsius of LIS2DW12 3-axis MEMS acceleromete on Accel 10 Click board.

◆ accel10_soft_reset()

void accel10_soft_reset ( accel10_t * ctx)

Soft reset function.

Parameters
ctxClick object.

@description This function soft reset acts as reset for all control registers of LIS2DW12 3-axis MEMS acceleromete on Accel 10 Click board.