uart.c File Reference

Handles the control of the USART for communication with the ATmega1284p for sending commands. More...

#include "uart.h"
#include "lcd.h"
#include "main.h"
#include "menu.h"
#include "beep.h"

Go to the source code of this file.

Functions

void uart_init_circ_buf (tcirc_buf *cbuf)
 This will intialize the circular buffer head and tail of tcirc_buf struct.
void uart_add_to_circ_buf (tcirc_buf *cbuf, uint8_t ch)
 This will add a new character to the circular buffer.
uint8_t uart_get_from_circ_buf (tcirc_buf *cbuf)
 This will get a character from the buffer requested.
void uart_clear_rx_buf (void)
 This will clear the RX buffer.
uint8_t uart_circ_buf_has_char (tcirc_buf *cbuf)
 This will check for a character in the requested buffer.
uint8_t uip_ntohex (uint8_t val)
 This will convert a nibble to a hex value.
void itohex (uint8_t val, char *str)
 Convert integer to hex value.
uint8_t uart_get_char_rx (void)
 This will wait for a new character from the ATmega1284p and timeout if no new character is received.
void uart_init (void)
 Initialize UART to 38400 Baud Rate and only enable UART for transmission.
void uart_deinit (void)
 Turn off UART for sleep mode.
void uart_send_byte (uint8_t byte)
 Send one byte over the uart.
 ISR (USART_RX_vect)
 This is the USART RX complete interrupt.
void uart_serial_send_frame (uint8_t cmd, uint8_t payload_length, uint8_t *payload)
 This function builds and sends a binary command frame to the ATmega1284p.
void uart_timeout_msg (uint8_t x)
 This displays a time out message to the user based on the parameter reason x.
void uart_serial_rcv_frame (uint8_t wait_for_ack)
 This will receive a frame from the ATmega1284p and parse the incoming data.

Variables

tcirc_buf rxbuf
 The RX circular buffer, for storing characters from serial port.

Detailed Description

Handles the control of the USART for communication with the ATmega1284p for sending commands.

Author:
Mike Vidales mavida404@gmail.com

Definition in file uart.c.


Generated on Mon Apr 11 14:23:49 2011 for Contiki 2.5 by  doxygen 1.6.1