shake2wake 2.0.0.0
|
Functions | |
void | shake2wake_cfg_setup (shake2wake_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | shake2wake_init (shake2wake_t *ctx, shake2wake_cfg_t *cfg) |
Initialization function. | |
void | shake2wake_default_cfg (shake2wake_t *ctx) |
Click Default Configuration function. | |
uint8_t | shake2wake_read_byte (shake2wake_t *ctx, uint8_t rd_addr) |
Read one byte function. | |
void | shake2wake_write_byte (shake2wake_t *ctx, uint8_t wr_addr, uint8_t wr_val) |
Write one byte function. | |
void | shake2wake_write_two_byte (shake2wake_t *ctx, uint8_t reg_addr, uint16_t reg_val, uint8_t cnt) |
Write two bytes function. | |
void | shake2wake_read_multiple_byte (shake2wake_t *ctx, uint8_t reg_addr, uint8_t *prd_data, uint8_t cnt) |
Read miltiple bytes function. | |
void | shake2wake_fifo_read (shake2wake_t *ctx, uint8_t *p_buff, uint16_t cnt) |
FIFO read function. | |
uint8_t | shake2wake_read_dev_id_ad (shake2wake_t *ctx) |
Read DEVID_AD register function. | |
uint8_t | shake2wake_read_dev_id_mst (shake2wake_t *ctx) |
Read DEVID_MST register function. | |
uint8_t | shake2wake_read_part_id (shake2wake_t *ctx) |
Read part ID register function. | |
uint8_t | shake2wake_read_revision (shake2wake_t *ctx) |
Read silicon revision register function. | |
void | shake2wake_soft_reset (shake2wake_t *ctx) |
Software reset function. | |
uint8_t | shake2wake_read_status (shake2wake_t *ctx) |
Read status register function. | |
uint16_t | shake2wake_read_fifo_ent (shake2wake_t *ctx) |
Read fifo entries registers function. | |
void | shake2wake_get_lo_res_raw_data (shake2wake_t *ctx, int8_t *x_val, int8_t *y_val, int8_t *z_val) |
Get low resolution raw accelerometer data function. | |
void | shake2wake_get_raw_data (shake2wake_t *ctx, int16_t *x_val, int16_t *y_val, int16_t *z_val) |
Get raw accelerometer data function. | |
float | shake2wake_read_temperature (shake2wake_t *ctx) |
Read temperature function. | |
void | shake2wake_stand_by_mode (shake2wake_t *ctx) |
Stand by function. | |
void | shake2wake_measure_mode (shake2wake_t *ctx) |
Measure mode function. | |
void | shake2wake_auto_sleep_mode (shake2wake_t *ctx) |
Auto-sleep mode function. | |
void | shake2wake_wake_up (shake2wake_t *ctx) |
Wake up function. | |
void | shake2wake_set_low_noise_mode (shake2wake_t *ctx, uint8_t low_noise) |
Set Low Noise Mode function. | |
void | shake2wake_extern_clk (shake2wake_t *ctx) |
Enable external clock function. | |
void | shake2wake_set_range (shake2wake_t *ctx, uint8_t range) |
Select measurement range function. | |
void | shake2wake_sel_hal_bandw (shake2wake_t *ctx) |
Select halved bandwidth function. | |
void | shake2wake_set_ext_samp_trg (shake2wake_t *ctx) |
External sampling trigger function. | |
void | shake2wake_set_out_data_rate (shake2wake_t *ctx, uint8_t odr) |
Select output data rate function. | |
void | shake2wake_get_data_g (shake2wake_t *ctx, float *x_val, float *y_val, float *z_val) |
Get accelerometer data in "g" function. | |
void | shake2wake_set_fifo_above_half (shake2wake_t *ctx) |
Set FIFO Above Half function. | |
void | shake2wake_store_temp (shake2wake_t *ctx) |
Store Temperature Data to FIFO function. | |
void | shake2wake_set_fifo_mode (shake2wake_t *ctx, uint8_t mode) |
Enable FIFO and Mode Selection function. | |
uint8_t | shake2wake_read_filter_ctl (shake2wake_t *ctx) |
Read filter control register function. | |
uint8_t | shake2wake_read_power_ctl (shake2wake_t *ctx) |
Read power control register function. | |
uint8_t | shake2wake_read_fifo_ctl (shake2wake_t *ctx) |
Read FIFO control register function. | |
uint8_t | shake2wake_read_act_inact_ctl (shake2wake_t *ctx) |
Read activity/inactivity control register function. | |
void | shake2wake_set_act_enable (shake2wake_t *ctx) |
Set Activity Enable function. | |
void | shake2wake_set_ref_act (shake2wake_t *ctx) |
Set Referenced Activity function. | |
void | shake2wake_set_inact_enable (shake2wake_t *ctx) |
Set Inactivity Enable function. | |
void | shake2wake_set_ref_inact (shake2wake_t *ctx) |
Set Referenced Inactivity function. | |
void | shake2wake_sel_link_loop_mode (shake2wake_t *ctx, uint8_t mode) |
Select LINK/LOOP mode function. | |
void | shake2wake_set_act_trsh (shake2wake_t *ctx, uint16_t act_trsh) |
Set activity threshold function. | |
int16_t | shake2wake_read_act_trsh (shake2wake_t *ctx) |
Read activity threshold function. | |
void | shake2wake_set_act_time (shake2wake_t *ctx, uint8_t ac_time) |
Set activity time function. | |
uint8_t | shake2wake_read_act_time (shake2wake_t *ctx) |
Read activity time function. | |
void | shake2wake_set_inact_trsh (shake2wake_t *ctx, uint16_t inact_trsh) |
Set inactivity threshold function. | |
int16_t | shake2wake_read_inact_trsh (shake2wake_t *ctx) |
Read inactivity threshold function. | |
void | shake2wake_set_inact_time (shake2wake_t *ctx, uint16_t inac_time) |
Set inactivity time function. | |
uint16_t | shake2wake_read_inact_time (shake2wake_t *ctx) |
Read inactivity time function. | |
void | shake2wake_write_int_1_map (shake2wake_t *ctx, uint8_t wr_data) |
Write INT1 function map function. | |
uint8_t | shake2wake_read_int_1_map (shake2wake_t *ctx) |
Read INT1 function map function. | |
void | shake2wake_write_int_2_map (shake2wake_t *ctx, uint8_t wr_data) |
Write INT2 function map function. | |
uint8_t | shake2wake_read_int_2_map (shake2wake_t *ctx) |
Read INT2 function map function. | |
void | shake2wake_write_fifo_samp (shake2wake_t *ctx, uint8_t samp) |
Write FIFO samples function. | |
uint8_t | shake2wake_read_fifo_samp (shake2wake_t *ctx) |
Read FIFO samples function. | |
uint8_t | shake2wake_check_int (shake2wake_t *ctx) |
Get Interrupt state function. | |
void shake2wake_auto_sleep_mode | ( | shake2wake_t * | ctx | ) |
Auto-sleep mode function.
ctx | Click object. |
This function is used to enable the Auto-sleep functionality.
void shake2wake_cfg_setup | ( | shake2wake_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t shake2wake_check_int | ( | shake2wake_t * | ctx | ) |
Get Interrupt state function.
ctx | Click object. |
This function checks the state of the interrupt pin.
void shake2wake_default_cfg | ( | shake2wake_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
This function executes default configuration for Shake2Wake click.
void shake2wake_extern_clk | ( | shake2wake_t * | ctx | ) |
Enable external clock function.
ctx | Click object. |
This function is used to enable an external clock.
void shake2wake_fifo_read | ( | shake2wake_t * | ctx, |
uint8_t * | p_buff, | ||
uint16_t | cnt ) |
FIFO read function.
ctx | Click object. |
p_buff | 8-bit data that that will be read from registers. |
cnt | 16-bit value that represents number of bytes to be read from FIFO register. |
This function is used to burst read data from FIFO register.
void shake2wake_get_data_g | ( | shake2wake_t * | ctx, |
float * | x_val, | ||
float * | y_val, | ||
float * | z_val ) |
Get accelerometer data in "g" function.
ctx | Click object. |
x_val | Float value that represents the x-axis acceleration data converted it to g |
y_val | Float value that represents the y-axis acceleration data converted it to g |
z_val | Float value that represents the z-axis acceleration data converted it to g |
This function is used to read the 3-axis raw data from the accelerometer and converts it to g.
void shake2wake_get_lo_res_raw_data | ( | shake2wake_t * | ctx, |
int8_t * | x_val, | ||
int8_t * | y_val, | ||
int8_t * | z_val ) |
Get low resolution raw accelerometer data function.
ctx | Click object. |
x_val | 12-bit value that represents the x-axis acceleration data. |
y_val | 12-bit value that represents the y-axis acceleration data. |
z_val | 12-bit value that represents the z-axis acceleration data. |
This function is used to read 8-bit acceleration data per axis.
void shake2wake_get_raw_data | ( | shake2wake_t * | ctx, |
int16_t * | x_val, | ||
int16_t * | y_val, | ||
int16_t * | z_val ) |
Get raw accelerometer data function.
ctx | Click object. |
x_val | 12-bit value that represents the x-axis acceleration data. |
y_val | 12-bit value that represents the y-axis acceleration data. |
z_val | 12-bit value that represents the z-axis acceleration data. |
This function is used to read the 3-axis raw data from the accelerometer.
err_t shake2wake_init | ( | shake2wake_t * | ctx, |
shake2wake_cfg_t * | cfg ) |
Initialization function.
shake2wake | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void shake2wake_measure_mode | ( | shake2wake_t * | ctx | ) |
Measure mode function.
ctx | Click object. |
This function is used to put the device into Measure mode.
uint8_t shake2wake_read_act_inact_ctl | ( | shake2wake_t * | ctx | ) |
Read activity/inactivity control register function.
ctx | Click object. |
This function is used to read contents of the activity/inactivity control register.
uint8_t shake2wake_read_act_time | ( | shake2wake_t * | ctx | ) |
Read activity time function.
ctx | Click object. |
This function is used to read the activity time register.
int16_t shake2wake_read_act_trsh | ( | shake2wake_t * | ctx | ) |
Read activity threshold function.
ctx | Click object. |
This function is used to read the activity threshold.
uint8_t shake2wake_read_byte | ( | shake2wake_t * | ctx, |
uint8_t | rd_addr ) |
Read one byte function.
ctx | Click object. |
rd_addr | 8-bit data that represents an address of a register. |
This function is used to read single byte from an address specified register.
uint8_t shake2wake_read_dev_id_ad | ( | shake2wake_t * | ctx | ) |
Read DEVID_AD register function.
ctx | Click object. |
This function is used to read device's DEVID_AD register.
uint8_t shake2wake_read_dev_id_mst | ( | shake2wake_t * | ctx | ) |
Read DEVID_MST register function.
ctx | Click object. |
This function is used to read device's DEVID_MST register.
uint8_t shake2wake_read_fifo_ctl | ( | shake2wake_t * | ctx | ) |
Read FIFO control register function.
ctx | Click object. |
This function is used to read contents of the FIFO control register.
uint16_t shake2wake_read_fifo_ent | ( | shake2wake_t * | ctx | ) |
Read fifo entries registers function.
ctx | Click object. |
This function is used to read the number of valid data samples present in the FIFO buffer.
uint8_t shake2wake_read_fifo_samp | ( | shake2wake_t * | ctx | ) |
Read FIFO samples function.
ctx | Click object. |
This function is used to read the specified number of samples stored in the FIFO.
uint8_t shake2wake_read_filter_ctl | ( | shake2wake_t * | ctx | ) |
Read filter control register function.
ctx | Click object. |
This function is used to read contents of the filter control register.
uint16_t shake2wake_read_inact_time | ( | shake2wake_t * | ctx | ) |
Read inactivity time function.
ctx | Click object. |
This function is used to read the inactivity time register.
int16_t shake2wake_read_inact_trsh | ( | shake2wake_t * | ctx | ) |
Read inactivity threshold function.
ctx | Click object. |
This function is used to read the inactivity threshold.
uint8_t shake2wake_read_int_1_map | ( | shake2wake_t * | ctx | ) |
Read INT1 function map function.
ctx | Click object. |
This function is used to read configuration of the INT1 interrupt pin.
uint8_t shake2wake_read_int_2_map | ( | shake2wake_t * | ctx | ) |
Read INT2 function map function.
ctx | Click object. |
This function is used to read configuration of the INT2 interrupt pin.
void shake2wake_read_multiple_byte | ( | shake2wake_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t * | prd_data, | ||
uint8_t | cnt ) |
Read miltiple bytes function.
ctx | Click object. |
reg_addr | 8-bit data that represents an address of a register. |
prd_data | 8-bit data that that will be read from registers. |
cnt | 16-bit value that represents number of bytes to be written. |
This function is used to read multiple registers.
uint8_t shake2wake_read_part_id | ( | shake2wake_t * | ctx | ) |
Read part ID register function.
ctx | Click object. |
This function is used to read device's part ID register.
uint8_t shake2wake_read_power_ctl | ( | shake2wake_t * | ctx | ) |
Read power control register function.
ctx | Click object. |
This function is used to read contents of the power control register.
uint8_t shake2wake_read_revision | ( | shake2wake_t * | ctx | ) |
Read silicon revision register function.
ctx | Click object. |
This function is used to read device's silicon revision register.
uint8_t shake2wake_read_status | ( | shake2wake_t * | ctx | ) |
Read status register function.
ctx | Click object. |
This function is used to read status register.
float shake2wake_read_temperature | ( | shake2wake_t * | ctx | ) |
Read temperature function.
ctx | Click object. |
This function is used to read temperature from an internal sensor.
void shake2wake_sel_hal_bandw | ( | shake2wake_t * | ctx | ) |
Select halved bandwidth function.
ctx | Click object. |
This function is used to select halved bandwidth.
void shake2wake_sel_link_loop_mode | ( | shake2wake_t * | ctx, |
uint8_t | mode ) |
Select LINK/LOOP mode function.
ctx | Click object. |
mode | 8-bit data representing the operational mode. |
This function is used to select Default Mode, Linked Mode or Loop Mode.
void shake2wake_set_act_enable | ( | shake2wake_t * | ctx | ) |
Set Activity Enable function.
ctx | Click object. |
This function is used to enables the activity (overthreshold) functionality.
void shake2wake_set_act_time | ( | shake2wake_t * | ctx, |
uint8_t | ac_time ) |
Set activity time function.
ctx | Click object. |
ac_time | 8-bit data representing the activity time. |
This function is used to set activity time.
void shake2wake_set_act_trsh | ( | shake2wake_t * | ctx, |
uint16_t | act_trsh ) |
Set activity threshold function.
ctx | Click object. |
act_trsh | 16-bit data representing the activity threshold. |
This function is used to set the activity threshold.
void shake2wake_set_ext_samp_trg | ( | shake2wake_t * | ctx | ) |
External sampling trigger function.
ctx | Click object. |
This function is used to enable an external sampling trigger.
void shake2wake_set_fifo_above_half | ( | shake2wake_t * | ctx | ) |
Set FIFO Above Half function.
ctx | Click object. |
This function is used to set the above half functionality.
void shake2wake_set_fifo_mode | ( | shake2wake_t * | ctx, |
uint8_t | mode ) |
Enable FIFO and Mode Selection function.
ctx | Click object. |
mode | 8-bit data representing the FIFO mode. |
This function is used to enable FIFO and mode selection.
void shake2wake_set_inact_enable | ( | shake2wake_t * | ctx | ) |
Set Inactivity Enable function.
ctx | Click object. |
This function is used to enables the inactivity (underthreshold) functionality.
void shake2wake_set_inact_time | ( | shake2wake_t * | ctx, |
uint16_t | inac_time ) |
Set inactivity time function.
ctx | Click object. |
inac_time | 8-bit data representing the inactivity time. |
This function is used to set inactivity time.
void shake2wake_set_inact_trsh | ( | shake2wake_t * | ctx, |
uint16_t | inact_trsh ) |
Set inactivity threshold function.
ctx | Click object. |
inact_trsh | 16-bit data representing the inactivity threshold. |
This function is used to set the inactivity threshold.
void shake2wake_set_low_noise_mode | ( | shake2wake_t * | ctx, |
uint8_t | low_noise ) |
Set Low Noise Mode function.
ctx | Click object. |
low_noise | 8-bit data representing the low noise settings. |
This function is used to set power vs noise tradeoff.
void shake2wake_set_out_data_rate | ( | shake2wake_t * | ctx, |
uint8_t | odr ) |
Select output data rate function.
ctx | Click object. |
odr | 8-bit data representing the output data rate. |
This function is used to select output data rate.
void shake2wake_set_range | ( | shake2wake_t * | ctx, |
uint8_t | range ) |
Select measurement range function.
ctx | Click object. |
range | 8-bit data representing the range. |
This function is used to set the range.
void shake2wake_set_ref_act | ( | shake2wake_t * | ctx | ) |
Set Referenced Activity function.
ctx | Click object. |
This function is used to enable the activity detection in referenced mode.
void shake2wake_set_ref_inact | ( | shake2wake_t * | ctx | ) |
Set Referenced Inactivity function.
ctx | Click object. |
This function is used to enable the inactivity detection in referenced mode.
void shake2wake_soft_reset | ( | shake2wake_t * | ctx | ) |
Software reset function.
ctx | Click object. |
This function is used to perform software reset.
void shake2wake_stand_by_mode | ( | shake2wake_t * | ctx | ) |
Stand by function.
ctx | Click object. |
This function is used to put the device into stand by mode.
void shake2wake_store_temp | ( | shake2wake_t * | ctx | ) |
Store Temperature Data to FIFO function.
ctx | Click object. |
This function is used to store the temperature data into FIFO.
void shake2wake_wake_up | ( | shake2wake_t * | ctx | ) |
Wake up function.
ctx | Click object. |
This function is used to wake up the device.
void shake2wake_write_byte | ( | shake2wake_t * | ctx, |
uint8_t | wr_addr, | ||
uint8_t | wr_val ) |
Write one byte function.
ctx | Click object. |
wr_addr | 8-bit data that represents an address of a register. |
wr_val | 8-bit data that that will be written into a register. |
This function is used to write single byte to an address specified register.
void shake2wake_write_fifo_samp | ( | shake2wake_t * | ctx, |
uint8_t | samp ) |
Write FIFO samples function.
ctx | Click object. |
samp | 8-bit value specifies the number of samples to store in the FIFO. |
This function is used to specifie the number of samples to store in the FIFO.
void shake2wake_write_int_1_map | ( | shake2wake_t * | ctx, |
uint8_t | wr_data ) |
Write INT1 function map function.
ctx | Click object. |
wr_data | 8-bit user defined data to be written into a register. |
This function is used to configure the INT1 interrupt pin.
void shake2wake_write_int_2_map | ( | shake2wake_t * | ctx, |
uint8_t | wr_data ) |
Write INT2 function map function.
ctx | Click object. |
wr_data | 8-bit user defined data to be written into a register. |
This function is used to configure the INT2 interrupt pin.
void shake2wake_write_two_byte | ( | shake2wake_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t | reg_val, | ||
uint8_t | cnt ) |
Write two bytes function.
ctx | Click object. |
reg_addr | 8-bit data that represents an address of a register. |
reg_val | 16-bit data that that will be written into registers. |
cnt | Number of bytes to be written. |
This function is used to write up to two bytes of data to an address specified register.