ASCII Serial Com
Serial communication library between computers, microcontrollers, FPGAs, etc. Uses only ASCII. Not the most efficient protocol, but meant to be easy to read
Loading...
Searching...
No Matches
Functions
ascii_serial_com_device.c File Reference
#include "ascii_serial_com_device.h"
Include dependency graph for ascii_serial_com_device.c:

Go to the source code of this file.

Functions

void ascii_serial_com_device_init (ascii_serial_com_device *ascd, ascii_serial_com_device_config *config)
 ASCII Serial Com Device init.
 
void ascii_serial_com_device_receive (ascii_serial_com_device *ascd)
 ASCII Serial Com Device receive messages.
 
circular_buffer_uint8ascii_serial_com_device_get_input_buffer (ascii_serial_com_device *ascd)
 ASCII Serial Com Device get input buffer.
 
circular_buffer_uint8ascii_serial_com_device_get_output_buffer (ascii_serial_com_device *ascd)
 ASCII Serial Com Device get output buffer.
 
void ascii_serial_com_device_put_message_in_output_buffer (ascii_serial_com_device *ascd, char ascVersion, char appVersion, char command, char *data, size_t dataLen)
 ASCII Serial Com Device put a message in output buffer.
 
void ascii_serial_com_device_put_s_message_in_output_buffer (ascii_serial_com_device *ascd, char ascVersion, char appVersion, char *data, size_t dataLen)
 ASCII Serial Com Device put a 's' message in output buffer.
 

Function Documentation

◆ ascii_serial_com_device_get_input_buffer()

circular_buffer_uint8 * ascii_serial_com_device_get_input_buffer ( ascii_serial_com_device * ascd)

ASCII Serial Com Device get input buffer.

MAKE SURE ascd IS ALREADY INITIALIZED!

/param ascd: initialized ascii_serial_com_device

Definition at line 58 of file ascii_serial_com_device.c.

References __ascii_serial_com_device::asc, and ascii_serial_com_get_input_buffer().

◆ ascii_serial_com_device_get_output_buffer()

circular_buffer_uint8 * ascii_serial_com_device_get_output_buffer ( ascii_serial_com_device * ascd)

ASCII Serial Com Device get output buffer.

MAKE SURE ascd IS ALREADY INITIALIZED!

/param ascd: initialized ascii_serial_com_device

Definition at line 63 of file ascii_serial_com_device.c.

References __ascii_serial_com_device::asc, and ascii_serial_com_get_output_buffer().

◆ ascii_serial_com_device_init()

void ascii_serial_com_device_init ( ascii_serial_com_device * ascd,
ascii_serial_com_device_config * config )

ASCII Serial Com Device init.

Initialize ASCII Serial Com device

The functions take the stuff from ascii_serial_com_get_message_from_input_buffer plus a void pointer to possible state/configuration info. If the functions are null ptrs, an error message returned to host. This class owns the data buffer passed around.

Definition at line 5 of file ascii_serial_com_device.c.

References __ascii_serial_com_device::asc, and ascii_serial_com_init().

◆ ascii_serial_com_device_put_message_in_output_buffer()

void ascii_serial_com_device_put_message_in_output_buffer ( ascii_serial_com_device * ascd,
char ascVersion,
char appVersion,
char command,
char * data,
size_t dataLen )

ASCII Serial Com Device put a message in output buffer.

MAKE SURE ascd IS ALREADY INITIALIZED!

Definition at line 67 of file ascii_serial_com_device.c.

References __ascii_serial_com_device::asc, and ascii_serial_com_put_message_in_output_buffer().

◆ ascii_serial_com_device_put_s_message_in_output_buffer()

void ascii_serial_com_device_put_s_message_in_output_buffer ( ascii_serial_com_device * ascd,
char ascVersion,
char appVersion,
char * data,
size_t dataLen )

ASCII Serial Com Device put a 's' message in output buffer.

MAKE SURE ascd IS ALREADY INITIALIZED!

Definition at line 74 of file ascii_serial_com_device.c.

References __ascii_serial_com_device::asc, and ascii_serial_com_put_s_message_in_output_buffer().

◆ ascii_serial_com_device_receive()

void ascii_serial_com_device_receive ( ascii_serial_com_device * ascd)

ASCII Serial Com Device receive messages.

Receives ASCII Serial Com messages, and hands them over to the appropriate one of the functions

/param ascd: initialized ascii_serial_com_device

Definition at line 11 of file ascii_serial_com_device.c.

References __ascii_serial_com_device::asc, ascii_serial_com_get_message_from_input_buffer(), ascii_serial_com_put_error_in_output_buffer(), __ascii_serial_com_device::ascVersion, __ascii_serial_com_device::dataBuffer, __ascii_serial_com_device_config::func_nf, __ascii_serial_com_device_config::func_rw, and __ascii_serial_com_device_config::func_s.