EE445M RTOS
Taken at the University of Texas Spring 2015
|
#include <uartpp.hpp>
Public Member Functions | |
uart () | |
uart (memory_address_t uart_channel, memory_address_t uart_interrupt, uint32_t uart_baud_rate=115200) | |
virtual void | start (void) |
virtual void | stop (void) |
virtual uint32_t | ack (void) |
void | send_char (const char) |
void | send_string (const char *) |
void | send_newline (void) |
char | get_char (void) |
char * | get_string (const uint32_t length) |
void | printf (const char *pcString,...) |
void | atomic_printf (const char *pcString,...) |
![]() | |
interruptable () | |
![]() | |
uint32_t | StartCritical (void) |
void | EndCritical (uint32_t primask) |
Public Attributes | |
char | buffer [UART_DEFAULT_MAX_GET_STRING_LENGTH] |
Static Public Attributes | |
static bool | LAST_WAS_CR |
Private Member Functions | |
void | vprintf (const char *pcString, va_list vaArgP) |
Private Attributes | |
uint32_t | baud_rate |
memory_address_t | channel |
memory_address_t | interrupt |
Additional Inherited Members | |
![]() | |
static uint32_t | static_StartCritical (void) |
static void | static_EndCritical (uint32_t primask) |
Definition at line 28 of file uartpp.hpp.
uart::uart | ( | ) |
Definition at line 21 of file uartpp.cpp.
uart::uart | ( | memory_address_t | uart_channel, |
memory_address_t | uart_interrupt, | ||
uint32_t | uart_baud_rate = 115200 |
||
) |
|
virtual |
Acknowledge interrupt.
Implements interruptable.
Definition at line 386 of file uartpp.cpp.
References channel.
Referenced by get_string(), and UART0_Handler().
void uart::atomic_printf | ( | const char * | pcString, |
... | |||
) |
Printf atomically over uart.
Definition at line 348 of file uartpp.cpp.
References critical::EndCritical(), critical::StartCritical(), and vprintf().
Referenced by shell::backspace(), can_handler(), shell::execute_command(), shell::print_ps1(), thread_uart_update(), and shell::type().
char uart::get_char | ( | void | ) |
Receive a char.
Definition at line 381 of file uartpp.cpp.
References channel.
Referenced by get_string(), and UART0_Handler().
char * uart::get_string | ( | const uint32_t | length | ) |
Receive a string of LENGTH characters.
Definition at line 394 of file uartpp.cpp.
References ack(), buffer, channel, and get_char().
void uart::printf | ( | const char * | pcString, |
... | |||
) |
Printf over uart.
Definition at line 360 of file uartpp.cpp.
References vprintf().
Referenced by can_handler(), can_transmitter(), ping_handler(), timer_updater(), and uart().
void uart::send_char | ( | const char | ch | ) |
Send a char.
Definition at line 371 of file uartpp.cpp.
References channel.
Referenced by send_string().
void uart::send_newline | ( | void | ) |
Send a newline and carriage return;
Definition at line 376 of file uartpp.cpp.
References send_string().
void uart::send_string | ( | const char * | str | ) |
Send a string.
Definition at line 49 of file uartpp.cpp.
References channel, send_char(), and ustrlen().
Referenced by send_newline().
|
virtual |
Enable the uart.
Implements interruptable.
Definition at line 408 of file uartpp.cpp.
References channel, and interrupt.
Referenced by uart().
|
virtual |
Disable the uart.
Implements interruptable.
Definition at line 414 of file uartpp.cpp.
References channel, and interrupt.
|
private |
Definition at line 122 of file uartpp.cpp.
References channel, g_pcHex, and UARTwrite().
Referenced by atomic_printf(), and printf().
|
private |
Definition at line 30 of file uartpp.hpp.
Referenced by uart().
char uart::buffer[UART_DEFAULT_MAX_GET_STRING_LENGTH] |
Definition at line 40 of file uartpp.hpp.
Referenced by get_string().
|
private |
Definition at line 31 of file uartpp.hpp.
Referenced by ack(), get_char(), get_string(), send_char(), send_string(), start(), stop(), uart(), and vprintf().
|
private |
Definition at line 32 of file uartpp.hpp.
|
static |
Flag for proper handling of newlines input from terminal.
Definition at line 38 of file uartpp.hpp.
Referenced by UART0_Handler().