Serial.h File Reference

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <stdbool.h>
#include "../../Common/Common.h"
#include "../Misc/TerminalCodes.h"

Defines

#define Serial_IsCharRecieved()   ((UCSR1A & (1 << RXC1)) ? true : false)
#define SERIAL_UBBRVAL(baud)   (((F_CPU / 16) / baud) - 1)
#define SERIAL_2X_UBBRVAL(baud)   (((F_CPU / 8) / baud) - 1)

Functions

void Serial_Init (const uint16_t BaudRate)
void Serial_TxString_P (const char *FlashStringPtr) ATTR_NON_NULL_PTR_ARG(1)
void Serial_TxString (const char *StringPtr) ATTR_NON_NULL_PTR_ARG(1)
static void Serial_TxByte (const char DataByte)
static char Serial_RxByte (void)

Detailed Description

Driver for the USART subsystem on supported USB AVRs.

Define Documentation

#define SERIAL_2X_UBBRVAL ( baud   )     (((F_CPU / 8) / baud) - 1)

Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is set.

 
#define Serial_IsCharRecieved (  )     ((UCSR1A & (1 << RXC1)) ? true : false)

Indicates whether a character has been received through the USART - boolean false if no character has been received, or non-zero if a character is waiting to be read from the reception buffer.

#define SERIAL_UBBRVAL ( baud   )     (((F_CPU / 16) / baud) - 1)

Macro for calculating the baud value from a given baud rate when the U2X (double speed) bit is not set.


Function Documentation

void Serial_Init ( const uint16_t  BaudRate  ) 

Initializes the USART, ready for serial data transmission and reception.

Parameters:
BaudRate Baud rate to configure the USART at

static char Serial_RxByte ( void   )  [inline, static]

Receives a byte from the USART.

Returns:
Byte received from the USART

static void Serial_TxByte ( const char  DataByte  )  [inline, static]

Transmits a given byte through the USART.

Parameters:
DataByte Byte to transmit through the USART

void Serial_TxString ( const char *  StringPtr  ) 

Transmits a given string located in SRAM memory through the USART.

Parameters:
StringPtr Pointer to a string located in SRAM space

void Serial_TxString_P ( const char *  FlashStringPtr  ) 

Transmits a given string located in program space (FLASH) through the USART.

Parameters:
FlashStringPtr Pointer to a string located in program space


Generated on Thu Oct 2 18:01:18 2008 for MyUSB Library by  doxygen 1.5.5