CharDev Class Referenceabstract
#include <char_dev.hpp>
Inheritance diagram for CharDev:

Public Member Functions | |
virtual bool | getChar (char *pInputChar, unsigned int timeout=portMAX_DELAY)=0 |
virtual bool | putChar (char out, unsigned int timeout=portMAX_DELAY)=0 |
virtual bool | flush (void) |
bool | gets (char *pBuff, int maxLen, unsigned int timeout=0xffffffff) |
int | printf (const char *format,...) |
int | scanf (const char *format,...) |
uint16_t | getPrintfMemSize (void) const |
bool | put (const char *pString, unsigned int timeout=0xffffffff) |
void | putline (const char *pBuff, unsigned int timeout=0xffffffff) |
bool | isReady (void) |
void | setReady (bool r) |
Protected Member Functions | |
CharDev () | |
virtual | ~CharDev () |
Detailed Description
Char device base class. You shouldn't use this directly because this is an abstract class and must be inherited and used by a parent object.
Constructor & Destructor Documentation
|
protected |
|
protectedvirtual |
Member Function Documentation
|
inlinevirtual |
Optional flush to flush out all the data
Reimplemented in UartDev, and NordicStream.
|
pure virtual |
- Returns
- a character from the UART input
- Parameters
-
pInputChar The pointer to input char to store received character timeout Optional parameter which defaults to maximum value that will allow you to wait forever for a character to be received
- Returns
- true if a character was obtained within the given timeout
Implemented in UartDev, and NordicStream.
|
inline |
bool CharDev::gets | ( | char * | pBuff, |
int | maxLen, | ||
unsigned int | timeout = 0xffffffff |
||
) |
Get a string of input up to maxLen
- Parameters
-
pBuff The buffer to store data to maxLen The maximum chars to get timeout The timeout in ticks to wait
|
inline |
This API just provides a means to set a flag if UART is ready or not This doesn't cause any change to the way UART functions.
int CharDev::printf | ( | const char * | format, |
... | |||
) |
Just like printf, except it will print to this output interface
- Returns
- the number of characters printed
bool CharDev::put | ( | const char * | pString, |
unsigned int | timeout = 0xffffffff |
||
) |
Output a null-terminated string puts() will also output newline chars "\r\n" at the end of the string
|
pure virtual |
Outputs a char given by
- Parameters
-
out timeout Optional parameter which defaults to maximum value that will allow you to wait forever for a character to be sent
- Returns
- true if the output char was successfully written to Queue, or false if the output queue was full within the given timeout
Implemented in UartDev, and NordicStream.
void CharDev::putline | ( | const char * | pBuff, |
unsigned int | timeout = 0xffffffff |
||
) |
int CharDev::scanf | ( | const char * | format, |
... | |||
) |
|
inline |
The documentation for this class was generated from the following files:
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/base/char_dev.hpp
- /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/base/char_dev.cpp