Definition in file uart.c.
#include <ioavr.h>
#include "global.h"
#include "uart.h"
#include "sm_driver.h"
#include "speed_cntr.h"
Include dependency graph for uart.c:
Go to the source code of this file.
Defines | |
#define | BAUD 11 |
Functions | |
void | InitUART (void) |
Init of uart. | |
void | uart_FlushRxBuffer (void) |
Empties the uart RX buffer. | |
__interrupt void | UART_RX_interrupt (void) |
RX interrupt handler. | |
void | uart_SendByte (unsigned char data) |
send a byte. | |
void | uart_SendInt (int x) |
Sends a integer. | |
void | uart_SendString (unsigned char Str[]) |
Sends a string. | |
__interrupt void | UART_TX_interrupt (void) |
TX interrupt handler. | |
Variables | |
unsigned char | UART_RxBuffer [UART_RX_BUFFER_SIZE] |
Buffer with received string from uart. | |
unsigned char | UART_RxPtr |
RX buffer pointer. |
|
Referenced by InitUART(). |
|
Init of uart. Setup uart. The BAUD value must be modified according to clock frqequency. Refer to datasheet for details. Definition at line 45 of file uart.c. References BAUD, and UART_RxPtr. Referenced by Init().
|
|
Empties the uart RX buffer. Empties the uart RX buffer.
Definition at line 135 of file uart.c. References UART_RxBuffer, and UART_RxPtr. Referenced by main().
|
|
RX interrupt handler. RX interrupt handler. RX interrupt always enabled. Definition at line 146 of file uart.c. References GLOBAL_FLAGS::cmd, FALSE, GLOBAL_FLAGS::running, status, TRUE, UART_RX_BUFFER_SIZE, UART_RxBuffer, UART_RxPtr, and uart_SendByte().
Here is the call graph for this function: ![]() |
|
send a byte. Puts a byte in TX buffer and starts uart TX interrupt. If TX buffer is full it will hang until space.
Definition at line 73 of file uart.c. References SET_UDRIE, and UART_TX_BUFFER_MASK. Referenced by ShowHelp(), UART_RX_interrupt(), uart_SendInt(), and uart_SendString().
|
|
Sends a integer. Converts a integer to ASCII and sends it using uart_SendByte. If TX buffer is full it will hang until space.
Definition at line 111 of file uart.c. References uart_SendByte(). Referenced by ShowData().
Here is the call graph for this function: ![]() |
|
Sends a string. Loops thru a string and send each byte with uart_SendByte. If TX buffer is full it will hang until space.
Definition at line 97 of file uart.c. References uart_SendByte(). Referenced by main(), and ShowData().
Here is the call graph for this function: ![]() |
|
TX interrupt handler. TX interrupt handler. TX interrupt turned on by uart_SendByte, turned off when TX buffer is empty. Definition at line 200 of file uart.c. References CLR_UDRIE, and UART_TX_BUFFER_MASK.
|
|
Buffer with received string from uart.
Definition at line 27 of file uart.c. Referenced by main(), uart_FlushRxBuffer(), and UART_RX_interrupt(). |
|
RX buffer pointer.
Definition at line 29 of file uart.c. Referenced by InitUART(), uart_FlushRxBuffer(), and UART_RX_interrupt(). |