Contiki 2.6

uart1.h

00001 #ifndef UART_1_H
00002 #define UART_1_H
00003 
00004 #include "contiki-conf.h"
00005 
00006 #include "cc2430_sfr.h"
00007 #include "8051def.h"
00008 #include "uart.h"
00009 
00010 /*---------------------------------------------------------------------------*/
00011 /* UART1 Enable - Disable */
00012 #ifdef UART_ONE_CONF_ENABLE
00013 #define UART_ONE_ENABLE UART_ONE_CONF_ENABLE
00014 #else
00015 #define UART_ONE_ENABLE 0
00016 #endif
00017 /*---------------------------------------------------------------------------*/
00018 /* UART1 Function Declarations */
00019 #if UART_ONE_ENABLE
00020 void uart1_init();
00021 void uart1_writeb(uint8_t byte);
00022 
00023 void uart1_set_input(int (*input)(unsigned char c));
00024 #if UART_ONE_CONF_WITH_INPUT
00025 void uart1_rx_ISR( void ) __interrupt (URX1_VECTOR);
00026 void uart1_tx_ISR( void ) __interrupt (UTX1_VECTOR);
00027 /* Macro to turn on / off UART RX Interrupt */
00028 #define UART1_RX_INT(v) IEN0_URX1IE = v
00029 #else
00030 #define UART1_RX_INT(v)
00031 #endif /* UART_ONE_CONF_WITH_INPUT */
00032 #else
00033 #define uart1_init(...)
00034 #define uart1_writeb(...)
00035 #define uart1_set_input(...)
00036 #define UART1_RX_INT(v)
00037 #endif /* UART_ONE_ENABLE */
00038 
00039 #endif /* UART_1_H */