orcus
|
UART. More...
#include <stdint.h>
Enumerations | |
enum | Parity { NONE , ODD , EVEN } |
UART parity settings. More... | |
Functions | |
void | uartConfigure (int baudRate, int bitsPerFrame, Parity parity, int stopBits) |
Configure UART parameters. More... | |
int | uartGetc (bool isBlocking) |
Get a character from UART. More... | |
void | uartPrintf (const char *format,...) |
printf over UART. More... | |
char | uartPutc (char c, bool isBlocking) |
Output character over UART. More... | |
void | uartSetEcho (bool isEnabled) |
Set UART echoing. More... | |
enum Parity |
void uartConfigure | ( | int | baudRate, |
int | bitsPerFrame, | ||
Parity | parity, | ||
int | stopBits | ||
) |
Configures UART parameters.
Example (115200 8N1):
int uartGetc | ( | bool | isBlocking | ) |
Gets a single character from UART.
isBlocking | If true, will wait for a character to become available, otherwise will return immediately if no character is in the input buffer. |
void uartPrintf | ( | const char * | format, |
... | |||
) |
As per the standard printf, with output directly to UART.
char uartPutc | ( | char | c, |
bool | isBlocking | ||
) |
Outputs a single character over UART.
c | Character to output |
isBlocking | If true will wait until the output buffer has space for this character, will fail fast if false |
void uartSetEcho | ( | bool | isEnabled | ) |
If enabled, uartGetc will echo any character received back out to the UART. This is handy when implementing a command line interface over UART.
isEnabled | If true, UART echoing will be enabled. |