Contiki 3.x
cc2430_rf.h
Go to the documentation of this file.
1 /**
2  * \file
3  * CC2430 RF driver header file
4  * \author
5  * Zach Shelby <zach@sensinode.com>
6  */
7 
8 #ifndef CC2430_RF_H_
9 #define CC2430_RF_H_
10 
11 #include "contiki.h"
12 #include "dev/radio.h"
13 #include "cc2430_sfr.h"
14 #if HAVE_RF_DMA
15 #include "dev/dma.h"
16 #endif
17 
18 /* Constants */
19 typedef enum rf_address_mode_t {
20  RF_DECODER_NONE = 0,
21  RF_DECODER_COORDINATOR,
22  RF_SOFTACK_MONITOR,
23  RF_MONITOR,
24  RF_SOFTACK_CLIENT,
25  RF_DECODER_ON
26 } rf_address_mode_t;
27 
28 /*CSP command set*/
29 #define SSTOP 0xDF
30 /*this is not a real command but a way of having rf_command
31  wait until the script is done*/
32 #define SSTART 0xDE
33 
34 #define SNOP 0xC0
35 #define STXCALN 0xC1
36 #define SRXON 0xC2
37 #define STXON 0xC3
38 #define STXONCCA 0xC4
39 #define SRFOFF 0xC5
40 #define SFLUSHRX 0xC6
41 #define SFLUSHTX 0xC7
42 #define SACK 0xC8
43 #define SACKPEND 0xC9
44 
45 #define ISTXCALN 0xE1
46 #define ISRXON 0xE2
47 #define ISTXON 0xE3
48 #define ISTXONCCA 0xE4
49 #define ISRFOFF 0xE5
50 #define ISFLUSHRX 0xE6
51 #define ISFLUSHTX 0xE7
52 #define ISACK 0xE8
53 #define ISACKPEND 0xE9
54 
55 #define ISSTOP 0xFF
56 #define ISSTART 0xFE
57 
58 #define MAC_IFS (1200/128)
59 
60 #define CC2430_MAX_PACKET_LEN 127
61 #define CC2430_MIN_PACKET_LEN 4
62 
63 #define CC2430_CCA_CLEAR 1
64 #define CC2430_CCA_BUSY 0
65 
66 #ifdef CC2430_CONF_RFERR_INTERRUPT
67 #define CC2430_RFERR_INTERRUPT CC2430_CONF_RFERR_INTERRUPT
68 #else
69 #define CC2430_RFERR_INTERRUPT 0
70 #endif
71 
72 extern const struct radio_driver cc2430_rf_driver;
73 
74 void cc2430_rf_command(uint8_t command);
75 int8_t cc2430_rf_channel_set(uint8_t channel);
76 uint8_t cc2430_rf_channel_get();
77 uint8_t cc2430_rf_power_set(uint8_t new_power);
78 void cc2430_rf_set_addr(unsigned pan, unsigned addr, const uint8_t *ieee_addr);
79 
80 #if !NETSTACK_CONF_SHORTCUTS
81 extern void cc2430_rf_ISR(void) __interrupt(RF_VECTOR);
82 #endif
83 #if CC2430_RFERR_INTERRUPT
84 extern void cc2430_rf_error_ISR(void) __interrupt(RFERR_VECTOR);
85 #endif
86 
87 #ifdef HAVE_RF_DMA
88 void rf_dma_callback_isr(void);
89 #endif
90 
91 #endif /* CC2430_RF_H_ */
CC2430 registers header file for CC2430.
Header file for the radio API
int8_t cc2430_rf_channel_set(uint8_t channel)
Select RF channel.
Definition: cc2430_rf.c:180
The structure of a device driver for a radio in Contiki.
Definition: radio.h:225
uint8_t cc2430_rf_power_set(uint8_t new_power)
Select RF transmit power.
Definition: cc2430_rf.c:219
void cc2430_rf_ISR(void) __interrupt(RF_VECTOR)
RF interrupt service routine.
void cc2430_rf_command(uint8_t command)
Execute a single CSP command.
Definition: cc2430_rf.c:122
void cc2430_rf_set_addr(unsigned pan, unsigned addr, const uint8_t *ieee_addr)
Set MAC addresses.
Definition: cc2430_rf.c:252