28#define CO_CONFIG_FIFO (0)
31#if (((CO_CONFIG_FIFO)&CO_CONFIG_FIFO_ENABLE) != 0) || defined CO_DOXYGEN
60#if (((CO_CONFIG_FIFO)&CO_CONFIG_FIFO_ALT_READ) != 0) || defined CO_DOXYGEN
63#if (((CO_CONFIG_FIFO)&CO_CONFIG_FIFO_ASCII_DATATYPES) != 0) || defined CO_DOXYGEN
89#if ((CO_CONFIG_FIFO)&CO_CONFIG_FIFO_ASCII_DATATYPES) != 0
126 sizeLeft += (int)fifo->
bufSize;
129 return (
size_t)sizeLeft;
142 if (sizeOccupied < 0) {
143 sizeOccupied += (int)fifo->
bufSize;
146 return (
size_t)sizeOccupied;
160 size_t writePtrNext = fifo->
writePtr + 1;
245#if (((CO_CONFIG_FIFO)&CO_CONFIG_FIFO_ALT_READ) != 0) || defined CO_DOXYGEN
274 if (sizeOccupied < 0) {
275 sizeOccupied += (int)fifo->
bufSize;
278 return (
size_t)sizeOccupied;
298#if (((CO_CONFIG_FIFO)&CO_CONFIG_FIFO_ASCII_COMMANDS) != 0) || defined CO_DOXYGEN
370#if (((CO_CONFIG_FIFO)&CO_CONFIG_FIFO_ASCII_DATATYPES) != 0) || defined CO_DOXYGEN
424#define CO_fifo_st_closed 0x01U
425#define CO_fifo_st_partial \
428#define CO_fifo_st_errTok 0x10U
429#define CO_fifo_st_errVal 0x20U
430#define CO_fifo_st_errBuf 0x40U
431#define CO_fifo_st_errInt 0x80U
432#define CO_fifo_st_errMask 0xF0U
Interface between CAN hardware and CANopenNode.
size_t CO_fifo_readI82a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read int8_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_readI162a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read int16_t variable from fifo as ascii string, see CO_fifo_readU82a.
static size_t CO_fifo_getSpace(CO_fifo_t *fifo)
Get free buffer space in CO_fifo_t object.
Definition CO_fifo.h:123
bool_t CO_fifo_CommSearch(CO_fifo_t *fifo, bool_t clear)
Search command inside FIFO.
size_t CO_fifo_cpyTok2U16(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to uint16_t variable, see CO_fifo_cpyTok2U8.
static bool_t CO_fifo_purge(CO_fifo_t *fifo)
Purge all data in fifo object, keep other properties.
Definition CO_fifo.h:105
size_t CO_fifo_cpyTok2I8(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to int8_t variable, see CO_fifo_cpyTok2U8.
size_t CO_fifo_cpyTok2U8(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Read ascii string from src fifo and copy as uint8_t variable to dest fifo.
static size_t CO_fifo_altGetOccupied(CO_fifo_t *fifo)
Get alternate size of remaining data, see CO_fifo_altRead.
Definition CO_fifo.h:272
size_t CO_fifo_readX162a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint16_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_cpyTok2B64(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Read ascii mime-base64 encoded string from src fifo and copy as binary data to dest fifo.
size_t CO_fifo_readX642a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint64_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_altRead(CO_fifo_t *fifo, uint8_t *buf, size_t count)
Alternate read data from CO_fifo_t object.
static size_t CO_fifo_getOccupied(CO_fifo_t *fifo)
Get size of data inside CO_fifo_t buffer object.
Definition CO_fifo.h:140
size_t CO_fifo_readToken(CO_fifo_t *fifo, char *buf, size_t count, uint8_t *closed, bool_t *err)
Get token from FIFO buffer.
size_t CO_fifo_readU82a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint8_t variable from fifo and output as ascii string.
size_t CO_fifo_altBegin(CO_fifo_t *fifo, size_t offset)
Initializes alternate read with CO_fifo_altRead.
size_t CO_fifo_read(CO_fifo_t *fifo, uint8_t *buf, size_t count, bool_t *eof)
Read data from CO_fifo_t object.
static void CO_fifo_reset(CO_fifo_t *fifo)
Reset fifo object, make it empty.
Definition CO_fifo.h:85
size_t CO_fifo_readI322a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read int32_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_write(CO_fifo_t *fifo, const uint8_t *buf, size_t count, uint16_t *crc)
Write data into CO_fifo_t object.
size_t CO_fifo_readR322a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read float32_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_readB642a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read data from fifo and output as mime-base64 encoded string.
void CO_fifo_altFinish(CO_fifo_t *fifo, uint16_t *crc)
Ends alternate read with CO_fifo_altRead and calculate crc checksum.
size_t CO_fifo_readX82a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint8_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_readVs2a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read data from fifo and output as visible string.
size_t CO_fifo_cpyTok2Hex(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy bytes written as two hex digits into to data.
size_t CO_fifo_readU642a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint64_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_cpyTok2U32(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to uint32_t variable, see CO_fifo_cpyTok2U8.
size_t CO_fifo_readX322a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint32_t variable from fifo as ascii string, see CO_fifo_readU82a.
void CO_fifo_init(CO_fifo_t *fifo, uint8_t *buf, size_t bufSize)
Initialize fifo object.
size_t CO_fifo_readU162a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint16_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_readU322a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read uint32_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_cpyTok2Vs(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy visible string to data.
size_t CO_fifo_cpyTok2I32(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to int32_t variable, see CO_fifo_cpyTok2U8.
size_t CO_fifo_cpyTok2I16(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to int16_t variable, see CO_fifo_cpyTok2U8.
bool_t CO_fifo_trimSpaces(CO_fifo_t *fifo, bool_t *insideComment)
Trim spaces inside FIFO.
size_t CO_fifo_cpyTok2U64(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to uint64_t variable, see CO_fifo_cpyTok2U8.
size_t CO_fifo_cpyTok2R64(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to float64_t variable, see CO_fifo_cpyTok2U8.
size_t CO_fifo_readR642a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read float64_t variable from fifo as ascii string, see CO_fifo_readU82a.
static bool_t CO_fifo_getc(CO_fifo_t *fifo, uint8_t *buf)
Get one character from CO_fifo_t buffer object.
Definition CO_fifo.h:203
size_t CO_fifo_readHex2a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read data from fifo and output as space separated two digit ascii string, see also CO_fifo_readU82a.
size_t CO_fifo_cpyTok2I64(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to int64_t variable, see CO_fifo_cpyTok2U8.
static bool_t CO_fifo_putc(CO_fifo_t *fifo, const uint8_t c)
Put one character into CO_fifo_t buffer object.
Definition CO_fifo.h:158
static void CO_fifo_putc_ov(CO_fifo_t *fifo, const uint8_t c)
Put one character into CO_fifo_t buffer object.
Definition CO_fifo.h:179
size_t CO_fifo_readI642a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read int64_t variable from fifo as ascii string, see CO_fifo_readU82a.
size_t CO_fifo_cpyTok2R32(CO_fifo_t *dest, CO_fifo_t *src, uint8_t *status)
Copy ascii string to float32_t variable, see CO_fifo_cpyTok2U8.
#define NULL
NULL, for general usage.
Definition CO_driver.h:123
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition CO_driver.h:132
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition CO_driver.h:133
uint_fast8_t bool_t
Boolean data type for general use.
Definition CO_driver.h:126
unsigned char uint8_t
UNSIGNED8 in CANopen (0005h), 8-bit unsigned integer.
Definition CO_driver.h:131
Fifo object.
Definition CO_fifo.h:55
size_t bufSize
Initialized by CO_fifo_init()
Definition CO_fifo.h:57
size_t readPtr
Location in the buffer, which will be next read.
Definition CO_fifo.h:59
size_t altReadPtr
Location in the buffer, which will be next read.
Definition CO_fifo.h:61
size_t writePtr
Location in the buffer, which will be next written.
Definition CO_fifo.h:58
uint8_t * buf
Buffer of size bufSize.
Definition CO_fifo.h:56
uint32_t aux
auxiliary variable, used in some functions.
Definition CO_fifo.h:65
bool_t started
helper variable, set to false in CO_fifo_reset(), used in some functions.
Definition CO_fifo.h:64