samltouch  2.0.0.0
Functions

Functions

void samltouch_cfg_setup (samltouch_cfg_t *cfg)
 Config Object Initialization function. More...
 
SAMLTOUCH_RETVAL samltouch_init (samltouch_t *ctx, samltouch_cfg_t *cfg)
 Initialization function. More...
 
void samltouch_generic_write (samltouch_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t samltouch_generic_read (samltouch_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
void samltouch_parser (char *data_in, samltouch_state_t *state)
 Generic parser function. More...
 

Detailed Description

Function Documentation

◆ samltouch_cfg_setup()

void samltouch_cfg_setup ( samltouch_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ samltouch_generic_read()

int32_t samltouch_generic_read ( samltouch_t ctx,
char *  data_buf,
uint16_t  max_len 
)

Generic read function.

Parameters
ctxClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ samltouch_generic_write()

void samltouch_generic_write ( samltouch_t ctx,
char *  data_buf,
uint16_t  len 
)

Generic write function.

Parameters
ctxClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ samltouch_init()

SAMLTOUCH_RETVAL samltouch_init ( samltouch_t ctx,
samltouch_cfg_t cfg 
)

Initialization function.

Parameters
samltouchClick object.
cfgClick configuration structure.

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

◆ samltouch_parser()

void samltouch_parser ( char *  data_in,
samltouch_state_t state 
)

Generic parser function.

Parameters
data_inpointer to response buffer
statepointer to the structure.

@description The function parses the response it receives - restores the state of the button 1, button 2, the slider status and the slider position.