Contiki 2.6
|
00001 #ifndef UART_1_H 00002 #define UART_1_H 00003 00004 #include "contiki-conf.h" 00005 00006 #include "cc253x.h" 00007 #include "8051def.h" 00008 #include "uart.h" 00009 00010 /*---------------------------------------------------------------------------*/ 00011 /* UART1 Enable - Disable */ 00012 #ifdef UART1_CONF_ENABLE 00013 #define UART1_ENABLE UART1_CONF_ENABLE 00014 #else 00015 #define UART1_ENABLE 0 00016 #endif 00017 /*---------------------------------------------------------------------------*/ 00018 /* UART1 Function Declarations */ 00019 #if UART1_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 UART1_CONF_WITH_INPUT 00025 void uart1_rx_isr( void ) __interrupt (URX1_VECTOR); 00026 /* Macro to turn on / off UART RX Interrupt */ 00027 #define UART1_RX_INT(v) do { URX1IE = v; } while(0) 00028 #else 00029 #define UART1_RX_INT(v) 00030 #endif /* UART1_CONF_WITH_INPUT */ 00031 #else 00032 #define uart1_init(...) 00033 #define uart1_writeb(...) 00034 #define uart1_set_input(...) 00035 #define UART1_RX_INT(v) 00036 #endif /* UART1_ENABLE */ 00037 00038 #endif /* UART_1_H */