ClearCore Library
|
Base class for interacting with all ClearCore serial.
This virtual class defines the common functionality for a serial object.
It provides a generic interface that all serial objects have. This includes
Base class for interacting with all ClearCore serial. More...
#include <ISerial.h>
Public Types | |
enum | _Parities { PARITY_E = 0 , PARITY_O , PARITY_N } |
typedef enum ClearCore::ISerial::_Parities | Parities |
Public Member Functions | |
virtual void | Flush ()=0 |
virtual void | FlushInput ()=0 |
virtual void | PortOpen ()=0 |
virtual void | PortClose ()=0 |
virtual bool | Speed (uint32_t bitsPerSecond)=0 |
Change the baud rate for the port. | |
virtual uint32_t | Speed ()=0 |
Gets the baud rate of the port. | |
virtual int16_t | CharGet ()=0 |
Attempt to read the next character from serial channel. | |
virtual int16_t | CharPeek ()=0 |
Attempt to get the next character from the serial channel without pulling the character out of the buffer. | |
virtual bool | SendChar (uint8_t charToSend)=0 |
Send an ascii character on the serial channel. | |
bool | SendLine () |
Send carriage return and newline characters. | |
bool | Send (const char *buffer, size_t bufferSize) |
Send the array of characters out the port. | |
bool | SendLine (const char *buffer, size_t bufferSize) |
Send the array of characters out the port. Terminate the line with carriage return and newline characters. | |
bool | Send (const char *nullTermStr) |
Send a string of characters out the port. | |
bool | SendLine (const char *nullTermStr) |
Send a string of characters out the port. Terminate the line with carriage return and newline characters. | |
bool | Send (char theChar) |
Send a character to be printed to the serial port. | |
bool | SendLine (char theChar) |
Send a character to be printed to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (double number, uint8_t precision=2) |
Send a floating point number to the serial port. | |
bool | SendLine (double number, uint8_t precision=2) |
Send a floating point number to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (int8_t number, uint8_t radix=10) |
Send an 8-bit signed number to be printed to the serial port. | |
bool | SendLine (int8_t number, uint8_t radix=10) |
Send an 8-bit signed number to be printed to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (uint8_t number, uint8_t radix=10) |
Send an 8-bit unsigned number to be printed to the serial port. | |
bool | SendLine (uint8_t number, uint8_t radix=10) |
Send an 8-bit unsigned number to be printed to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (int16_t number, uint8_t radix=10) |
Send a 16-bit signed number to be printed to the serial port. | |
bool | SendLine (int16_t number, uint8_t radix=10) |
Send a 16-bit signed number to be printed to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (uint16_t number, uint8_t radix=10) |
Send a 16-bit unsigned number to be printed to the serial port. | |
bool | SendLine (uint16_t number, uint8_t radix=10) |
Send a 16-bit unsigned number to be printed to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (int32_t number, uint8_t radix=10) |
Send a 32-bit signed number to be printed to the serial port. | |
bool | SendLine (int32_t number, uint8_t radix=10) |
Send a 32-bit signed number to be printed to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (uint32_t number, uint8_t radix=10) |
Send a 32-bit unsigned number to be printed to the serial port. | |
bool | SendLine (uint32_t number, uint8_t radix=10) |
Send a 32-bit unsigned number to be printed to the serial port. Terminate the line with carriage return and newline characters. | |
bool | Send (int number, uint8_t radix=10) |
Send an integer to be printed to the serial port. | |
bool | SendLine (int number, uint8_t radix=10) |
Send an integer to be printed to the serial port. | |
virtual int32_t | AvailableForRead ()=0 |
virtual int32_t | AvailableForWrite ()=0 |
Determines the number of characters available in the transmit buffer. | |
virtual void | WaitForTransmitIdle ()=0 |
virtual bool | PortIsOpen ()=0 |
Return whether or not the port is open. | |
virtual | operator bool ()=0 |
virtual bool | Parity (Parities newParity)=0 |
Set UART transmission parity format. | |
virtual Parities | Parity ()=0 |
Return current port UART transmission format. | |
virtual bool | StopBits (uint8_t bits)=0 |
virtual bool | CharSize (uint8_t size)=0 |
Change the number of bits in a character. | |
Different types of transmission formats
|
pure virtual |
Returns number of characters waiting in the receive buffer.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Determines the number of characters available in the transmit buffer.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Attempt to read the next character from serial channel.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Attempt to get the next character from the serial channel without pulling the character out of the buffer.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Change the number of bits in a character.
[in] | size | The new character size to be set |
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Flush the serial port's transmit buffer
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Flush the serial port's receive buffer
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Returns whether the serial port is open and the other end is connected.
Implemented in ClearCore::SerialUsb.
|
pure virtual |
Return current port UART transmission format.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Set UART transmission parity format.
[in] | newParity | The new parity to be set |
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Shut down the port
Implemented in ClearCore::SerialBase, ClearCore::SerialDriver, and ClearCore::SerialUsb.
|
pure virtual |
Return whether or not the port is open.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Set up the port to allow operations
Implemented in ClearCore::SerialBase, ClearCore::SerialDriver, and ClearCore::SerialUsb.
|
inline |
Send a character to be printed to the serial port.
[in] | theChar | The ascii character to be printed. |
|
inline |
Send the array of characters out the port.
[in] | buffer | The array of characters to be sent |
[in] | bufferSize | The number of characters to be sent |
|
inline |
Send a string of characters out the port.
[in] | nullTermStr | The string to be sent |
|
inline |
Send a floating point number to the serial port.
[in] | number | The double precision float value to be printed. |
[in] | precision | (optional) The number of digits to print after the decimal point. Default: 2. |
|
inline |
Send an integer to be printed to the serial port.
[in] | number | The integer value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 16-bit signed number to be printed to the serial port.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 32-bit signed number to be printed to the serial port.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send an 8-bit signed number to be printed to the serial port.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 16-bit unsigned number to be printed to the serial port.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 32-bit unsigned number to be printed to the serial port.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send an 8-bit unsigned number to be printed to the serial port.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
pure virtual |
Send an ascii character on the serial channel.
[in] | charToSend | The character to be sent |
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
inline |
Send carriage return and newline characters.
|
inline |
Send a character to be printed to the serial port. Terminate the line with carriage return and newline characters.
[in] | theChar | The ascii character to be printed. |
|
inline |
Send the array of characters out the port. Terminate the line with carriage return and newline characters.
[in] | buffer | The array of characters to be sent |
[in] | bufferSize | The number of characters to be sent |
|
inline |
Send a string of characters out the port. Terminate the line with carriage return and newline characters.
[in] | nullTermStr | The string to be sent |
|
inline |
Send a floating point number to the serial port. Terminate the line with carriage return and newline characters.
[in] | number | The double precision float value to be printed. |
[in] | precision | (optional) The number of digits to print after the decimal point. Default: 2. |
|
inline |
Send an integer to be printed to the serial port.
[in] | number | The integer value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 16-bit signed number to be printed to the serial port. Terminate the line with carriage return and newline characters.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 32-bit signed number to be printed to the serial port. Terminate the line with carriage return and newline characters.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send an 8-bit signed number to be printed to the serial port. Terminate the line with carriage return and newline characters.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 16-bit unsigned number to be printed to the serial port. Terminate the line with carriage return and newline characters.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send a 32-bit unsigned number to be printed to the serial port. Terminate the line with carriage return and newline characters.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
inline |
Send an 8-bit unsigned number to be printed to the serial port. Terminate the line with carriage return and newline characters.
[in] | number | The value to be printed. |
[in] | radix | (optional) The base in which to display the character representation of number. Default: 10. |
|
pure virtual |
Gets the baud rate of the port.
Implemented in ClearCore::SerialBase.
|
pure virtual |
Change the baud rate for the port.
[in] | bitsPerSecond | The new speed setting |
Implemented in ClearCore::SerialBase, and ClearCore::SerialDriver.
|
pure virtual |
Change the number of stop bits used in UART communication.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.
|
pure virtual |
Wait for transmission idle.
Implemented in ClearCore::SerialBase, and ClearCore::SerialUsb.