39 #include "dev/uart0.h"
40 #include "dev/watchdog.h"
41 #include "isr_compat.h"
43 static int (*uart0_input_handler)(
unsigned char c);
57 uart0_input_handler =
input;
61 uart0_writeb(
unsigned char c)
65 while((UCA0STAT & UCBUSY));
82 ubr = (MSP430_CPU_SPEED / ubr);
84 UCA0BR1 = (ubr >> 8) & 0xff;
102 ISR(USCI_A0, uart0_rx_interrupt)
106 ENERGEST_ON(ENERGEST_TYPE_IRQ);
108 if(UCA0STAT & UCRXERR) {
112 if(uart0_input_handler !=
NULL) {
113 if(uart0_input_handler(c)) {
119 ENERGEST_OFF(ENERGEST_TYPE_IRQ);
void uart0_init(unsigned long ubr)
Initialize the RS232 port.
static void input(void)
Process a received 6lowpan packet.
Header file for the energy estimation mechanism
#define NULL
The null pointer.
static uint8_t transmitting(void)
Check the RF's TX status.
void watchdog_periodic(void)
Writes the WDT clear sequence.
void uart0_set_input(int(*input)(unsigned char c))