Firmware SDK
|
Driver for ZSSC3123 Capacitive Sensor. More...
Typedefs | |
typedef struct twr_zssc3123_t | twr_zssc3123_t |
ZSSC3123 instance. | |
Enumerations | |
enum | twr_zssc3123_event_t { TWR_ZSSC3123_EVENT_ERROR = 0 , TWR_ZSSC3123_EVENT_UPDATE = 1 } |
Callback events. More... | |
Functions | |
bool | twr_zssc3123_init (twr_zssc3123_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address) |
Initialize ZSSC3123. More... | |
bool | twr_zssc3123_deinit (twr_zssc3123_t *self) |
Deitialize ZSSC3123. More... | |
void | twr_zssc3123_set_data_fetch_delay (twr_zssc3123_t *self, twr_tick_t interval) |
Set data fetch delay. More... | |
void | twr_zssc3123_set_event_handler (twr_zssc3123_t *self, void(*event_handler)(twr_zssc3123_t *, twr_zssc3123_event_t, void *), void *event_param) |
Set callback function. More... | |
void | twr_zssc3123_set_update_interval (twr_zssc3123_t *self, twr_tick_t interval) |
Set scan interval. More... | |
bool | twr_zssc3123_measure (twr_zssc3123_t *self) |
Start measurement manually. More... | |
bool | twr_zssc3123_get_raw_cap_data (twr_zssc3123_t *self, uint16_t *raw) |
Get capacitance data as raw value. More... | |
bool | twr_zssc3123_start_cm (twr_zssc3123_t *self) |
Start Command Mode. More... | |
bool | twr_zssc3123_end_cm (twr_zssc3123_t *self) |
Ends Command Mode. More... | |
bool | twr_zssc3123_eeprom_read (twr_zssc3123_t *self, uint8_t address, uint16_t *word) |
Write to eeprom, work only with command mode. More... | |
bool | twr_zssc3123_eeprom_write (twr_zssc3123_t *self, uint8_t address, uint16_t word) |
Read from eeprm, work only with command mode. More... | |
bool | twr_zssc3123_unlock_eeprom (twr_zssc3123_t *self) |
Unlock eerpom, work only with command mode. More... | |
Driver for ZSSC3123 Capacitive Sensor.
enum twr_zssc3123_event_t |
Callback events.
Enumerator | |
---|---|
TWR_ZSSC3123_EVENT_ERROR | Error event. |
TWR_ZSSC3123_EVENT_UPDATE | Update event. |
Definition at line 13 of file twr_zssc3123.h.
bool twr_zssc3123_deinit | ( | twr_zssc3123_t * | self | ) |
Deitialize ZSSC3123.
[in] | self | Instance |
Definition at line 28 of file twr_zssc3123.c.
bool twr_zssc3123_eeprom_read | ( | twr_zssc3123_t * | self, |
uint8_t | address, | ||
uint16_t * | word | ||
) |
Write to eeprom, work only with command mode.
[in] | self | Instance |
[in] | address | Address |
[out] | word | Output data which have been read |
Definition at line 111 of file twr_zssc3123.c.
bool twr_zssc3123_eeprom_write | ( | twr_zssc3123_t * | self, |
uint8_t | address, | ||
uint16_t | word | ||
) |
Read from eeprm, work only with command mode.
[in] | self | Instance |
[in] | address | Address |
[in] | word | Data to write |
Definition at line 150 of file twr_zssc3123.c.
bool twr_zssc3123_end_cm | ( | twr_zssc3123_t * | self | ) |
Ends Command Mode.
[in] | self | Instance |
Definition at line 101 of file twr_zssc3123.c.
bool twr_zssc3123_get_raw_cap_data | ( | twr_zssc3123_t * | self, |
uint16_t * | raw | ||
) |
Get capacitance data as raw value.
[in] | self | Instance |
[out] | raw | Pointer to variable where result will be stored |
Definition at line 79 of file twr_zssc3123.c.
bool twr_zssc3123_init | ( | twr_zssc3123_t * | self, |
twr_i2c_channel_t | i2c_channel, | ||
uint8_t | i2c_address | ||
) |
Initialize ZSSC3123.
[in] | self | Instance |
[in] | i2c_channel | I2C channel |
[in] | i2c_address | I2C device address |
Definition at line 8 of file twr_zssc3123.c.
bool twr_zssc3123_measure | ( | twr_zssc3123_t * | self | ) |
Start measurement manually.
[in] | self | Instance |
Definition at line 65 of file twr_zssc3123.c.
Referenced by twr_zssc3123_set_update_interval().
void twr_zssc3123_set_data_fetch_delay | ( | twr_zssc3123_t * | self, |
twr_tick_t | interval | ||
) |
Set data fetch delay.
[in] | self | Instance |
[in] | interval | Desired scan interval in ticks |
Definition at line 37 of file twr_zssc3123.c.
void twr_zssc3123_set_event_handler | ( | twr_zssc3123_t * | self, |
void(*)(twr_zssc3123_t *, twr_zssc3123_event_t, void *) | event_handler, | ||
void * | event_param | ||
) |
Set callback function.
[in] | self | Instance |
[in] | event_handler | Function address |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 42 of file twr_zssc3123.c.
void twr_zssc3123_set_update_interval | ( | twr_zssc3123_t * | self, |
twr_tick_t | interval | ||
) |
Set scan interval.
[in] | self | Instance |
[in] | interval | Desired scan interval in ticks |
Definition at line 48 of file twr_zssc3123.c.
bool twr_zssc3123_start_cm | ( | twr_zssc3123_t * | self | ) |
Start Command Mode.
[in] | self | Instance |
Definition at line 91 of file twr_zssc3123.c.
bool twr_zssc3123_unlock_eeprom | ( | twr_zssc3123_t * | self | ) |
Unlock eerpom, work only with command mode.
[in] | self | Instance |
Definition at line 166 of file twr_zssc3123.c.