Go to the documentation of this file.
32 #ifndef CO_CONFIG_FIFO
33 #define CO_CONFIG_FIFO (0)
36 #if ((CO_CONFIG_FIFO) & CO_CONFIG_FIFO_ENABLE) || defined CO_DOXYGEN
69 #if ((CO_CONFIG_FIFO) & CO_CONFIG_FIFO_ALT_READ) || defined CO_DOXYGEN
73 #if ((CO_CONFIG_FIFO) & CO_CONFIG_FIFO_ASCII_DATATYPES) || defined CO_DOXYGEN
104 #if (CO_CONFIG_FIFO) & CO_CONFIG_FIFO_ASCII_DATATYPES
144 return (
size_t) sizeLeft;
157 if (sizeOccupied < 0) {
161 return (
size_t) sizeOccupied;
175 size_t writePtrNext = fifo->
writePtr + 1;
176 if (writePtrNext != fifo->
readPtr &&
268 #if ((CO_CONFIG_FIFO) & CO_CONFIG_FIFO_ALT_READ) || defined CO_DOXYGEN
299 if (sizeOccupied < 0) {
303 return (
size_t) sizeOccupied;
327 #if ((CO_CONFIG_FIFO) & CO_CONFIG_FIFO_ASCII_COMMANDS) || defined CO_DOXYGEN
417 #if ((CO_CONFIG_FIFO) & CO_CONFIG_FIFO_ASCII_DATATYPES) || defined CO_DOXYGEN
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_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.
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
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.
@ CO_fifo_st_errVal
Bit is set, if value is not valid or out of limits.
Definition: CO_fifo.h:481
Interface between CAN hardware and CANopenNode.
size_t CO_fifo_cpyTok2Hex(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy bytes written as two hex digits into to data.
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_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 writePtr
Location in the buffer, which will be next written.
Definition: CO_fifo.h:66
size_t CO_fifo_cpyTok2B64(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Read ascii mime-base64 encoded string from src fifo and copy as binary data to dest fifo.
static void CO_fifo_reset(CO_fifo_t *fifo)
Reset fifo object, make it empty.
Definition: CO_fifo.h:100
unsigned int uint16_t
UNSIGNED16 in CANopen (0006h), 16-bit unsigned integer.
Definition: CO_driver.h:153
size_t altReadPtr
Location in the buffer, which will be next read.
Definition: CO_fifo.h:71
static size_t CO_fifo_altGetOccupied(CO_fifo_t *fifo)
Get alternate size of remaining data, see CO_fifo_altRead.
Definition: CO_fifo.h:297
size_t CO_fifo_cpyTok2U32(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to uint32_t variable, see CO_fifo_cpyTok2U8.
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
static bool_t CO_fifo_getc(CO_fifo_t *fifo, char *buf)
Get one character from CO_fifo_t buffer object.
Definition: CO_fifo.h:216
char * buf
Buffer of size bufSize.
Definition: CO_fifo.h:62
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.
bool_t started
helper variable, set to false in CO_fifo_reset(), used in some functions.
Definition: CO_fifo.h:76
@ CO_fifo_st_errInt
Bit is set, if internal error.
Definition: CO_fifo.h:485
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.
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_cpyTok2U8(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Read ascii string from src fifo and copy as uint8_t variable to dest fifo.
size_t bufSize
Initialized by CO_fifo_init()
Definition: CO_fifo.h:64
@ CO_fifo_st_errMask
Bitmask for error bits.
Definition: CO_fifo.h:487
@ CO_fifo_st_errBuf
Bit is set, if destination buffer is to small.
Definition: CO_fifo.h:483
void CO_fifo_init(CO_fifo_t *fifo, char *buf, size_t bufSize)
Initialize fifo object.
CO_fifo_st
Bitfields for status argument from CO_fifo_cpyTok2U8 function and similar.
Definition: CO_fifo.h:472
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_cpyTok2Vs(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy visible string to data.
static size_t CO_fifo_getOccupied(CO_fifo_t *fifo)
Get size of data inside CO_fifo_t buffer object.
Definition: CO_fifo.h:155
size_t CO_fifo_cpyTok2I32(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to int32_t variable, see CO_fifo_cpyTok2U8.
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_altBegin(CO_fifo_t *fifo, size_t offset)
Initializes alternate read with CO_fifo_altRead.
size_t CO_fifo_cpyTok2I16(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to int16_t variable, see CO_fifo_cpyTok2U8.
size_t readPtr
Location in the buffer, which will be next read.
Definition: CO_fifo.h:68
Fifo object.
Definition: CO_fifo.h:60
static bool_t CO_fifo_putc(CO_fifo_t *fifo, const char c)
Put one character into CO_fifo_t buffer object.
Definition: CO_fifo.h:173
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_cpyTok2I8(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to int8_t variable, see CO_fifo_cpyTok2U8.
@ CO_fifo_st_partial
Bit is set, if copy was partial and more data are available.
Definition: CO_fifo.h:477
size_t CO_fifo_cpyTok2U16(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to uint16_t variable, see CO_fifo_cpyTok2U8.
size_t CO_fifo_write(CO_fifo_t *fifo, const char *buf, size_t count, uint16_t *crc)
Write data into CO_fifo_t object.
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.
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_readVs2a(CO_fifo_t *fifo, char *buf, size_t count, bool_t end)
Read data from fifo and output as visible string.
static bool_t CO_fifo_purge(CO_fifo_t *fifo)
Purge all data in fifo object, keep other properties.
Definition: CO_fifo.h:120
size_t CO_fifo_read(CO_fifo_t *fifo, char *buf, size_t count, bool_t *eof)
Read data from CO_fifo_t object.
size_t CO_fifo_altRead(CO_fifo_t *fifo, char *buf, size_t count)
Alternate read data from CO_fifo_t object.
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_cpyTok2R64(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to float64_t variable, see CO_fifo_cpyTok2U8.
#define NULL
NULL, for general usage.
Definition: CO_driver.h:135
uint32_t aux
auxiliary variable, used in some functions.
Definition: CO_fifo.h:78
size_t CO_fifo_cpyTok2I64(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to int64_t variable, see CO_fifo_cpyTok2U8.
bool_t CO_fifo_CommSearch(CO_fifo_t *fifo, bool_t clear)
Search command inside FIFO.
static void CO_fifo_putc_ov(CO_fifo_t *fifo, const char c)
Put one character into CO_fifo_t buffer object.
Definition: CO_fifo.h:196
size_t CO_fifo_cpyTok2U64(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to uint64_t variable, see CO_fifo_cpyTok2U8.
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.
size_t CO_fifo_cpyTok2R32(CO_fifo_t *dest, CO_fifo_t *src, CO_fifo_st *status)
Copy ascii string to float32_t variable, see CO_fifo_cpyTok2U8.
size_t CO_fifo_readToken(CO_fifo_t *fifo, char *buf, size_t count, char *closed, bool_t *err)
Get token from FIFO buffer.
@ CO_fifo_st_errTok
Bit is set, if no valid token found.
Definition: CO_fifo.h:479
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_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.
@ CO_fifo_st_closed
Bit is set, if command delimiter is reached in src.
Definition: CO_fifo.h:474
static size_t CO_fifo_getSpace(CO_fifo_t *fifo)
Get free buffer space in CO_fifo_t object.
Definition: CO_fifo.h:138
bool_t CO_fifo_trimSpaces(CO_fifo_t *fifo, bool_t *insideComment)
Trim spaces inside FIFO.