Contiki 2.5
Data Structures | Functions | Variables
uart.h File Reference

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

#include <inttypes.h>

Go to the source code of this file.

Data Structures

struct  tcirc_buf
 Circular buffer structure. More...
 

Macros

ASCII characters defined
#define SOF_CHAR   (0x01)
 Start-of-frame character. More...
 
#define EOF_CHAR   (0x04)
 End-of-frame character. More...
 

Functions

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.
 
uint8_t uart_circ_buf_has_char (tcirc_buf *cbuf)
 This will check for a character in the requested buffer. More...
 
void uart_clear_rx_buf (void)
 This will clear the RX buffer.
 
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_send_byte (uint8_t byte)
 Send one byte over the uart. More...
 
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_serial_rcv_frame (uint8_t wait_for_it)
 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.h.

Macro Definition Documentation

#define EOF_CHAR   (0x04)

End-of-frame character.

Definition at line 50 of file uart.h.

Referenced by uart_serial_rcv_frame(), and uart_serial_send_frame().

#define SOF_CHAR   (0x01)

Start-of-frame character.

Definition at line 49 of file uart.h.

Referenced by uart_serial_rcv_frame(), and uart_serial_send_frame().