Open Sint
3.4-2
|
Serial I/O. More...
Go to the source code of this file.
Data Structures | |
struct | uartStruct |
Macros | |
#define | UART0_BAUD 9600 |
#define | UART0_RXBUF_SIZE 64 |
#define | UART0_TXBUF_SIZE 64 |
#define | UART0_RXBUF_MASK ( UART0_RXBUF_SIZE - 1 ) |
#define | UART0_TXBUF_MASK ( UART0_TXBUF_SIZE - 1 ) |
#define | TRUE 1 |
#define | FALSE 0 |
Functions | |
struct uartStruct * | uart_init (const uint8_t port) |
void | uart_shutdown (const uint8_t port) |
shutdown the usart port. | |
void | uart_get_msg (const uint8_t port, char *s) |
void | uart_putchar (const uint8_t port, const char c) |
void | uart_printstr (const uint8_t port, const char *s) |
Variables | |
volatile struct uartStruct * | uartPtr |
Serial I/O.
#define UART0_BAUD 9600 |
UART 0 baud rate
#define UART0_RXBUF_MASK ( UART0_RXBUF_SIZE - 1 ) |
RX buffers mask, used to check the proper size and if we are going out of size.
#define UART0_RXBUF_SIZE 64 |
RX buffers size
#define UART0_TXBUF_MASK ( UART0_TXBUF_SIZE - 1 ) |
TX buffers mask.
#define UART0_TXBUF_SIZE 64 |
TX buffers size
void uart_get_msg | ( | const uint8_t | port, |
char * | s | ||
) |
get the message from the RX buffer.
port the serial port. s the string to copy the message to.
multiport not implemented.
this function should be atomic, cannot be interrupted while resetting the pointer.
void uart_printstr | ( | const uint8_t | port, |
const char * | s | ||
) |
Send a C (NUL-terminated) string to the serial port.
port the serial port. s the string to send.
void uart_putchar | ( | const uint8_t | port, |
const char | c | ||
) |
Send character c to the serial port, wait until tx holding register is empty.
port the serial port. c the char to send.
volatile struct uartStruct* uartPtr |
Global UART rxtx buffers pointer used inside the ISR routine.