uart_bdr.h

Go to the documentation of this file.
00001 /*H**************************************************************************
00002 * $RCSfile: uart_bdr.h,v $
00003 *----------------------------------------------------------------------------
00004 * Copyright (c) 2003 Atmel.
00005 *----------------------------------------------------------------------------
00006 * RELEASE:      $Name: mc100_bldc_sinus_1_0_0 $
00007 * REVISION:     $Revision: 1.1 $
00008 * FILE_CVSID:   $Id: uart_bdr.h,v 1.1 2008/09/16 15:49:06 raubree Exp $
00009 *----------------------------------------------------------------------------
00010 * PURPOSE:
00011 * Provide Baudrate configuration for MCU
00012 *****************************************************************************/
00013 #ifndef _UART_BDR_H
00014 #define _UART_BDR_H
00015  
00016 #ifndef __GNUC__
00017    #define Uart_set_baudrate(bdr)  ( UBRRH = (Uchar)((((Uint32)FOSC*1000L)/((Uint32)bdr*16)-1)>>8),\
00018                                   UBRRL = (Uchar)(((Uint32)FOSC*1000 )/((Uint32)bdr*16)-1)    )
00019 #else
00020   #define Uart_set_baudrate(bdr)  ( UBRR = (U16)(((U32)FOSC*1000L)/((U32)bdr*16)-1))
00021 #endif
00022 
00023 #define Uart_double_bdr()          (UCSRA |= (1<<U2X1))
00024 
00025 #endif/* _UART_BDR_H */
00026 

Generated on Tue Sep 16 18:11:19 2008 for Atmel BLDC Sinusoidal on ATAVRMC100 by  doxygen 1.5.3