Contiki 2.5
Functions | Variables
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. More...
 
void uart_add_to_circ_buf (tcirc_buf *cbuf, uint8_t ch)
 This will add a new character to the circular buffer. More...
 
uint8_t uart_get_from_circ_buf (tcirc_buf *cbuf)
 This will get a character from the buffer requested. More...
 
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. More...
 
uint8_t uip_ntohex (uint8_t val)
 This will convert a nibble to a hex value. More...
 
void itohex (uint8_t val, char *str)
 Convert integer to hex value. More...
 
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. More...
 
void uart_init (void)
 Initialize UART to 38400 Baud Rate and only enable UART for transmission. More...
 
void uart_deinit (void)
 Turn off UART for sleep mode.
 
void uart_send_byte (uint8_t byte)
 Send one byte over the uart. More...
 
 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. More...
 
void uart_timeout_msg (uint8_t x)
 This displays a time out message to the user based on the parameter reason x. More...
 
void uart_serial_rcv_frame (uint8_t wait_for_ack)
 This will receive a frame from the ATmega1284p and parse the incoming data. More...
 

Variables

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

Detailed Description

 Handles the control of the USART for communication with the ATmega1284p
 for sending commands.
Author
Mike Vidales mavid.nosp@m.a404.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Definition in file uart.c.