accel6 2.0.0.0
|
Functions | |
void | accel6_cfg_setup (accel6_cfg_t *cfg) |
Config Object Initialization function. | |
ACCEL6_RETVAL | accel6_init (accel6_t *ctx, accel6_cfg_t *cfg) |
Initialization function. | |
void | accel6_generic_write (accel6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | accel6_generic_read (accel6_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | accel6_soft_reset (accel6_t *ctx) |
Functions for software reset. | |
void | accel6_default_cfg (accel6_t *ctx, uint8_t range_data, uint8_t bw_data, uint8_t lpw_data) |
Click Default Configuration function. | |
void | accel6_data_offset (accel6_t *ctx, uint8_t set_offset, float *offset_data) |
Functions for set offset. | |
uint8_t | accel6_get_tap_status (accel6_t *ctx) |
Functions for detect tap on the x/y/z axis. | |
uint8_t | accel6_get_slope_status (accel6_t *ctx) |
Functions for detect slope on the x/y/z axis. | |
void | accel6_get_orient (accel6_t *ctx, uint8_t *z_orient, uint8_t *xy_orient) |
Functions for read orient. | |
float | accel6_get_axis (accel6_t *ctx, uint8_t axis) |
Functions for read axis data. | |
float | accel6_get_temperature (accel6_t *ctx) |
Functions for read temperature. | |
void accel6_cfg_setup | ( | accel6_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void accel6_data_offset | ( | accel6_t * | ctx, |
uint8_t | set_offset, | ||
float * | offset_data ) |
Functions for set offset.
ctx | Click object. |
set_offset | Data which will be written in offset settings register |
offset_data | Buffer in which the XYZ offset will be written.
|
void accel6_default_cfg | ( | accel6_t * | ctx, |
uint8_t | range_data, | ||
uint8_t | bw_data, | ||
uint8_t | lpw_data ) |
Click Default Configuration function.
ctx | Click object. |
range_data | Accelerometer g-range |
bw_data | Acceleration data filter bandwidth |
lpw_data | Power mode and the low power sleep period. |
@description This function executes default configuration for Accel 6 click.
Set ACCEL6_REG_PMU_RANGE reg: - range_data Set ACCEL6_REG_PMU_BW reg: - bw_data Set ACCEL6_REG_PMU_LPW reg: - lpw_data Set ACCEL6_REG_BGW_SPI3_WDT reg: - ACCEL6_I2C_ENABLE | ACCEL6_I2C_WTD_50ms Set ACCEL6_REG_INT_EN_1 reg: - ACCEL6_INT_EN_1_DATA_ENABLE Set ACCEL6_REG_INT_MAP_1 reg: - ACCEL6_INT1_MAP_DATA_ENABLE Set ACCEL6_REG_INT_EN_0 reg: - ACCEL6_INT1_MAP_ORIENT_ENABLE | ACCEL6_INT1_MAP_SINGLE_TAP_ENABLE | ACCEL6_INT1_MAP_DOUBLE_TAP_ENABLE | ACCEL6_INT1_MAP_SLOPE_ENABLE; Set ACCEL6_REG_INT9 reg: - 0x0A Set ACCEL6_REG_INT_OUT_CTRL reg: - ACCEL6_INT2_CTRL_ACTIVE_HIGH_LEVEL | ACCEL6_INT1_CTRL_ACTIVE_HIGH_LEVEL -storage accel range -storage bandwidth data
void accel6_generic_read | ( | accel6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read 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 reads data from the desired register.
void accel6_generic_write | ( | accel6_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function writes data to the desired register.
float accel6_get_axis | ( | accel6_t * | ctx, |
uint8_t | axis ) |
Functions for read axis data.
ctx | Click object. |
axis | Axis data which will be read |
Axis | data in mg |
@description This function reads data from the desired register.
void accel6_get_orient | ( | accel6_t * | ctx, |
uint8_t * | z_orient, | ||
uint8_t * | xy_orient ) |
Functions for read orient.
ctx | Click object. |
z_orient | Buffer in which the Z-axis chip orientation will be written. |
xy_orient | Buffer in which the XY-axis chip orientation will be written. |
Z orientation : - UPWARD LOOKING - DOWNWARD LOOKING XY orientation : - UPRIGHT - UPSIDE DOWN - LANDSCAPE LEFT - LANDSCAPE RIGHT *
uint8_t accel6_get_slope_status | ( | accel6_t * | ctx | ) |
Functions for detect slope on the x/y/z axis.
ctx | Click object. |
Information | of the slope |
Tap detection : - X negative (0x01) - Y negative (0x02) - Z negative (0x03) - X positive (0x04) - Y positive (0x05) - Z positive (0x06) *
uint8_t accel6_get_tap_status | ( | accel6_t * | ctx | ) |
Functions for detect tap on the x/y/z axis.
ctx | Click object. |
Information | of the Tap |
Tap detection : - X negative (0x01) - Y negative (0x02) - Z negative (0x03) - X positive (0x04) - Y positive (0x05) - Z positive (0x06) *
float accel6_get_temperature | ( | accel6_t * | ctx | ) |
Functions for read temperature.
ctx | Click object. |
Temperature | data in C |
Formula: Temperature = 0.5 * Temp_data + 23.0 - Temp_data data read from ACCEL6_REG_TEMPERATURE register The formula for calculating the temperature is from dataheet.
ACCEL6_RETVAL accel6_init | ( | accel6_t * | ctx, |
accel6_cfg_t * | cfg ) |
Initialization function.
accel6 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void accel6_soft_reset | ( | accel6_t * | ctx | ) |
Functions for software reset.
ctx | Click object. |