Contiki 2.5
uart.c
Go to the documentation of this file.
1 /**
2  * \file
3  *
4  * uart write routines
5  *
6  * \author
7  *
8  * Anthony "Asterisk" Ambuehl
9  *
10  * non-interrupt routines which may be called from ISR's and therefore should be in HOME bank.
11  *
12  */
13 #include <stdlib.h>
14 #include <string.h>
15 
16 #include "cc2430_sfr.h"
17 
18 #include "dev/leds.h"
19 #include "dev/uart.h"
20 
21 /*---------------------------------------------------------------------------*/
22 /* Write one byte over the UART. */
23 void
24 uart0_writeb(uint8_t byte)
25 {
26  IRCON2_UTX0IF = 0;
27  U0BUF = byte;
28  while(!IRCON2_UTX0IF); /* Wait until byte has been transmitted. */
29  IRCON2_UTX0IF = 0;
30 }
31 /*---------------------------------------------------------------------------*/
32 /* Write one byte over the UART. */
33 void
34 uart1_writeb(uint8_t byte)
35 {
36  IRCON2_UTX1IF = 0;
37  U1BUF = byte;
38  while(!IRCON2_UTX1IF); /* Wait until byte has been transmitted. */
39  IRCON2_UTX1IF = 0;
40 }
41 /*---------------------------------------------------------------------------*/