Contiki 3.x
uart0.h
1 #ifndef UART_0_H
2 #define UART_0_H
3 
4 #include "contiki-conf.h"
5 
6 #include "cc253x.h"
7 #include "8051def.h"
8 #include "uart.h"
9 
10 /*---------------------------------------------------------------------------*/
11 /* UART0 Enable - Disable */
12 #ifdef UART0_CONF_ENABLE
13 #define UART0_ENABLE UART0_CONF_ENABLE
14 #else
15 #define UART0_ENABLE 0
16 #endif
17 /*---------------------------------------------------------------------------*/
18 /* UART0 Function Declarations */
19 #if UART0_ENABLE
20 void uart0_init();
21 void uart0_writeb(uint8_t byte);
22 
23 void uart0_set_input(int (* input)(unsigned char c));
24 
25 #if UART0_CONF_WITH_INPUT
26 void uart0_rx_isr(void) __interrupt(URX0_VECTOR);
27 /* Macro to turn on / off UART RX Interrupt */
28 #define UART0_RX_INT(v) do { URX0IE = v; } while(0)
29 #define UART0_RX_EN() do { U0CSR |= UCSR_RE; } while(0)
30 #else
31 #define UART0_RX_INT(v)
32 #define UART0_RX_EN()
33 #endif /* UART0_CONF_WITH_INPUT */
34 #else
35 #define uart0_init(...)
36 #define uart0_writeb(...)
37 #define uart0_set_input(...)
38 #define UART0_RX_INT(v)
39 #define UART0_RX_EN()
40 #endif /* UART0_ENABLE */
41 #endif /* UART_0_H */
void uart0_init(unsigned long ubr)
Initalize the RS232 port.
Definition: uart0.c:111
Definitions for TI/Chipcon cc2530, cc2531 and cc2533 SFR registers.