uart_bdr.h

Go to the documentation of this file.
00001 /*H**************************************************************************
00002 * NAME:         uart_bdr.h
00003 *----------------------------------------------------------------------------
00004 * Copyright (c) 2006 Atmel.
00005 *----------------------------------------------------------------------------
00006 * RELEASE:      at90usb162-cdc-1_0_1
00007 * REVISION:     1.5.2.3
00008 *----------------------------------------------------------------------------
00009 * PURPOSE:
00010 * Provide Baudrate configuration for MCU
00011 *****************************************************************************/
00012 #ifndef _UART_BDR_H
00013 #define _UART_BDR_H
00014 
00015 #ifndef AVRGCC
00016    #define Uart_set_baudrate(bdr)  ( UBRRH = (Uchar)((((Uint32)FOSC*1000L)/((Uint32)bdr*16)-1)>>8),\
00017                                   UBRRL = (Uchar)(((Uint32)FOSC*1000 )/((Uint32)bdr*16)-1)    )
00018 #else
00019   #define Uart_set_baudrate(bdr)  ( UBRR = (U16)(((U32)FOSC*1000L)/((U32)bdr*16)-1))
00020 #endif
00021 
00022 #define Uart_double_bdr()          (UCSRA |= (1<<U2X1))
00023 
00024 #endif/* _UART_BDR_H */
00025 

Generated on Fri Jun 15 14:15:32 2007 for Atmel by  doxygen 1.5.1-p1