tiltnshake 2.0.0.0
|
Functions | |
void | tiltnshake_cfg_setup (tiltnshake_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | tiltnshake_init (tiltnshake_t *ctx, tiltnshake_cfg_t *cfg) |
Initialization function. | |
void | tiltnshake_generic_write (tiltnshake_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | tiltnshake_generic_read (tiltnshake_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | tiltnshake_enable (tiltnshake_t *ctx) |
Function for enabling chip. | |
void | tiltnshake_disable (tiltnshake_t *ctx) |
Function for disabling chip. | |
void | tiltnshake_read_status_and_axis (tiltnshake_t *ctx, uint8_t *status, float *out_x, float *out_y, float *out_z) |
Function for read status and axis. | |
void tiltnshake_cfg_setup | ( | tiltnshake_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void tiltnshake_disable | ( | tiltnshake_t * | ctx | ) |
Function for disabling chip.
ctx | Click object. |
Disables chip
void tiltnshake_enable | ( | tiltnshake_t * | ctx | ) |
Function for enabling chip.
ctx | Click object. |
Enables chip
void tiltnshake_generic_read | ( | tiltnshake_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 |
This function reads data from the desired register.
void tiltnshake_generic_write | ( | tiltnshake_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. |
This function writes data to the desired register.
err_t tiltnshake_init | ( | tiltnshake_t * | ctx, |
tiltnshake_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void tiltnshake_read_status_and_axis | ( | tiltnshake_t * | ctx, |
uint8_t * | status, | ||
float * | out_x, | ||
float * | out_y, | ||
float * | out_z ) |
Function for read status and axis.
ctx | Click object. |
status | Status register value |
out_x | Axis x |
out_y | Axis y |
out_z | Axis z |
Reads status register and then reads axis X Y Z like 14 bit data and places them in addresses