accel12 2.0.0.0
|
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. | |
void accel12_cfg_setup | ( | accel12_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void accel12_configuration | ( | accel12_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Functions for configuration one register.
ctx | Click object. |
reg | Register in which the data will be written |
data_in | Data 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.
void accel12_default_cfg | ( | accel12_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
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.
void accel12_generic_read | ( | accel12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void accel12_generic_write | ( | accel12_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
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.
ctx | Click object. |
x_axis | Accel X axis data |
y_axis | Accel Y axis data |
z_axis | Accel Z axis data |
@description This function read Accel axis data
uint8_t accel12_get_interrupt_state | ( | accel12_t * | ctx | ) |
Functions for read INT pin state.
ctx | Click object. |
Interrupt | state |
@description This function read INT pin state.
int16_t accel12_get_one_axis | ( | accel12_t * | ctx, |
uint8_t | axis ) |
Functions for read one Accel axis data.
ctx | Click object. |
axis | Accel axis data (X, Y or Z) |
@description This function read one Accel axis data
uint8_t accel12_get_tap_detection | ( | accel12_t * | ctx | ) |
TAP detection.
ctx | Click object. |
[1] | X axis - Positive |
[2] | Y axis - Positive |
[3] | Z axis - Positive |
[4] | X axis - Negative |
[5] | Y axis - Negative |
[6] | Z axis - Negative |
@description This function is for TAP detection.
ACCEL12_RETVAL accel12_init | ( | accel12_t * | ctx, |
accel12_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.