Data Structures

struct  csp_kiss_handle_s
 This structure should be statically allocated by the user and passed to the kiss interface during the init function no member information should be changed. More...
 

Typedefs

typedef void(* csp_kiss_putc_f) (char buf)
 The putc function is used by the kiss interface to send a string of data to the serial port. More...
 
typedef void(* csp_kiss_discard_f) (char c, void *pxTaskWoken)
 The characters not accepted by the kiss interface, are discarded using this function, which must be implemented by the user and passed through the kiss_init function. More...
 
typedef struct csp_kiss_handle_s csp_kiss_handle_t
 This structure should be statically allocated by the user and passed to the kiss interface during the init function no member information should be changed. More...
 

Enumerations

enum  kiss_mode_e { KISS_MODE_NOT_STARTED, KISS_MODE_STARTED, KISS_MODE_ESCAPED, KISS_MODE_SKIP_FRAME }
 

Functions

void csp_kiss_rx (csp_iface_t *interface, uint8_t *buf, int len, void *pxTaskWoken)
 The KISS interface relies on the USART callback in order to parse incoming messaged from the serial interface. More...
 
void csp_kiss_init (csp_iface_t *csp_iface, csp_kiss_handle_t *csp_kiss_handle, csp_kiss_putc_f kiss_putc_f, csp_kiss_discard_f kiss_discard_f, const char *name)
 

Data Structure Documentation

struct csp_kiss_handle_s

This structure should be statically allocated by the user and passed to the kiss interface during the init function no member information should be changed.

Data Fields

csp_kiss_putc_f kiss_putc
 
csp_kiss_discard_f kiss_discard
 
unsigned int rx_length
 
kiss_mode_e rx_mode
 
unsigned int rx_first
 
volatile unsigned char * rx_cbuf
 
csp_packet_trx_packet
 

Field Documentation

csp_kiss_discard_f csp_kiss_handle_s::kiss_discard
csp_kiss_putc_f csp_kiss_handle_s::kiss_putc
volatile unsigned char* csp_kiss_handle_s::rx_cbuf
unsigned int csp_kiss_handle_s::rx_first
unsigned int csp_kiss_handle_s::rx_length
kiss_mode_e csp_kiss_handle_s::rx_mode
csp_packet_t* csp_kiss_handle_s::rx_packet

Typedef Documentation

typedef void(* csp_kiss_discard_f) (char c, void *pxTaskWoken)

The characters not accepted by the kiss interface, are discarded using this function, which must be implemented by the user and passed through the kiss_init function.

This reject function is typically used to display ASCII strings sent over the serial port, which are not in KISS format. Such as debugging information.

Parameters
crejected character
pxTaskWokenNULL if task context, pointer to variable if ISR

This structure should be statically allocated by the user and passed to the kiss interface during the init function no member information should be changed.

typedef void(* csp_kiss_putc_f) (char buf)

The putc function is used by the kiss interface to send a string of data to the serial port.

This function must be implemented by the user, and passed to the kiss interface through the kiss_init function.

Parameters
bufbyte to push

Enumeration Type Documentation

Enumerator
KISS_MODE_NOT_STARTED 
KISS_MODE_STARTED 
KISS_MODE_ESCAPED 
KISS_MODE_SKIP_FRAME 

Function Documentation

void csp_kiss_init ( csp_iface_t csp_iface,
csp_kiss_handle_t csp_kiss_handle,
csp_kiss_putc_f  kiss_putc_f,
csp_kiss_discard_f  kiss_discard_f,
const char *  name 
)
void csp_kiss_rx ( csp_iface_t interface,
uint8_t *  buf,
int  len,
void *  pxTaskWoken 
)

The KISS interface relies on the USART callback in order to parse incoming messaged from the serial interface.

The USART callback however does not support passing the handle number of the responding USART, so you need to implement a USART callback for each handle and then call kiss_rx subsequently.

In order to initialize the KISS interface. Fist call kiss_init() and then setup your usart to call csp_kiss_rx when new data is available.

When a byte is not a part of a kiss packet, it will be returned to your usart driver using the usart_insert funtion that you provide.

Parameters
csp_ifacepointer to interface
bufpointer to incoming data
lenlength of incoming data
pxTaskWokenNULL if task context, pointer to variable if ISR