accel13 2.0.0.0
|
Functions | |
void | accel13_cfg_setup (accel13_cfg_t *cfg) |
Config Object Initialization function. | |
ACCEL13_RETVAL | accel13_init (accel13_t *ctx, accel13_cfg_t *cfg) |
Initialization function. | |
void | accel13_default_cfg (accel13_t *ctx) |
Click Default Configuration function. | |
void | accel13_generic_write_bytes (accel13_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | accel13_generic_write_single_byte (accel13_t *ctx, uint8_t reg, uint8_t data_in) |
Single byte write function. | |
void | accel13_generic_read_bytes (accel13_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic 8bit read function. | |
int16_t | accel13_generic_read_word (accel13_t *ctx, uint8_t reg) |
16bit read function. | |
float | accel13_get_temperature (accel13_t *ctx) |
Temperature functions. | |
void | accel13_get_axis_data (accel13_t *ctx, accel13_axis_t *axis) |
Read function for Accel axis data. | |
void | accel13_get_status (accel13_t *ctx, accel13_status_t *status) |
Read functions for Status data. | |
void | accel13_get_wake_up_status (accel13_t *ctx, accel13_wake_up_t *wu_status) |
Read function for Wake-up status data. | |
void | accel13_get_tap_status (accel13_t *ctx, accel13_tap_t *tap_status) |
Read function for Tap status data. | |
void | accel13_get_6d_status (accel13_t *ctx, accel13_6d_t *sixd_status) |
Read function for 6D status data. | |
void | accel13_get_user_offset (accel13_t *ctx, accel13_user_offset_t *axis) |
Read function for User offset data. | |
void | accel13_set_user_offset (accel13_t *ctx, accel13_user_offset_t *axis) |
Set function for User offset data. | |
uint8_t | accel13_get_interrupt (accel13_t *ctx, uint8_t int_num) |
Interrupt functions. | |
void accel13_cfg_setup | ( | accel13_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void accel13_default_cfg | ( | accel13_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Accel 13 click.
List of registers and their set values:
# ACCEL13_REG_CTRL_1 ACCEL13_CTRL1_ODR_LOW_POWER_MODE_400_200Hz, ACCEL13_CTRL1_MODE_HIGH_PERFORMANCE_MODE_14bit, ACCEL13_CTRL1_LP_MODE_1. # ACCEL13_REG_CTRL_2 ACCEL13_CTRL2_BOOT_ENABLE, ACCEL13_CTRL2_SOFT_RESET_DISABLE, ACCEL13_CTRL2_PULLUP_CS_PIN_ENABLE, ACCEL13_CTRL2_BDU_CONTINUOUS_UPDATE, ACCEL13_CTRL2_IF_ADD_INC_ENABLED, ACCEL13_CTRL2_I2C_AND_SPI_ENABLE, ACCEL13_CTRL2_SPI_4_WIRE. # ACCEL13_REG_CTRL_3 ACCEL13_CTRL3_SELF_TEST_DISABLE, ACCEL13_CTRL3_OPEN_DRAIN_INT_PAD, ACCEL13_CTRL3_LATCHED_INT_DISABLE, ACCEL13_CTRL3_INT_ACTIVE_HIGH, ACCEL13_CTRL3_SLP_MODE_SEL_EN_INT2. # ACCEL13_REG_CTRL_4_INT1 ACCEL13_CTRL4_INT1_6D_DISABLED, ACCEL13_CTRL4_INT1_SINGLE_TAP_DISABLED, ACCEL13_CTRL4_INT1_WAKEUP_DISABLED, ACCEL13_CTRL4_INT1_FREE_FALL_DISABLED, ACCEL13_CTRL4_INT1_TAP_ENABLED, ACCEL13_CTRL4_INT1_DIFF5_DISABLED, ACCEL13_CTRL4_INT1_FTH_DISABLED, ACCEL13_CTRL4_INT1_DRDY_DISABLED. # ACCEL13_REG_CTRL_5_INT2 ACCEL13_CTRL5_INT2_SLEEP_STATE_DISABLED ACCEL13_CTRL5_INT2_SLEEP_CHG_DISABLED, ACCEL13_CTRL5_INT2_BOOT_DISABLED, ACCEL13_CTRL5_INT2_T_DRDY_DISABLED, ACCEL13_CTRL5_INT2_OVR_DISABLED, ACCEL13_CTRL4_INT2_DIFF5_DISABLED, ACCEL13_CTRL4_INT2_DRDY_ENABLED. # ACCEL13_REG_WAKE_UP_DURATION - 0x00 # ACCEL13_REG_FREE_FALL_CONFIG - 0x33 # ACCEL13_REG_CTRL_7 - 0x20 # ACCEL13_REG_TAP_AXIS_X - 0x09 # ACCEL13_REG_TAP_AXIS_Y - 0xE9 # ACCEL13_REG_TAP_AXIS_Z - 0xE9 # ACCEL13_REG_INT_DURATION - 0x06 # ACCEL13_REG_X_OFFSET_USER - 0x00 # ACCEL13_REG_Y_OFFSET_USER - 0x00 # ACCEL13_REG_Z_OFFSET_USER - 0x40
void accel13_generic_read_bytes | ( | accel13_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic 8bit 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.
int16_t accel13_generic_read_word | ( | accel13_t * | ctx, |
uint8_t | reg ) |
16bit read function.
ctx | Click object. |
reg | Register address. |
read | 16bit value. |
@description This function returns single 16bit value read from the desired registers.
void accel13_generic_write_bytes | ( | accel13_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Input data buf |
len | Number of the bytes to be written |
@description This function writes data to the desired register.
void accel13_generic_write_single_byte | ( | accel13_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Single byte write function.
ctx | Click object. |
reg | Register address. |
data_in | Input data |
@description This function writes 1 byte to the desired register.
void accel13_get_6d_status | ( | accel13_t * | ctx, |
accel13_6d_t * | sixd_status ) |
Read function for 6D status data.
ctx | Click object. |
sixd_status | An object that contains 6D status data. |
@description This function reads the 6D status data and stores it in the sixd_status object.
void accel13_get_axis_data | ( | accel13_t * | ctx, |
accel13_axis_t * | axis ) |
Read function for Accel axis data.
ctx | Click object. |
axis | An object that contains X , Y and Z axis data. |
@description This function reads the axis data and stores it in the axis object.
uint8_t accel13_get_interrupt | ( | accel13_t * | ctx, |
uint8_t | int_num ) |
Interrupt functions.
ctx | Click object. |
intNum | Interrupt pin. |
@description This function returns value of interupt state from the selected pin
void accel13_get_status | ( | accel13_t * | ctx, |
accel13_status_t * | status ) |
Read functions for Status data.
ctx | Click object. |
status | An object that contains status data. |
@description This function reads the status data and stores it in the status object.
void accel13_get_tap_status | ( | accel13_t * | ctx, |
accel13_tap_t * | tap_status ) |
Read function for Tap status data.
ctx | Click object. |
tap_status | An object that contains wake-up status data. |
@description This function reads the tap status data and stores it in the tap_status object.
float accel13_get_temperature | ( | accel13_t * | ctx | ) |
Temperature functions.
ctx | Click object. |
Temperature | data in C. |
void accel13_get_user_offset | ( | accel13_t * | ctx, |
accel13_user_offset_t * | axis ) |
Read function for User offset data.
ctx | Click object. |
axis | An object that contains user offset data. |
@description This function reads the 6D status data and stores it in the axis object.
void accel13_get_wake_up_status | ( | accel13_t * | ctx, |
accel13_wake_up_t * | wu_status ) |
Read function for Wake-up status data.
ctx | Click object. |
wu_status | An object that contains wake-up status data. |
@description This function reads the wake-up status data and stores it in the wu_status object.
ACCEL13_RETVAL accel13_init | ( | accel13_t * | ctx, |
accel13_cfg_t * | cfg ) |
Initialization function.
accel13 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void accel13_set_user_offset | ( | accel13_t * | ctx, |
accel13_user_offset_t * | axis ) |
Set function for User offset data.
ctx | Click object. |
axis | An object that contains user offset data. |
@description This function sets the User offset data from the axis object.