Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_zssc3123

Driver for ZSSC3123 Capacitive Sensor. More...

Typedefs

typedef struct bc_zssc3123_t bc_zssc3123_t
 ZSSC3123 instance.
 

Enumerations

enum  bc_zssc3123_event_t {
  BC_ZSSC3123_EVENT_ERROR = 0,
  BC_ZSSC3123_EVENT_UPDATE = 1
}
 Callback events. More...
 

Functions

bool bc_zssc3123_init (bc_zssc3123_t *self, bc_i2c_channel_t i2c_channel, uint8_t i2c_address)
 Initialize ZSSC3123. More...
 
bool bc_zssc3123_deinit (bc_zssc3123_t *self)
 Deitialize ZSSC3123. More...
 
void bc_zssc3123_set_data_fetch_delay (bc_zssc3123_t *self, bc_tick_t interval)
 Set data fetch delay. More...
 
void bc_zssc3123_set_event_handler (bc_zssc3123_t *self, void(*event_handler)(bc_zssc3123_t *, bc_zssc3123_event_t, void *), void *event_param)
 Set callback function. More...
 
void bc_zssc3123_set_update_interval (bc_zssc3123_t *self, bc_tick_t interval)
 Set scan interval. More...
 
bool bc_zssc3123_measure (bc_zssc3123_t *self)
 Start measurement manually. More...
 
bool bc_zssc3123_get_raw_cap_data (bc_zssc3123_t *self, uint16_t *raw)
 Get capacitance data as raw value. More...
 
bool bc_zssc3123_start_cm (bc_zssc3123_t *self)
 Start Command Mode. More...
 
bool bc_zssc3123_end_cm (bc_zssc3123_t *self)
 Ends Command Mode. More...
 
bool bc_zssc3123_eeprom_read (bc_zssc3123_t *self, uint8_t address, uint16_t *word)
 Write to eeprom, work only with command mode. More...
 
bool bc_zssc3123_eeprom_write (bc_zssc3123_t *self, uint8_t address, uint16_t word)
 Read from eeprm, work only with command mode. More...
 
bool bc_zssc3123_unlock_eeprom (bc_zssc3123_t *self)
 Unlock eerpom, work only with command mode. More...
 

Detailed Description

Driver for ZSSC3123 Capacitive Sensor.

Enumeration Type Documentation

Callback events.

Enumerator
BC_ZSSC3123_EVENT_ERROR 

Error event.

BC_ZSSC3123_EVENT_UPDATE 

Update event.

Definition at line 13 of file bc_zssc3123.h.

Function Documentation

bool bc_zssc3123_deinit ( bc_zssc3123_t self)

Deitialize ZSSC3123.

Parameters
[in]selfInstance

Definition at line 28 of file bc_zssc3123.c.

Here is the call graph for this function:

bool bc_zssc3123_eeprom_read ( bc_zssc3123_t self,
uint8_t  address,
uint16_t *  word 
)

Write to eeprom, work only with command mode.

Parameters
[in]selfInstance
[in]addressAddress
[out]wordOutput data which have been read
Returns
true On success
false On failure

Definition at line 111 of file bc_zssc3123.c.

Here is the call graph for this function:

bool bc_zssc3123_eeprom_write ( bc_zssc3123_t self,
uint8_t  address,
uint16_t  word 
)

Read from eeprm, work only with command mode.

Parameters
[in]selfInstance
[in]addressAddress
[in]wordData to write
Returns
true On success
false On failure

Definition at line 150 of file bc_zssc3123.c.

Here is the call graph for this function:

bool bc_zssc3123_end_cm ( bc_zssc3123_t self)

Ends Command Mode.

Parameters
[in]selfInstance

Definition at line 101 of file bc_zssc3123.c.

Here is the call graph for this function:

bool bc_zssc3123_get_raw_cap_data ( bc_zssc3123_t self,
uint16_t *  raw 
)

Get capacitance data as raw value.

Parameters
[in]selfInstance
[out]rawPointer to variable where result will be stored
Returns
true When value is valid
false When value is invalid

Definition at line 79 of file bc_zssc3123.c.

bool bc_zssc3123_init ( bc_zssc3123_t self,
bc_i2c_channel_t  i2c_channel,
uint8_t  i2c_address 
)

Initialize ZSSC3123.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address

Definition at line 8 of file bc_zssc3123.c.

Here is the call graph for this function:

bool bc_zssc3123_measure ( bc_zssc3123_t self)

Start measurement manually.

Parameters
[in]selfInstance
Returns
true On success
false When other measurement is in progress

Definition at line 65 of file bc_zssc3123.c.

Referenced by bc_zssc3123_set_update_interval().

Here is the call graph for this function:

Here is the caller graph for this function:

void bc_zssc3123_set_data_fetch_delay ( bc_zssc3123_t self,
bc_tick_t  interval 
)

Set data fetch delay.

Parameters
[in]selfInstance
[in]intervalDesired scan interval in ticks

Definition at line 37 of file bc_zssc3123.c.

void bc_zssc3123_set_event_handler ( bc_zssc3123_t self,
void(*)(bc_zssc3123_t *, bc_zssc3123_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 42 of file bc_zssc3123.c.

void bc_zssc3123_set_update_interval ( bc_zssc3123_t self,
bc_tick_t  interval 
)

Set scan interval.

Parameters
[in]selfInstance
[in]intervalDesired scan interval in ticks

Definition at line 48 of file bc_zssc3123.c.

Here is the call graph for this function:

bool bc_zssc3123_start_cm ( bc_zssc3123_t self)

Start Command Mode.

Parameters
[in]selfInstance

Definition at line 91 of file bc_zssc3123.c.

Here is the call graph for this function:

bool bc_zssc3123_unlock_eeprom ( bc_zssc3123_t self)

Unlock eerpom, work only with command mode.

Parameters
[in]selfInstance
Returns
true On success
false On failure

Definition at line 166 of file bc_zssc3123.c.

Here is the call graph for this function: