Contiki 2.6
|
00001 /** 00002 * \file 00003 * CC2430 RF driver header file 00004 * \author 00005 * Zach Shelby <zach@sensinode.com> 00006 */ 00007 00008 #ifndef __CC2430_RF_H__ 00009 #define __CC2430_RF_H__ 00010 00011 #include "contiki.h" 00012 #include "dev/radio.h" 00013 #include "cc2430_sfr.h" 00014 #if HAVE_RF_DMA 00015 #include "dev/dma.h" 00016 #endif 00017 00018 /* Constants */ 00019 typedef enum rf_address_mode_t 00020 { 00021 RF_DECODER_NONE = 0, 00022 RF_DECODER_COORDINATOR, 00023 RF_SOFTACK_MONITOR, 00024 RF_MONITOR, 00025 RF_SOFTACK_CLIENT, 00026 RF_DECODER_ON 00027 }rf_address_mode_t; 00028 00029 /*CSP command set*/ 00030 #define SSTOP 0xDF 00031 /*this is not a real command but a way of having rf_command 00032 wait until the script is done*/ 00033 #define SSTART 0xDE 00034 00035 #define SNOP 0xC0 00036 #define STXCALN 0xC1 00037 #define SRXON 0xC2 00038 #define STXON 0xC3 00039 #define STXONCCA 0xC4 00040 #define SRFOFF 0xC5 00041 #define SFLUSHRX 0xC6 00042 #define SFLUSHTX 0xC7 00043 #define SACK 0xC8 00044 #define SACKPEND 0xC9 00045 00046 #define ISTXCALN 0xE1 00047 #define ISRXON 0xE2 00048 #define ISTXON 0xE3 00049 #define ISTXONCCA 0xE4 00050 #define ISRFOFF 0xE5 00051 #define ISFLUSHRX 0xE6 00052 #define ISFLUSHTX 0xE7 00053 #define ISACK 0xE8 00054 #define ISACKPEND 0xE9 00055 00056 #define ISSTOP 0xFF 00057 #define ISSTART 0xFE 00058 00059 #define MAC_IFS (1200/128) 00060 00061 #define CC2430_MAX_PACKET_LEN 127 00062 #define CC2430_MIN_PACKET_LEN 4 00063 00064 #define CC2430_CCA_CLEAR 1 00065 #define CC2430_CCA_BUSY 0 00066 00067 #ifdef CC2430_CONF_RFERR_INTERRUPT 00068 #define CC2430_RFERR_INTERRUPT CC2430_CONF_RFERR_INTERRUPT 00069 #else 00070 #define CC2430_RFERR_INTERRUPT 0 00071 #endif 00072 00073 extern const struct radio_driver cc2430_rf_driver; 00074 00075 void cc2430_rf_command(uint8_t command); 00076 int8_t cc2430_rf_channel_set(uint8_t channel); 00077 uint8_t cc2430_rf_channel_get(); 00078 uint8_t cc2430_rf_power_set(uint8_t new_power); 00079 void cc2430_rf_set_addr(unsigned pan, unsigned addr, const uint8_t *ieee_addr); 00080 00081 #if !NETSTACK_CONF_SHORTCUTS 00082 extern void cc2430_rf_ISR( void ) __interrupt (RF_VECTOR); 00083 #endif 00084 #if CC2430_RFERR_INTERRUPT 00085 extern void cc2430_rf_error_ISR( void ) __interrupt (RFERR_VECTOR); 00086 #endif 00087 00088 #ifdef HAVE_RF_DMA 00089 void rf_dma_callback_isr(void); 00090 #endif 00091 00092 #endif /* __CC2430_RF_H__ */