uart.c

Go to the documentation of this file.
00001 /**
00002  * \file
00003  *
00004  *   uart write routines
00005  *
00006  * \author
00007  * 
00008  *   Anthony "Asterisk" Ambuehl
00009  *
00010  *   non-interrupt routines which may be called from ISR's and therefore should be in HOME bank.
00011  *
00012  */
00013 #include <stdlib.h>
00014 #include <string.h>
00015 
00016 #include "cc2430_sfr.h"
00017 
00018 #include "dev/leds.h"
00019 #include "dev/uart.h"
00020 
00021 /*---------------------------------------------------------------------------*/
00022 /* Write one byte over the UART. */
00023 void
00024 uart0_writeb(uint8_t byte)
00025 {
00026   IRCON2_UTX0IF = 0;
00027   U0BUF = byte;
00028   while(!IRCON2_UTX0IF); /* Wait until byte has been transmitted. */
00029   IRCON2_UTX0IF = 0;
00030 }
00031 /*---------------------------------------------------------------------------*/
00032 /* Write one byte over the UART. */
00033 void
00034 uart1_writeb(uint8_t byte)
00035 {
00036   IRCON2_UTX1IF = 0;
00037   U1BUF = byte;
00038   while(!IRCON2_UTX1IF); /* Wait until byte has been transmitted. */
00039   IRCON2_UTX1IF = 0;
00040 }
00041 /*---------------------------------------------------------------------------*/

Generated on Mon Apr 11 14:23:38 2011 for Contiki 2.5 by  doxygen 1.6.1