accel12 2.0.0.0
Public function

Functions

void accel12_cfg_setup (accel12_cfg_t *cfg)
 Config Object Initialization function.
 
ACCEL12_RETVAL accel12_init (accel12_t *ctx, accel12_cfg_t *cfg)
 Initialization function.
 
void accel12_default_cfg (accel12_t *ctx)
 Click Default Configuration function.
 
void accel12_generic_write (accel12_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void accel12_generic_read (accel12_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void accel12_configuration (accel12_t *ctx, uint8_t reg, uint8_t data_in)
 Functions for configuration one register.
 
int16_t accel12_get_one_axis (accel12_t *ctx, uint8_t axis)
 Functions for read one Accel axis data.
 
void accel12_get_axis_data (accel12_t *ctx, int16_t *x_axis, int16_t *y_axis, int16_t *z_axis)
 Functions for read Accel axis data.
 
uint8_t accel12_get_tap_detection (accel12_t *ctx)
 TAP detection.
 
uint8_t accel12_get_interrupt_state (accel12_t *ctx)
 Functions for read INT pin state.
 

Detailed Description

Function Documentation

◆ accel12_cfg_setup()

void accel12_cfg_setup ( accel12_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.

◆ accel12_configuration()

void accel12_configuration ( accel12_t * ctx,
uint8_t reg,
uint8_t data_in )

Functions for configuration one register.

Parameters
ctxClick object.
regRegister in which the data will be written
data_inData which be written in the register

@description This function include going to stand by mode and entering data into the register. Use this function, if you want to set up a register.

◆ accel12_default_cfg()

void accel12_default_cfg ( accel12_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.
Note
     Accel configuration:
        ACCEL12_REG_OUTPUT_CONFIG:
          - ACCEL12_OUTCFG_RESOLUTION_14_bit
          - ACCEL12_OUTCFG_RANGE_2g
        ACCEL12_REG_SAMPLE_RATE_AND_TAP:
          - ACCEL12_SRTFR_RATE_256Hz 
          - ACCEL12_SRTFR_TAP_LATCH_DISABLE
     TAP configuration :
        ACCEL12_REG_INTERRUPT_ENABLE:
          - ACCEL12_EINT_TAP_XP_ENABLE  
          - ACCEL12_EINT_TAP_YP_ENABLE  
          - ACCEL12_EINT_TAP_ZP_ENABLE 
          - ACCEL12_EINT_TAP_XN_ENABLE  
          - ACCEL12_EINT_TAP_YN_ENABLE  
          - ACCEL12_EINT_TAP_ZN_ENABLE 
          - ACCEL12_EINT_ACQ_INT_ENABLE
        ACCEL12_REG_TAP_CONTROL:
          - ACCEL12_TAPEN_TAP_X_POS_ENABLE  
          - ACCEL12_TAPEN_TAP_Y_POS_ENABLE  
          - ACCEL12_TAPEN_TAP_Z_POS_ENABLE 
          - ACCEL12_TAPEN_TAP_X_NEG_ENABLE  
          - ACCEL12_TAPEN_TAP_Y_NEG_ENABLE  
          - ACCEL12_TAPEN_TAP_Z_NEG_ENABLE 
          - ACCEL12_TAPEN_TAP_THRESHOLD  
          - ACCEL12_TAPEN_ALL_TAP_DISABLE
     Go to wake-up mode:
        ACCEL12_REG_MODE_CONTROL:
          - ACCEL12_MODE_WAKE_STATE  
          - ACCEL12_MODE_I2C_WDT_POS_DISABLE 
          - ACCEL12_MODE_I2C_WDT_NEG_DISABLE 
          - ACCEL12_MODE_IPP_PUSH_PULL 
          - ACCEL12_MODE_IAH_ACTIVE_HIGH

@description This function executes default configuration for Accel12 click.

◆ accel12_generic_read()

void accel12_generic_read ( accel12_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

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

@description This function reads data from the desired register.

◆ accel12_generic_write()

void accel12_generic_write ( accel12_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

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

@description This function writes data to the desired register.

◆ accel12_get_axis_data()

void accel12_get_axis_data ( accel12_t * ctx,
int16_t * x_axis,
int16_t * y_axis,
int16_t * z_axis )

Functions for read Accel axis data.

Parameters
ctxClick object.
x_axisAccel X axis data
y_axisAccel Y axis data
z_axisAccel Z axis data

@description This function read Accel axis data

◆ accel12_get_interrupt_state()

uint8_t accel12_get_interrupt_state ( accel12_t * ctx)

Functions for read INT pin state.

Parameters
ctxClick object.
Return values
Interruptstate

@description This function read INT pin state.

◆ accel12_get_one_axis()

int16_t accel12_get_one_axis ( accel12_t * ctx,
uint8_t axis )

Functions for read one Accel axis data.

Parameters
ctxClick object.
axisAccel axis data (X, Y or Z)
Returns
Accel axis data

@description This function read one Accel axis data

◆ accel12_get_tap_detection()

uint8_t accel12_get_tap_detection ( accel12_t * ctx)

TAP detection.

Parameters
ctxClick object.
Return values
[1]X axis - Positive
[2]Y axis - Positive
[3]Z axis - Positive
[4]X axis - Negative
[5]Y axis - Negative
[6]Z axis - Negative
Returns
The axis on which the TAP is detected

@description This function is for TAP detection.

◆ accel12_init()

ACCEL12_RETVAL accel12_init ( accel12_t * ctx,
accel12_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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