Contiki 2.6

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...

Defines

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

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.
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.
void uart_send_byte (uint8_t byte)
 Send one byte over the uart.
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_serial_rcv_frame (uint8_t wait_for_it)
 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.h.


Define 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().