1 #ifndef _TWR_CY8CMBR3102_H
2 #define _TWR_CY8CMBR3102_H
5 #include <twr_scheduler.h>
31 TWR_CY8CMBR3102_STATE_ERROR = -1,
32 TWR_CY8CMBR3102_STATE_INITIALIZE = 0,
33 TWR_CY8CMBR3102_STATE_CALC_CONFIG_CRC = 1,
34 TWR_CY8CMBR3102_STATE_SELF_RESET = 2,
35 TWR_CY8CMBR3102_STATE_READ = 3
37 } twr_cy8cmbr3102_state_t;
46 twr_cy8cmbr3102_state_t _state;
twr_cy8cmbr3102_event_t
Callback events.
bool twr_cy8cmbr3102_is_touch(twr_cy8cmbr3102_t *self, bool *is_touch)
Is touch.
bool twr_cy8cmbr3102_get_proximity(twr_cy8cmbr3102_t *self, uint16_t value)
Get proximity (Capacitive sensor difference count signal.)
void twr_cy8cmbr3102_set_scan_interval(twr_cy8cmbr3102_t *self, twr_tick_t scan_interval)
Set scan interval.
void twr_cy8cmbr3102_set_event_handler(twr_cy8cmbr3102_t *self, void(*event_handler)(twr_cy8cmbr3102_t *, twr_cy8cmbr3102_event_t, void *), void *event_param)
Set callback function.
bool twr_cy8cmbr3102_init(twr_cy8cmbr3102_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize CY8CMBR3102.
struct twr_cy8cmbr3102_t twr_cy8cmbr3102_t
TCA9534A instance.
@ TWR_CY8CMBR3102_EVENT_TOUCH
Update event.
@ TWR_CY8CMBR3102_EVENT_ERROR
Error event.
twr_i2c_channel_t
I2C channels.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.
uint64_t twr_tick_t
Timestamp data type.