Open Garden  0.10.1-21
Data Structures | Macros | Functions
uart.h File Reference

RS232 - IO functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uartStruct
 

Macros

#define UART_BAUD_0   9600
 
#define UART_BAUD_1   9600
 
#define UART_RXBUF_SIZE   64
 
#define UART_TXBUF_SIZE   64
 
#define UART_RXBUF_MASK   ( UART_RXBUF_SIZE - 1 )
 
#define UART_TXBUF_MASK   ( UART_TXBUF_SIZE - 1 )
 

Functions

void uart_init (const uint8_t port)
 
void uart_shutdown (const uint8_t port)
 
char uart_getchar (const uint8_t port, const uint8_t locked)
 
void uart_putchar (const uint8_t port, const char c)
 
void uart_printstr (const uint8_t port, const char *s)
 

Detailed Description

RS232 - IO functions.

Macro Definition Documentation

◆ UART_BAUD_0

#define UART_BAUD_0   9600

UART 0 baud rate

◆ UART_BAUD_1

#define UART_BAUD_1   9600

UART 1 baud rate

◆ UART_RXBUF_MASK

#define UART_RXBUF_MASK   ( UART_RXBUF_SIZE - 1 )

IO Buffers and masks

◆ UART_RXBUF_SIZE

#define UART_RXBUF_SIZE   64

IO Buffers and masks

◆ UART_TXBUF_MASK

#define UART_TXBUF_MASK   ( UART_TXBUF_SIZE - 1 )

IO Buffers and masks

◆ UART_TXBUF_SIZE

#define UART_TXBUF_SIZE   64

IO Buffers and masks

Function Documentation

◆ uart_getchar()

char uart_getchar ( const uint8_t  port,
const uint8_t  locked 
)

Get a char from the uart port.

◆ uart_init()

void uart_init ( const uint8_t  port)

Init the uart port.

tx/rx enable

tx/rx enable

◆ uart_printstr()

void uart_printstr ( const uint8_t  port,
const char *  s 
)

Send a C (NUL-terminated) string down the UART Tx.

◆ uart_putchar()

void uart_putchar ( const uint8_t  port,
const char  c 
)

Send character c down the UART Tx, wait until tx holding register is empty.

◆ uart_shutdown()

void uart_shutdown ( const uint8_t  port)

Disable the uart port.