KISS Interface

group KISSInterface

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.

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

Parameters
  • buf: byte to push

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
  • c: rejected character
  • pxTaskWoken: NULL if task context, pointer to variable if ISR

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.

Enums

enum kiss_mode_e

Values:

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.

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_iface: pointer to interface
  • buf: pointer to incoming data
  • len: length of incoming data
  • pxTaskWoken: NULL if task context, pointer to variable if ISR

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)
struct csp_kiss_handle_s
#include <csp_if_kiss.h>

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.