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.
 

Detailed Description

Function Documentation

◆ shake2wake_auto_sleep_mode()

void shake2wake_auto_sleep_mode ( shake2wake_t * ctx)

Auto-sleep mode function.

Parameters
ctxClick object.

This function is used to enable the Auto-sleep functionality.

◆ shake2wake_cfg_setup()

void shake2wake_cfg_setup ( shake2wake_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ shake2wake_check_int()

uint8_t shake2wake_check_int ( shake2wake_t * ctx)

Get Interrupt state function.

Parameters
ctxClick object.

This function checks the state of the interrupt pin.

◆ shake2wake_default_cfg()

void shake2wake_default_cfg ( shake2wake_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

This function executes default configuration for Shake2Wake click.

◆ shake2wake_extern_clk()

void shake2wake_extern_clk ( shake2wake_t * ctx)

Enable external clock function.

Parameters
ctxClick object.

This function is used to enable an external clock.

◆ shake2wake_fifo_read()

void shake2wake_fifo_read ( shake2wake_t * ctx,
uint8_t * p_buff,
uint16_t cnt )

FIFO read function.

Parameters
ctxClick object.
p_buff8-bit data that that will be read from registers.
cnt16-bit value that represents number of bytes to be read from FIFO register.

This function is used to burst read data from FIFO register.

◆ shake2wake_get_data_g()

void shake2wake_get_data_g ( shake2wake_t * ctx,
float * x_val,
float * y_val,
float * z_val )

Get accelerometer data in "g" function.

Parameters
ctxClick object.
x_valFloat value that represents the x-axis acceleration data converted it to g
y_valFloat value that represents the y-axis acceleration data converted it to g
z_valFloat 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.

◆ shake2wake_get_lo_res_raw_data()

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.

Parameters
ctxClick object.
x_val12-bit value that represents the x-axis acceleration data.
y_val12-bit value that represents the y-axis acceleration data.
z_val12-bit value that represents the z-axis acceleration data.

This function is used to read 8-bit acceleration data per axis.

◆ shake2wake_get_raw_data()

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.

Parameters
ctxClick object.
x_val12-bit value that represents the x-axis acceleration data.
y_val12-bit value that represents the y-axis acceleration data.
z_val12-bit value that represents the z-axis acceleration data.

This function is used to read the 3-axis raw data from the accelerometer.

◆ shake2wake_init()

err_t shake2wake_init ( shake2wake_t * ctx,
shake2wake_cfg_t * cfg )

Initialization function.

Parameters
shake2wakeClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ shake2wake_measure_mode()

void shake2wake_measure_mode ( shake2wake_t * ctx)

Measure mode function.

Parameters
ctxClick object.

This function is used to put the device into Measure mode.

◆ shake2wake_read_act_inact_ctl()

uint8_t shake2wake_read_act_inact_ctl ( shake2wake_t * ctx)

Read activity/inactivity control register function.

Parameters
ctxClick object.

This function is used to read contents of the activity/inactivity control register.

◆ shake2wake_read_act_time()

uint8_t shake2wake_read_act_time ( shake2wake_t * ctx)

Read activity time function.

Parameters
ctxClick object.

This function is used to read the activity time register.

◆ shake2wake_read_act_trsh()

int16_t shake2wake_read_act_trsh ( shake2wake_t * ctx)

Read activity threshold function.

Parameters
ctxClick object.

This function is used to read the activity threshold.

◆ shake2wake_read_byte()

uint8_t shake2wake_read_byte ( shake2wake_t * ctx,
uint8_t rd_addr )

Read one byte function.

Parameters
ctxClick object.
rd_addr8-bit data that represents an address of a register.

This function is used to read single byte from an address specified register.

◆ shake2wake_read_dev_id_ad()

uint8_t shake2wake_read_dev_id_ad ( shake2wake_t * ctx)

Read DEVID_AD register function.

Parameters
ctxClick object.

This function is used to read device's DEVID_AD register.

◆ shake2wake_read_dev_id_mst()

uint8_t shake2wake_read_dev_id_mst ( shake2wake_t * ctx)

Read DEVID_MST register function.

Parameters
ctxClick object.

This function is used to read device's DEVID_MST register.

◆ shake2wake_read_fifo_ctl()

uint8_t shake2wake_read_fifo_ctl ( shake2wake_t * ctx)

Read FIFO control register function.

Parameters
ctxClick object.

This function is used to read contents of the FIFO control register.

◆ shake2wake_read_fifo_ent()

uint16_t shake2wake_read_fifo_ent ( shake2wake_t * ctx)

Read fifo entries registers function.

Parameters
ctxClick object.

This function is used to read the number of valid data samples present in the FIFO buffer.

◆ shake2wake_read_fifo_samp()

uint8_t shake2wake_read_fifo_samp ( shake2wake_t * ctx)

Read FIFO samples function.

Parameters
ctxClick object.

This function is used to read the specified number of samples stored in the FIFO.

◆ shake2wake_read_filter_ctl()

uint8_t shake2wake_read_filter_ctl ( shake2wake_t * ctx)

Read filter control register function.

Parameters
ctxClick object.

This function is used to read contents of the filter control register.

◆ shake2wake_read_inact_time()

uint16_t shake2wake_read_inact_time ( shake2wake_t * ctx)

Read inactivity time function.

Parameters
ctxClick object.

This function is used to read the inactivity time register.

◆ shake2wake_read_inact_trsh()

int16_t shake2wake_read_inact_trsh ( shake2wake_t * ctx)

Read inactivity threshold function.

Parameters
ctxClick object.

This function is used to read the inactivity threshold.

◆ shake2wake_read_int_1_map()

uint8_t shake2wake_read_int_1_map ( shake2wake_t * ctx)

Read INT1 function map function.

Parameters
ctxClick object.

This function is used to read configuration of the INT1 interrupt pin.

◆ shake2wake_read_int_2_map()

uint8_t shake2wake_read_int_2_map ( shake2wake_t * ctx)

Read INT2 function map function.

Parameters
ctxClick object.

This function is used to read configuration of the INT2 interrupt pin.

◆ shake2wake_read_multiple_byte()

void shake2wake_read_multiple_byte ( shake2wake_t * ctx,
uint8_t reg_addr,
uint8_t * prd_data,
uint8_t cnt )

Read miltiple bytes function.

Parameters
ctxClick object.
reg_addr8-bit data that represents an address of a register.
prd_data8-bit data that that will be read from registers.
cnt16-bit value that represents number of bytes to be written.

This function is used to read multiple registers.

◆ shake2wake_read_part_id()

uint8_t shake2wake_read_part_id ( shake2wake_t * ctx)

Read part ID register function.

Parameters
ctxClick object.

This function is used to read device's part ID register.

◆ shake2wake_read_power_ctl()

uint8_t shake2wake_read_power_ctl ( shake2wake_t * ctx)

Read power control register function.

Parameters
ctxClick object.

This function is used to read contents of the power control register.

◆ shake2wake_read_revision()

uint8_t shake2wake_read_revision ( shake2wake_t * ctx)

Read silicon revision register function.

Parameters
ctxClick object.

This function is used to read device's silicon revision register.

◆ shake2wake_read_status()

uint8_t shake2wake_read_status ( shake2wake_t * ctx)

Read status register function.

Parameters
ctxClick object.

This function is used to read status register.

◆ shake2wake_read_temperature()

float shake2wake_read_temperature ( shake2wake_t * ctx)

Read temperature function.

Parameters
ctxClick object.

This function is used to read temperature from an internal sensor.

◆ shake2wake_sel_hal_bandw()

void shake2wake_sel_hal_bandw ( shake2wake_t * ctx)

Select halved bandwidth function.

Parameters
ctxClick object.

This function is used to select halved bandwidth.

◆ shake2wake_sel_link_loop_mode()

void shake2wake_sel_link_loop_mode ( shake2wake_t * ctx,
uint8_t mode )

Select LINK/LOOP mode function.

Parameters
ctxClick object.
mode8-bit data representing the operational mode.

This function is used to select Default Mode, Linked Mode or Loop Mode.

◆ shake2wake_set_act_enable()

void shake2wake_set_act_enable ( shake2wake_t * ctx)

Set Activity Enable function.

Parameters
ctxClick object.

This function is used to enables the activity (overthreshold) functionality.

◆ shake2wake_set_act_time()

void shake2wake_set_act_time ( shake2wake_t * ctx,
uint8_t ac_time )

Set activity time function.

Parameters
ctxClick object.
ac_time8-bit data representing the activity time.

This function is used to set activity time.

◆ shake2wake_set_act_trsh()

void shake2wake_set_act_trsh ( shake2wake_t * ctx,
uint16_t act_trsh )

Set activity threshold function.

Parameters
ctxClick object.
act_trsh16-bit data representing the activity threshold.

This function is used to set the activity threshold.

◆ shake2wake_set_ext_samp_trg()

void shake2wake_set_ext_samp_trg ( shake2wake_t * ctx)

External sampling trigger function.

Parameters
ctxClick object.

This function is used to enable an external sampling trigger.

◆ shake2wake_set_fifo_above_half()

void shake2wake_set_fifo_above_half ( shake2wake_t * ctx)

Set FIFO Above Half function.

Parameters
ctxClick object.

This function is used to set the above half functionality.

◆ shake2wake_set_fifo_mode()

void shake2wake_set_fifo_mode ( shake2wake_t * ctx,
uint8_t mode )

Enable FIFO and Mode Selection function.

Parameters
ctxClick object.
mode8-bit data representing the FIFO mode.

This function is used to enable FIFO and mode selection.

◆ shake2wake_set_inact_enable()

void shake2wake_set_inact_enable ( shake2wake_t * ctx)

Set Inactivity Enable function.

Parameters
ctxClick object.

This function is used to enables the inactivity (underthreshold) functionality.

◆ shake2wake_set_inact_time()

void shake2wake_set_inact_time ( shake2wake_t * ctx,
uint16_t inac_time )

Set inactivity time function.

Parameters
ctxClick object.
inac_time8-bit data representing the inactivity time.

This function is used to set inactivity time.

◆ shake2wake_set_inact_trsh()

void shake2wake_set_inact_trsh ( shake2wake_t * ctx,
uint16_t inact_trsh )

Set inactivity threshold function.

Parameters
ctxClick object.
inact_trsh16-bit data representing the inactivity threshold.

This function is used to set the inactivity threshold.

◆ shake2wake_set_low_noise_mode()

void shake2wake_set_low_noise_mode ( shake2wake_t * ctx,
uint8_t low_noise )

Set Low Noise Mode function.

Parameters
ctxClick object.
low_noise8-bit data representing the low noise settings.

This function is used to set power vs noise tradeoff.

◆ shake2wake_set_out_data_rate()

void shake2wake_set_out_data_rate ( shake2wake_t * ctx,
uint8_t odr )

Select output data rate function.

Parameters
ctxClick object.
odr8-bit data representing the output data rate.

This function is used to select output data rate.

◆ shake2wake_set_range()

void shake2wake_set_range ( shake2wake_t * ctx,
uint8_t range )

Select measurement range function.

Parameters
ctxClick object.
range8-bit data representing the range.

This function is used to set the range.

◆ shake2wake_set_ref_act()

void shake2wake_set_ref_act ( shake2wake_t * ctx)

Set Referenced Activity function.

Parameters
ctxClick object.

This function is used to enable the activity detection in referenced mode.

◆ shake2wake_set_ref_inact()

void shake2wake_set_ref_inact ( shake2wake_t * ctx)

Set Referenced Inactivity function.

Parameters
ctxClick object.

This function is used to enable the inactivity detection in referenced mode.

◆ shake2wake_soft_reset()

void shake2wake_soft_reset ( shake2wake_t * ctx)

Software reset function.

Parameters
ctxClick object.

This function is used to perform software reset.

◆ shake2wake_stand_by_mode()

void shake2wake_stand_by_mode ( shake2wake_t * ctx)

Stand by function.

Parameters
ctxClick object.

This function is used to put the device into stand by mode.

◆ shake2wake_store_temp()

void shake2wake_store_temp ( shake2wake_t * ctx)

Store Temperature Data to FIFO function.

Parameters
ctxClick object.

This function is used to store the temperature data into FIFO.

◆ shake2wake_wake_up()

void shake2wake_wake_up ( shake2wake_t * ctx)

Wake up function.

Parameters
ctxClick object.

This function is used to wake up the device.

◆ shake2wake_write_byte()

void shake2wake_write_byte ( shake2wake_t * ctx,
uint8_t wr_addr,
uint8_t wr_val )

Write one byte function.

Parameters
ctxClick object.
wr_addr8-bit data that represents an address of a register.
wr_val8-bit data that that will be written into a register.

This function is used to write single byte to an address specified register.

◆ shake2wake_write_fifo_samp()

void shake2wake_write_fifo_samp ( shake2wake_t * ctx,
uint8_t samp )

Write FIFO samples function.

Parameters
ctxClick object.
samp8-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.

◆ shake2wake_write_int_1_map()

void shake2wake_write_int_1_map ( shake2wake_t * ctx,
uint8_t wr_data )

Write INT1 function map function.

Parameters
ctxClick object.
wr_data8-bit user defined data to be written into a register.

This function is used to configure the INT1 interrupt pin.

◆ shake2wake_write_int_2_map()

void shake2wake_write_int_2_map ( shake2wake_t * ctx,
uint8_t wr_data )

Write INT2 function map function.

Parameters
ctxClick object.
wr_data8-bit user defined data to be written into a register.

This function is used to configure the INT2 interrupt pin.

◆ shake2wake_write_two_byte()

void shake2wake_write_two_byte ( shake2wake_t * ctx,
uint8_t reg_addr,
uint16_t reg_val,
uint8_t cnt )

Write two bytes function.

Parameters
ctxClick object.
reg_addr8-bit data that represents an address of a register.
reg_val16-bit data that that will be written into registers.
cntNumber of bytes to be written.

This function is used to write up to two bytes of data to an address specified register.