Firmware SDK
twr_cy8cmbr3102

Driver for CY8CMBR3102. More...

Typedefs

typedef struct twr_cy8cmbr3102_t twr_cy8cmbr3102_t
 TCA9534A instance.
 

Enumerations

enum  twr_cy8cmbr3102_event_t {
  TWR_CY8CMBR3102_EVENT_ERROR = 0 ,
  TWR_CY8CMBR3102_EVENT_TOUCH = 1
}
 Callback events. More...
 

Functions

bool twr_cy8cmbr3102_init (twr_cy8cmbr3102_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
 Initialize CY8CMBR3102. More...
 
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. More...
 
void twr_cy8cmbr3102_set_scan_interval (twr_cy8cmbr3102_t *self, twr_tick_t scan_interval)
 Set scan interval. More...
 
bool twr_cy8cmbr3102_get_proximity (twr_cy8cmbr3102_t *self, uint16_t value)
 Get proximity (Capacitive sensor difference count signal.) More...
 
bool twr_cy8cmbr3102_is_touch (twr_cy8cmbr3102_t *self, bool *is_touch)
 Is touch. More...
 

Detailed Description

Driver for CY8CMBR3102.

Enumeration Type Documentation

◆ twr_cy8cmbr3102_event_t

Callback events.

Enumerator
TWR_CY8CMBR3102_EVENT_ERROR 

Error event.

TWR_CY8CMBR3102_EVENT_TOUCH 

Update event.

Definition at line 13 of file twr_cy8cmbr3102.h.

Function Documentation

◆ twr_cy8cmbr3102_get_proximity()

bool twr_cy8cmbr3102_get_proximity ( twr_cy8cmbr3102_t self,
uint16_t  value 
)

Get proximity (Capacitive sensor difference count signal.)

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

Definition at line 57 of file twr_cy8cmbr3102.c.

Here is the call graph for this function:

◆ twr_cy8cmbr3102_init()

bool twr_cy8cmbr3102_init ( twr_cy8cmbr3102_t self,
twr_i2c_channel_t  i2c_channel,
uint8_t  i2c_address 
)

Initialize CY8CMBR3102.

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

Definition at line 28 of file twr_cy8cmbr3102.c.

Here is the call graph for this function:

◆ twr_cy8cmbr3102_is_touch()

bool twr_cy8cmbr3102_is_touch ( twr_cy8cmbr3102_t self,
bool *  is_touch 
)

Is touch.

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

Definition at line 62 of file twr_cy8cmbr3102.c.

Here is the call graph for this function:

◆ twr_cy8cmbr3102_set_event_handler()

void twr_cy8cmbr3102_set_event_handler ( twr_cy8cmbr3102_t self,
void(*)(twr_cy8cmbr3102_t *, twr_cy8cmbr3102_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 44 of file twr_cy8cmbr3102.c.

◆ twr_cy8cmbr3102_set_scan_interval()

void twr_cy8cmbr3102_set_scan_interval ( twr_cy8cmbr3102_t self,
twr_tick_t  scan_interval 
)

Set scan interval.

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

Definition at line 50 of file twr_cy8cmbr3102.c.

Here is the call graph for this function: