diff --git a/.gitignore b/.gitignore index 7b0464eeff..551398b967 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ Debug settings *.dep +*.ewd +*.ewt +*.bak *.sfr *.o *.exe @@ -24,3 +27,5 @@ settings /projects/telosb/01bsp_uart/path.txt /projects/telosb/03oos_macpong/path.txt /projects/telosb/02drv_opentimers/path.txt +/projects/openmote-b/01bsp_openradio_rx/log.txt +/projects/openmote-b/01bsp_radio_tx/asm.s diff --git a/bootloader/openmote-cc2538/ot_program.py b/bootloader/openmote-cc2538/ot_program.py index 5f66b7481f..24acfa920e 100644 --- a/bootloader/openmote-cc2538/ot_program.py +++ b/bootloader/openmote-cc2538/ot_program.py @@ -10,6 +10,105 @@ #============================ defines ========================================= BROKER_ADDRESS = "argus.paris.inria.fr" NUMBER_OF_MOTES = 80 - 4 # 4 motes are used for local test +BOOT_MODE = "default" #"default" or "subset" + +# subset used for 10% disturbance experiments +mote_subset1 = [ +"00-12-4b-00-14-b5-b5-95" +] + +# subset used for 10% disturbance experiments +#mote_subset = [ +#"00-12-4b-00-14-b5-b5-8c", +#"00-12-4b-00-14-b5-b6-02", +#"00-12-4b-00-14-b5-b5-7e", +#"00-12-4b-00-14-b5-b6-1c" +#] +temp_subset=[ +"00-12-4b-00-14-b5-b6-46", +"00-12-4b-00-14-b5-b6-1c", +"00-12-4b-00-14-b5-b5-57", +"00-12-4b-00-14-b5-b5-58", +"00-12-4b-00-14-b5-b5-a3", +"00-12-4b-00-14-b5-b6-3a", +"00-12-4b-00-14-b5-b6-18", +"00-12-4b-00-14-b5-b5-8c", +"00-12-4b-00-14-b5-b5-71", +"00-12-4b-00-14-b5-b6-12" + +] +# subset used for 50% density experiments +#mote_subset = [ +#"00-12-4b-00-14-b5-b4-8d", +#"00-12-4b-00-14-b5-b5-71", +#"00-12-4b-00-14-b5-b5-b5", +#"00-12-4b-00-14-b5-b5-93", +#"00-12-4b-00-14-b5-b5-a3", +#"00-12-4b-00-14-b5-b6-02", +#"00-12-4b-00-14-b5-b6-05", +#"00-12-4b-00-14-b5-b6-1c", +#"00-12-4b-00-14-b5-b5-a9", +#"00-12-4b-00-14-b5-b5-88", +#"00-12-4b-00-14-b5-b4-62", +#"00-12-4b-00-14-b5-b6-22", +#"00-12-4b-00-14-b5-b5-63", +#"00-12-4b-00-14-b5-b6-0b", +#"00-12-4b-00-14-b5-b6-40", +#"00-12-4b-00-14-b5-b5-d8", +#"00-12-4b-00-14-b5-b6-12", +#"00-12-4b-00-14-b5-b6-18", +#"00-12-4b-00-14-b5-b6-3a", +#"00-12-4b-00-14-b5-b5-57", +#"00-12-4b-00-14-b5-b6-48" +#] + +# motes in building a +mote_subset2 = [ +"00-12-4b-00-14-b5-b5-95", +"00-12-4b-00-14-b5-b5-d8", +"00-12-4b-00-14-b5-b4-8d", +"00-12-4b-00-14-b5-b6-22", +"00-12-4b-00-14-b5-b6-40", +"00-12-4b-00-14-b5-b6-29", +"00-12-4b-00-14-b5-b6-46", +"00-12-4b-00-14-b5-b6-47", +"00-12-4b-00-14-b5-b6-02", +"00-12-4b-00-14-b5-b6-1c", +"00-12-4b-00-14-b5-b6-1a", +"00-12-4b-00-14-b5-b5-e7", +"00-12-4b-00-14-b5-b4-62", +"00-12-4b-00-14-b5-b4-98", +"00-12-4b-00-14-b5-b5-a9", +"00-12-4b-00-14-b5-b5-57", +"00-12-4b-00-14-b5-b5-58", +"00-12-4b-00-14-b5-b5-88", +"00-12-4b-00-14-b5-b5-3d", +"00-12-4b-00-14-b5-b5-a3", +"00-12-4b-00-14-b5-b4-aa", +"00-12-4b-00-14-b5-b5-5b", +"00-12-4b-00-14-b5-b6-48", +"00-12-4b-00-14-b5-b5-7e", +"00-12-4b-00-14-b5-b6-3a", +"00-12-4b-00-14-b5-b6-38", +"00-12-4b-00-14-b5-b5-93", +"00-12-4b-00-14-b5-b6-18", +"00-12-4b-00-14-b5-b5-b5", +"00-12-4b-00-14-b5-b5-f8", +"00-12-4b-00-14-b5-b5-b7", +"00-12-4b-00-14-b5-b5-8c", +"00-12-4b-00-14-b5-b6-0b", +"00-12-4b-00-14-b5-b5-f1", +"00-12-4b-00-14-b5-b5-f3", +"00-12-4b-00-14-b5-b5-f2", +"00-12-4b-00-14-b5-b5-bf", +"00-12-4b-00-14-b5-b6-05", +"00-12-4b-00-14-b5-b5-63", +"00-12-4b-00-14-b5-b5-71", +"00-12-4b-00-14-b5-b5-65", +"00-12-4b-00-14-b5-b6-12" +] + +mote_subset = temp_subset #============================ classes ========================================= class program_over_testbed(object): @@ -18,14 +117,15 @@ class program_over_testbed(object): CMD = 'program' # in seconds, should be larger than the time starting from publishing message until receiving the response - MESSAGE_RESP_TIMEOUT = 30 + MESSAGE_RESP_TIMEOUT = 50 def __init__(self, mote, image_path): # initialize parameters + #self.mote = mote self.mote = mote self.image = None - + print "\tprogramming: {0}".format(mote) # check bootload backdoor is configured correctly bootloader_backdoor_enabled = False @@ -66,10 +166,6 @@ def __init__(self, mote, image_path): 'failed_messages_topic': [] } - # mqtt topic string format - self.mqtttopic_mote_cmd = 'opentestbed/deviceType/mote/deviceId/{0}/cmd/{1}'.format(self.mote,self.CMD) - self.mqtttopic_mote_resp = 'opentestbed/deviceType/mote/deviceId/{0}/resp/{1}'.format(self.mote,self.CMD) - # connect to MQTT self.mqttclient = mqtt.Client(self.CLIENT_ID) self.mqttclient.on_connect = self._on_mqtt_connect @@ -85,12 +181,33 @@ def __init__(self, mote, image_path): 'description': self.image_name, 'hex': self.image, } - # publish the cmd message - self.mqttclient.publish( - topic = self.mqtttopic_mote_cmd, - payload = json.dumps(payload_program_image), - ) - + if BOOT_MODE == 'default': + # mqtt topic string format + self.mqtttopic_mote_cmd = 'opentestbed/deviceType/mote/deviceId/{0}/cmd/{1}'.format(self.mote,self.CMD) + self.mqtttopic_mote_resp = 'opentestbed/deviceType/mote/deviceId/{0}/resp/{1}'.format(self.mote,self.CMD) + print "\tcmd: {}".format(self.mqtttopic_mote_cmd) + # publish the cmd message + self.mqttclient.publish( + topic = self.mqtttopic_mote_cmd, + payload = json.dumps(payload_program_image), + ) + elif BOOT_MODE == "subset": + i = 0 + for m in mote_subset: + # mqtt topic string format + self.mqtttopic_mote_cmd = 'opentestbed/deviceType/mote/deviceId/{0}/cmd/{1}'.format(m,self.CMD) + self.mqtttopic_mote_resp = 'opentestbed/deviceType/mote/deviceId/{0}/resp/{1}'.format(m,self.CMD) + print "\tcmd: {}".format(self.mqtttopic_mote_cmd) + self.mqttclient.publish( + topic = self.mqtttopic_mote_cmd, + payload = json.dumps(payload_program_image), + ) + # wait = random.randrange(60, 360, 1) # a random value beween 1 and 3 minutes + wait = 5 + time.sleep(wait) + i+=1 + if i%10==0: + time.sleep(5) try: # wait maxmium MESSAGE_RESP_TIMEOUT seconds before return self.cmd_response_success_queue.get(timeout=self.MESSAGE_RESP_TIMEOUT) @@ -118,7 +235,8 @@ def _on_mqtt_message(self, client, userdata, message): ''' Record the number of message received and success status ''' - + print userdata + print message self.response_success['message_counter'] += 1 if json.loads(message.payload)['success']: self.response_success['success_counter'] += 1 @@ -187,4 +305,4 @@ def usage(): raise Exception('No file path given.') #==== program_over_testbed - program_over_testbed(configure['mote_address'], configure['image_name_path']) \ No newline at end of file + program_over_testbed(configure['mote_address'], configure['image_name_path']) diff --git a/bsp/boards/board.h b/bsp/boards/board.h index a46a95ae17..29cd52e51d 100644 --- a/bsp/boards/board.h +++ b/bsp/boards/board.h @@ -16,25 +16,55 @@ #include "toolchain_defs.h" //=========================== define ========================================== +#define SLOTDURATION_MS board_getSlotDuration()/PORT_TICS_PER_MS typedef enum { DO_NOT_KICK_SCHEDULER = 0, KICK_SCHEDULER = 1, } kick_scheduler_t; + + //=========================== typedef ========================================= +typedef struct { + uint16_t slotDuration; + + // execution speed related + // also implementation related (e.g. SoC radio or spi-connected radio because of the time to load a packet to/from radio) + uint16_t maxTxDataPrepare; + uint16_t maxRxAckPrepare; + uint16_t maxRxDataPrepare; + uint16_t maxTxAckPrepare; + + // radio speed related + // also implementation related (because the time to execute the Tx/Rx command is highly dependent on the radio AND the configuration) + uint16_t delayTx; + uint16_t delayRx; +} slot_board_vars_t; //board specific slot vars + +// available slot templates +typedef enum{ + SLOT_10ms, + SLOT_20ms_24GHZ, + SLOT_40ms_24GHZ, + SLOT_40ms_FSK_SUBGHZ, + SLOT_40ms_OFDM1MCS0_3_SUBGHZ, + MAX_SLOT_TYPES, +} slotType_t; //=========================== variables ======================================= //=========================== prototypes ====================================== -void board_init(void); -void board_sleep(void); -void board_reset(void); - +void board_init(void); +void board_sleep(void); +void board_reset(void); +uint16_t board_getSlotDuration (void); +slot_board_vars_t board_selectSlotTemplate(slotType_t slot_type); /** \} \} */ - +//=========================== private ========================================= +void board_init_slot_vars(void); #endif diff --git a/bsp/boards/iot-lab_A8-M3/board.c b/bsp/boards/iot-lab_A8-M3/board.c index 29b8a060f9..2f1b7ae1b2 100644 --- a/bsp/boards/iot-lab_A8-M3/board.c +++ b/bsp/boards/iot-lab_A8-M3/board.c @@ -16,7 +16,10 @@ #include "nvic.h" #include "debugpins.h" -//=========================== variable ======================================== +//=========================== variables ======================================= + +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; //=========================== private ========================================= @@ -25,6 +28,8 @@ void GPIO_Config_ALL_AIN(void); // configure the hard fault exception void board_enableHardFaultExceptionHandler(void); + + //=========================== main ============================================ extern int mote_main(void); @@ -96,6 +101,35 @@ void board_init(void){ debugpins_init(); //enable nvic for the radio NVIC_radio(); + board_init_slot_vars(); +} + + +//==== bootstrapping slot info lookup table +void board_init_slot_vars(void){ + + // 20ms slot + slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // ms + slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 110 ; // 3355us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 20 ; // 610us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 33 ; // 1000us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 50 ; // 1525us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].delayTx = 18 ; // 549us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) +} + +// To get the current slotDuration at any time +// used during initialization by sixtop to fire the first sixtop EB +uint16_t board_getSlotDuration (void) +{ + return slot_board_vars [selected_slot_type].slotDuration; +} + +// Setter/Getter function for slot_board_vars +slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) +{ + selected_slot_type = slot_type; + return slot_board_vars [selected_slot_type]; } void board_sleep(void) { diff --git a/bsp/boards/iot-lab_A8-M3/board_info.h b/bsp/boards/iot-lab_A8-M3/board_info.h index 46b9db4c12..379933fc72 100644 --- a/bsp/boards/iot-lab_A8-M3/board_info.h +++ b/bsp/boards/iot-lab_A8-M3/board_info.h @@ -50,23 +50,6 @@ to return the board's description. #define PORT_PIN_RADIO_RESET_HIGH() //GPIOC->ODR |= 0X0040;// nothing #define PORT_PIN_RADIO_RESET_LOW() //GPIOC->ODR &= ~0X0040;// nothing -//===== IEEE802154E timing - -#define SLOTDURATION 20 // in miliseconds - -// time-slot related -#define PORT_TsSlotDuration 655 // 20ms - -// execution speed related -#define PORT_maxTxDataPrepare 110 // 3355us (not measured) -#define PORT_maxRxAckPrepare 20 // 610us (not measured) -#define PORT_maxRxDataPrepare 33 // 1000us (not measured) -#define PORT_maxTxAckPrepare 50 // 1525us (not measured) - -// radio speed related -#define PORT_delayTx 18 // 549us (not measured) -#define PORT_delayRx 0 // 0us (can not measure) -// radio watchdog //===== adaptive_sync accuracy diff --git a/bsp/boards/iot-lab_M3/board.c b/bsp/boards/iot-lab_M3/board.c index 1603716ef0..5c2b7e7d65 100644 --- a/bsp/boards/iot-lab_M3/board.c +++ b/bsp/boards/iot-lab_M3/board.c @@ -19,6 +19,11 @@ #include "gpio.h" #include "cryptoengine.h" + +//=========================== variables ======================================= +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; + //=========================== main ============================================ extern int mote_main(void); @@ -93,6 +98,35 @@ void board_init(void) //enable nvic for the radio NVIC_radio(); cryptoengine_init(); + board_init_slot_vars(); +} + + +//==== bootstrapping slot info lookup table +void board_init_slot_vars(void){ + + // 20ms slot + slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // ms + slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 110 ; // 3355us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 20 ; // 610us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 33 ; // 1000us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 50 ; // 1525us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].delayTx = 18 ; // 549us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) +} + +// To get the current slotDuration at any time +// used during initialization by sixtop to fire the first sixtop EB +uint16_t board_getSlotDuration (void) +{ + return slot_board_vars [selected_slot_type].slotDuration; +} + +// Setter/Getter function for slot_board_vars +slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) +{ + selected_slot_type = slot_type; + return slot_board_vars [selected_slot_type]; } void board_sleep(void) { diff --git a/bsp/boards/iot-lab_M3/board_info.h b/bsp/boards/iot-lab_M3/board_info.h index babbc4a216..36d3109adb 100644 --- a/bsp/boards/iot-lab_M3/board_info.h +++ b/bsp/boards/iot-lab_M3/board_info.h @@ -49,23 +49,6 @@ to return the board's description. #define PORT_PIN_RADIO_RESET_LOW() //GPIOC->ODR &= ~0X0040;// nothing //#define PORT_PIN_RADIO_RESET_LOW() GPIOC->ODR &= ~(1<<1); -//===== IEEE802154E timing - -#define SLOTDURATION 20 // in miliseconds - -// time-slot related -#define PORT_TsSlotDuration 655 // 20ms - -// execution speed related -#define PORT_maxTxDataPrepare 110 // 3355us (not measured) -#define PORT_maxRxAckPrepare 20 // 610us (not measured) -#define PORT_maxRxDataPrepare 33 // 1000us (not measured) -#define PORT_maxTxAckPrepare 50 // 1525us (not measured) - -// radio speed related -#define PORT_delayTx 18 // 549us (not measured) -#define PORT_delayRx 0 // 0us (can not measure) -// radio watchdog //===== adaptive_sync accuracy diff --git a/bsp/boards/openmote-b-24ghz/board.c b/bsp/boards/openmote-b-24ghz/board.c index 3ba1e7eafb..b9fc4cfee6 100644 --- a/bsp/boards/openmote-b-24ghz/board.c +++ b/bsp/boards/openmote-b-24ghz/board.c @@ -34,6 +34,11 @@ #define BSP_BUTTON_BASE ( GPIO_D_BASE ) #define BSP_BUTTON_USER ( GPIO_PIN_5 ) +//=========================== variables ============================================ +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; + + //=========================== prototypes ====================================== void board_timer_init(void); @@ -73,11 +78,50 @@ void board_init(void) { uart_init(); radio_init(); i2c_init(); - + board_init_slot_vars(); // sensors_init(); cryptoengine_init(); } +//==== bootstrapping slot info lookup table +void board_init_slot_vars(void){ + //10ms slot + slot_board_vars [SLOT_10ms].slotDuration = 328 ; // 10ms + slot_board_vars [SLOT_10ms].maxTxDataPrepare = 10 ; // 305us (measured 82us) + slot_board_vars [SLOT_10ms].maxRxAckPrepare = 10 ; // 305us (measured 83us) + slot_board_vars [SLOT_10ms].maxRxDataPrepare = 4 ; // 122us (measured 22us) + slot_board_vars [SLOT_10ms].maxTxAckPrepare = 10 ; // 122us (measured 94us) + #ifdef L2_SECURITY_ACTIVE + slot_board_vars [SLOT_10ms].delayTx = 14 ; // 366us (measured xxxus) + #else + slot_board_vars [SLOT_10ms].delayTx = 12 ; // 366us (measured xxxus) + #endif + slot_board_vars [SLOT_10ms].delayRx = 0 ; // 0us (can not measure) + + // 20ms slot + slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // 20ms + slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].delayTx = 13 ; // 396us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) +} + +// To get the current slotDuration at any time +// used during initialization by sixtop to fire the first sixtop EB +uint16_t board_getSlotDuration (void) +{ + return slot_board_vars [selected_slot_type].slotDuration; +} + +// Setter/Getter function for slot_board_vars +slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) +{ + selected_slot_type = slot_type; + return slot_board_vars [selected_slot_type]; +} + void antenna_init(void) { /* Configure GPIO as output */ GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ); diff --git a/bsp/boards/openmote-b-24ghz/board_info.h b/bsp/boards/openmote-b-24ghz/board_info.h index c0dc0d92b7..29024cb011 100644 --- a/bsp/boards/openmote-b-24ghz/board_info.h +++ b/bsp/boards/openmote-b-24ghz/board_info.h @@ -58,42 +58,6 @@ #define PORT_PIN_RADIO_RESET_HIGH() // nothing #define PORT_PIN_RADIO_RESET_LOW() // nothing -#define SLOTDURATION 20 // in miliseconds - -//===== IEEE802154E timing - -#if SLOTDURATION==10 - // time-slot related - #define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet - // execution speed related - #define PORT_maxTxDataPrepare 10 // 305us (measured 82us) - #define PORT_maxRxAckPrepare 10 // 305us (measured 83us) - #define PORT_maxRxDataPrepare 4 // 122us (measured 22us) - #define PORT_maxTxAckPrepare 10 // 122us (measured 94us) - // radio speed related - #ifdef L2_SECURITY_ACTIVE - #define PORT_delayTx 14 // 366us (measured xxxus) - #else - #define PORT_delayTx 12 // 366us (measured xxxus) - #endif - #define PORT_delayRx 0 // 0us (can not measure) - // radio watchdog -#endif - -#if SLOTDURATION==20 - #define PORT_TsSlotDuration 655 // 20ms - - // execution speed related - #define PORT_maxTxDataPrepare 15 // 458us (measured 213us) - #define PORT_maxRxAckPrepare 10 // 305us (measured 86us) - #define PORT_maxRxDataPrepare 10 // 305us (measured 88us) - #define PORT_maxTxAckPrepare 15 // 458us (measured 211us) - - // radio speed related - #define PORT_delayTx 13 // 397us (measured 388us) - #define PORT_delayRx 0 // 0us (can not measure) -#endif - //===== adaptive_sync accuracy #define SYNC_ACCURACY 1 // ticks diff --git a/bsp/boards/openmote-b-24ghz/radio.c b/bsp/boards/openmote-b-24ghz/radio.c index 08fe64c205..96ae4987c9 100644 --- a/bsp/boards/openmote-b-24ghz/radio.c +++ b/bsp/boards/openmote-b-24ghz/radio.c @@ -45,6 +45,8 @@ typedef struct { radio_vars_t radio_vars; +// global radio selection, will use RADIOSETTING_24GHZ by default at initialization. +uint8_t selected_radioSetting = RADIOSETTING_24GHZ; //=========================== prototypes ====================================== void enable_radio_interrupts(void); @@ -181,7 +183,13 @@ void radio_reset(void) { //===== RF admin -void radio_setFrequency(uint8_t frequency, radio_freq_t tx_or_rx) { +void radio_setConfig (radioSetting_t radioSetting){ + selected_radioSetting = radioSetting; + //do nothing +} + + +void radio_setFrequency(uint16_t frequency, radio_freq_t tx_or_rx) { // change state radio_vars.state = RADIOSTATE_SETTING_FREQUENCY; diff --git a/bsp/boards/openmote-b-subghz/board_info.h b/bsp/boards/openmote-b-subghz/board_info.h index b86a537ae7..431d6d3ce9 100644 --- a/bsp/boards/openmote-b-subghz/board_info.h +++ b/bsp/boards/openmote-b-subghz/board_info.h @@ -114,10 +114,12 @@ #define NUMSENSORS 7 -//====== Antenna options ==== + +//=========================== Antenna options ================================ + #define BSP_ANTENNA_BASE GPIO_D_BASE #define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz -#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_3 //!< PD3 -- subghz +#define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_3 //!< PD3 -- subghz //#define DAGROOT //=========================== typedef ======================================== diff --git a/bsp/boards/openmote-b/SConscript b/bsp/boards/openmote-b/SConscript index 71941a8ed4..570b55d7c9 100644 --- a/bsp/boards/openmote-b/SConscript +++ b/bsp/boards/openmote-b/SConscript @@ -10,6 +10,17 @@ si70x = localEnv.SConscript( exports = {'env': env}, ) +cc2538rf = localEnv.SConscript( + os.path.join('#','bsp','chips','cc2538rf','SConscript'), + variant_dir = 'cc2538rf', + exports = {'env': env}, +) +rf215 = localEnv.SConscript( + os.path.join('#','bsp','chips','at86rf215','SConscript'), + variant_dir = 'rf215', + exports = {'env': env}, +) + source = \ [file for file in Glob('*.c') if file.name.find('iar')==-1] + \ Glob('source/*.c') @@ -19,10 +30,12 @@ localEnv.Append( os.path.join('#','bsp','boards','openmote-b'), os.path.join('#','bsp','boards','openmote-b','headers'), os.path.join('#','bsp','boards','openmote-b','source'), + os.path.join('#','bsp','chips','cc2538rf'), os.path.join('#','bsp','chips','si70x'), + os.path.join('#','bsp','chips','at86rf215'), ], ) -board = localEnv.Object(source=source) + si70x +board = localEnv.Object(source=source) + si70x + rf215 + cc2538rf Return('board') diff --git a/bsp/boards/openmote-b/board.c b/bsp/boards/openmote-b/board.c index df5dbadd63..33c5d27df1 100644 --- a/bsp/boards/openmote-b/board.c +++ b/bsp/boards/openmote-b/board.c @@ -1,9 +1,9 @@ -/** - * Author: Xavier Vilajosana (xvilajosana@eecs.berkeley.edu) - * Pere Tuset (peretuset@openmote.com) - * Date: July 2013 - * Description: CC2538-specific definition of the "board" bsp module. - */ + + // Author: Xavier Vilajosana (xvilajosana@eecs.berkeley.edu) + // Pere Tuset (peretuset@openmote.com) + // Date: July 2013 + // Description: CC2538-specific definition of the "board" bsp module. + #include #include @@ -19,6 +19,7 @@ #include #include "board.h" +#include "board_info.h" #include "debugpins.h" #include "i2c.h" #include "leds.h" @@ -28,16 +29,13 @@ #include "uart.h" #include "cryptoengine.h" -//=========================== variables ======================================= +//=========================== defines ======================================= -#define BSP_BUTTON_BASE ( GPIO_C_BASE ) -#define BSP_BUTTON_USER ( GPIO_PIN_3 ) +#define BSP_BUTTON_BASE ( GPIO_D_BASE ) +#define BSP_BUTTON_USER ( GPIO_PIN_5 ) + +//=========================== variables ====================================== -#ifdef REVA1 //Rev.A1 uses SF23 cc2538 which start at diffferent location - #define CC2538_FLASH_ADDRESS ( 0x0023F800 ) -#else - #define CC2538_FLASH_ADDRESS ( 0x0027F800 ) -#endif //=========================== prototypes ====================================== void board_timer_init(void); @@ -47,20 +45,22 @@ bool board_timer_expired(uint32_t future); static void clock_init(void); static void gpio_init(void); static void button_init(void); -static void antenna_init(void); +static void antenna_init(void); +void antenna_cc2538(void); +void antenna_at86rf215(void); static void SysCtrlDeepSleepSetting(void); static void SysCtrlSleepSetting(void); static void SysCtrlRunSetting(void); static void SysCtrlWakeupSetting(void); -static void GPIO_C_Handler(void); - -bool user_button_initialized; +//=========================== variables ======================================= +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; //=========================== main ============================================ - + extern int mote_main(void); int main(void) { @@ -70,73 +70,95 @@ int main(void) { //=========================== public ========================================== void board_init(void) { - user_button_initialized = FALSE; - - gpio_init(); - clock_init(); - antenna_init(); - board_timer_init(); - leds_init(); - debugpins_init(); - button_init(); - sctimer_init(); - uart_init(); - radio_init(); - i2c_init(); - sensors_init(); - cryptoengine_init(); + + gpio_init(); + clock_init(); + antenna_init(); + board_timer_init(); + leds_init(); + debugpins_init(); + button_init(); + sctimer_init(); + uart_init(); + radio_init(); + i2c_init(); + board_init_slot_vars(); + // sensors_init(); + cryptoengine_init(); } void antenna_init(void) { - //use cc2538 2.4ghz radio - GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ); - GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, 0); + // Configure GPIO as output + GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ); + GPIOPinTypeGPIOOutput(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ); + +#ifdef ATMEL_24GHZ + // atmel is using 2.4ghz, connect antenna to atrf215 + antenna_at86rf215(); +#else + // atmel is not using 2.4ghz, connect antenna to cc2538 + antenna_cc2538(); +#endif +} + +void antenna_cc2538(void) { + GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, 0); + GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, BSP_ANTENNA_AT215_24GHZ); +} + +void antenna_at86rf215(void) { + GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_AT215_24GHZ, 0); + GPIOPinWrite(BSP_ANTENNA_BASE, BSP_ANTENNA_CC2538_24GHZ, BSP_ANTENNA_CC2538_24GHZ); } -/** - * Puts the board to sleep - */ + + // Puts the board to sleep + void board_sleep(void) { SysCtrlPowerModeSet(SYS_CTRL_PM_NOACTION); SysCtrlSleep(); } -/** - * Timer runs at 32 MHz and is 32-bit wide - * The timer is divided by 32, whichs gives a 1 microsecond ticks - */ + + // Timer runs at 32 MHz and is 32-bit wide + // The timer is divided by 32, whichs gives a 1 microsecond ticks + void board_timer_init(void) { - // Configure the timer + //Configure the timer TimerConfigure(GPTIMER2_BASE, GPTIMER_CFG_PERIODIC_UP); - + // Enable the timer TimerEnable(GPTIMER2_BASE, GPTIMER_BOTH); } -/** - * Returns the current value of the timer - * The timer is divided by 32, whichs gives a 1 microsecond ticks - */ + + // Returns the current value of the timer + // The timer is divided by 32, whichs gives a 1 microsecond ticks + uint32_t board_timer_get(void) { uint32_t current; - + + //Get the current timer value current = TimerValueGet(GPTIMER2_BASE, GPTIMER_A) >> 5; - + return current; } -/** - * Returns true if the timer has expired - * The timer is divided by 32, whichs gives a 1 microsecond ticks - */ + + // Returns true if the timer has expired + // The timer is divided by 32, whichs gives a 1 microsecond ticks + bool board_timer_expired(uint32_t future) { uint32_t current; int32_t remaining; + //Get current time current = TimerValueGet(GPTIMER2_BASE, GPTIMER_A) >> 5; + //Calculate remaining time remaining = (int32_t) (future - current); - + + //Return if timer has expired if (remaining > 0) { return false; } else { @@ -144,9 +166,75 @@ bool board_timer_expired(uint32_t future) { } } -/** - * Resets the board - */ +//==== bootstrapping slot info lookup table +void board_init_slot_vars(void){ + //10ms slot + slot_board_vars [SLOT_10ms].slotDuration = 328 ; // ms + slot_board_vars [SLOT_10ms].maxTxDataPrepare = 10 ; // 305us (measured 82us) + slot_board_vars [SLOT_10ms].maxRxAckPrepare = 10 ; // 305us (measured 83us) + slot_board_vars [SLOT_10ms].maxRxDataPrepare = 4 ; // 122us (measured 22us) + slot_board_vars [SLOT_10ms].maxTxAckPrepare = 10 ; // 122us (measured 94us) + #ifdef L2_SECURITY_ACTIVE + slot_board_vars [SLOT_10ms].delayTx = 14 ; // 366us (measured xxxus) + #else + slot_board_vars [SLOT_10ms].delayTx = 12 ; // 366us (measured xxxus) + #endif + slot_board_vars [SLOT_10ms].delayRx = 0 ; // 0us (can not measure) + + // 20ms slot + slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // tics + slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].delayTx = 6 ; // 183us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) + + //40ms slot for 24ghz cc2538 + slot_board_vars [SLOT_40ms_24GHZ].slotDuration = 1310 ; // tics + slot_board_vars [SLOT_40ms_24GHZ].maxTxDataPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_40ms_24GHZ].maxRxAckPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_40ms_24GHZ].maxRxDataPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_40ms_24GHZ].maxTxAckPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_40ms_24GHZ].delayTx = 6 ; // 183us (measured xxxus) + slot_board_vars [SLOT_40ms_24GHZ].delayRx = 0 ; // 0us (can not measure) + + //40ms slot for FSK + slot_board_vars [SLOT_40ms_FSK_SUBGHZ].slotDuration = 1310 ; // tics + slot_board_vars [SLOT_40ms_FSK_SUBGHZ].maxTxDataPrepare = 50 ; // 1525us (based on measurement) + slot_board_vars [SLOT_40ms_FSK_SUBGHZ].maxRxAckPrepare = 10 ; // 305µs (based on measurement) + slot_board_vars [SLOT_40ms_FSK_SUBGHZ].maxRxDataPrepare = 10 ; // 305µs (based on measurement) + slot_board_vars [SLOT_40ms_FSK_SUBGHZ].maxTxAckPrepare = 33 ; // 1000µs (based on measurement) + slot_board_vars [SLOT_40ms_FSK_SUBGHZ].delayTx = 66 ; // 2000µs (based on measurement) + slot_board_vars [SLOT_40ms_FSK_SUBGHZ].delayRx = 16 ; // 488µs. This parameter is usually set to 0, however for Atmel on openmote-b, it takes at least 1ms for the transmission to occure because of spi delay (or other implementation specific overhead), so reciver is expected to wait a little more before turning on the radio. + + //40ms slot for OFDM1 MCS0-3 + slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].slotDuration = 1310 ; // tics + slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].maxTxDataPrepare = 50 ; // 1525us (based on measurement) + slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].maxRxAckPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].maxRxDataPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].maxTxAckPrepare = 33 ; // 1000us (based on measurement) + slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].delayTx = 41 ; // 1251us (based on measurement) + slot_board_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].delayRx = 16 ; // 488µs. This parameter is usually set to 0, however for Atmel on openmote-b, it takes at least 1ms for the transmission to occure because of spi delay (or other implementation specific overhead), so reciver is expected to wait a little more before turning on the radio. +} + +// To get the current slotDuration at any time (in tics) +// if you need the value in MS, divide by PORT_TICS_PER_MS (which varies by board and clock frequency and defined in board_info.h) +uint16_t board_getSlotDuration (void) +{ + return slot_board_vars [selected_slot_type].slotDuration; +} + +// Setter/Getter function for slot_board_vars +slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) +{ + selected_slot_type = slot_type; + return slot_board_vars [selected_slot_type]; +} + + + // Resets the board + void board_reset(void) { SysCtrlReset(); } @@ -154,143 +242,128 @@ void board_reset(void) { //=========================== private ========================================= static void gpio_init(void) { - /* Set GPIOs as output */ - GPIOPinTypeGPIOOutput(GPIO_A_BASE, 0xFF); - GPIOPinTypeGPIOOutput(GPIO_B_BASE, 0xFF); - GPIOPinTypeGPIOOutput(GPIO_C_BASE, 0xFF); - GPIOPinTypeGPIOOutput(GPIO_D_BASE, 0xFF); - - /* Initialize GPIOs to low */ - GPIOPinWrite(GPIO_A_BASE, 0xFF, 0x00); - GPIOPinWrite(GPIO_B_BASE, 0xFF, 0x00); - GPIOPinWrite(GPIO_C_BASE, 0xFF, 0x00); - GPIOPinWrite(GPIO_D_BASE, 0xFF, 0x00); + // Configure all GPIO as input + GPIOPinTypeGPIOInput(GPIO_A_BASE, 0xFF); + GPIOPinTypeGPIOInput(GPIO_B_BASE, 0xFF); + GPIOPinTypeGPIOInput(GPIO_C_BASE, 0xFF); + GPIOPinTypeGPIOInput(GPIO_D_BASE, 0xFF); } static void clock_init(void) { - /* Disable global interrupts */ + // Disable global interrupts bool bIntDisabled = IntMasterDisable(); - /* Configure the 32 kHz pins, PD6 and PD7, for crystal operation */ - /* By default they are configured as GPIOs */ + // Configure the 32 kHz pins, PD6 and PD7, for crystal operation + // By default they are configured as GPIOs GPIODirModeSet(GPIO_D_BASE, 0x40, GPIO_DIR_MODE_IN); GPIODirModeSet(GPIO_D_BASE, 0x80, GPIO_DIR_MODE_IN); IOCPadConfigSet(GPIO_D_BASE, 0x40, IOC_OVERRIDE_ANA); IOCPadConfigSet(GPIO_D_BASE, 0x80, IOC_OVERRIDE_ANA); - /* Set the real-time clock to use the 32 kHz external crystal */ - /* Set the system clock to use the external 32 MHz crystal */ - /* Set the system clock to 32 MHz */ + // Set the real-time clock to use the 32 kHz external crystal + // Set the system clock to use the external 32 MHz crystal + // Set the system clock to 32 MHz SysCtrlClockSet(true, false, SYS_CTRL_SYSDIV_32MHZ); - /* Set the IO clock to operate at 16 MHz */ - /* This way peripherals can run while the system clock is gated */ - SysCtrlIOClockSet(SYS_CTRL_SYSDIV_16MHZ); + // Set the IO clock to operate at 32 MHz + // This way peripherals can run while the system clock is gated + SysCtrlIOClockSet(SYS_CTRL_SYSDIV_32MHZ); - /* Wait until the selected clock configuration is stable */ + // Wait until the selected clock configuration is stable while (!((HWREG(SYS_CTRL_CLOCK_STA)) & (SYS_CTRL_CLOCK_STA_XOSC_STB))); - /* Define what peripherals run in each mode */ + // Define what peripherals run in each mode SysCtrlRunSetting(); SysCtrlSleepSetting(); SysCtrlDeepSleepSetting(); SysCtrlWakeupSetting(); - /* Re-enable interrupt if initially enabled */ + // Re-enable interrupt if initially enabled if (!bIntDisabled) { IntMasterEnable(); } } -/** - * Configures the user button as input source - */ -static void button_init(void) { - volatile uint32_t i; - - /* Delay to avoid pin floating problems */ - for (i = 0xFFFF; i != 0; i--); - GPIOPinIntDisable(BSP_BUTTON_BASE, BSP_BUTTON_USER); - GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER); + // Configures the user button as input source - /* The button is an input GPIO on falling edge */ +static void button_init(void) { + // The button is an input GPIO on falling edge GPIOPinTypeGPIOInput(BSP_BUTTON_BASE, BSP_BUTTON_USER); GPIOIntTypeSet(BSP_BUTTON_BASE, BSP_BUTTON_USER, GPIO_FALLING_EDGE); - /* Register the interrupt */ - GPIOPortIntRegister(BSP_BUTTON_BASE, GPIO_C_Handler); + // Enable wake-up capability + GPIOIntWakeupEnable(GPIO_IWE_PORT_D); - /* Clear and enable the interrupt */ + // Clear and enable the interrupt GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER); GPIOPinIntEnable(BSP_BUTTON_BASE, BSP_BUTTON_USER); - user_button_initialized = TRUE; } static void SysCtrlRunSetting(void) { - /* Disable General Purpose Timers 0, 1, 2, 3 when running */ + // Disable General Purpose Timers 0, 1, 2, 3 when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_GPT0); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_GPT1); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_GPT3); - /* Disable SSI 0, 1 when running */ + // Disable SSI 0, 1 when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_SSI0); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_SSI1); - /* Disable UART1 when running */ + // Disable UART1 when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_UART1); - /* Disable I2C, AES and PKA when running */ + // Disable I2C, AES and PKA when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_I2C); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_PKA); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_AES); - /* Enable UART0 and RFC when running */ + // Enable UART0 and RFC when running SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_GPT2); SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_UART0); SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_RFC); } static void SysCtrlSleepSetting(void) { - /* Disable General Purpose Timers 0, 1, 2, 3 during sleep */ + // Disable General Purpose Timers 0, 1, 2, 3 during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_GPT0); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_GPT1); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_GPT3); - /* Disable SSI 0, 1 during sleep */ + // Disable SSI 0, 1 during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_SSI0); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_SSI1); - /* Disable UART 0, 1 during sleep */ + // Disable UART 0, 1 during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_UART1); - /* Disable I2C, PKA, AES during sleep */ + // Disable I2C, PKA, AES during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_I2C); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_PKA); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_AES); - /* Enable UART and RFC during sleep */ + // Enable UART and RFC during sleep SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_GPT2); SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_UART0); SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_RFC); } static void SysCtrlDeepSleepSetting(void) { - /* Disable General Purpose Timers 0, 1, 2, 3 during deep sleep */ + // Disable General Purpose Timers 0, 1, 2, 3 during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT0); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT1); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT2); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT3); - /* Disable SSI 0, 1 during deep sleep */ + // Disable SSI 0, 1 during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_SSI0); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_SSI1); - /* Disable UART 0, 1 during deep sleep */ + // Disable UART 0, 1 during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_UART0); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_UART1); - /* Disable I2C, PKA, AES during deep sleep */ + // Disable I2C, PKA, AES during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_I2C); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_PKA); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_AES); @@ -298,27 +371,8 @@ static void SysCtrlDeepSleepSetting(void) { } static void SysCtrlWakeupSetting(void) { - /* Allow the SMTimer to wake up the processor */ + // Allow the SMTimer to wake up the processor GPIOIntWakeupEnable(GPIO_IWE_SM_TIMER); } //=========================== interrupt handlers ============================== - -/** - * GPIO_C interrupt handler. User button is GPIO_C_3 - * Erases a Flash sector to trigger the bootloader backdoor - */ -static void GPIO_C_Handler(void) { - if (!user_button_initialized) return; - /* Disable the interrupts */ - IntMasterDisable(); - leds_all_off(); - - /* Eras the CCA flash page */ - FlashMainPageErase(CC2538_FLASH_ADDRESS); - - leds_circular_shift(); - - /* Reset the board */ - SysCtrlReset(); -} diff --git a/bsp/boards/openmote-b/board_info.h b/bsp/boards/openmote-b/board_info.h index 86a26647e3..ec923c196b 100644 --- a/bsp/boards/openmote-b/board_info.h +++ b/bsp/boards/openmote-b/board_info.h @@ -57,41 +57,9 @@ #define PORT_PIN_RADIO_RESET_HIGH() // nothing #define PORT_PIN_RADIO_RESET_LOW() // nothing -#define SLOTDURATION 10 // in miliseconds - -//===== IEEE802154E timing - -#if SLOTDURATION==10 - // time-slot related - #define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet - // execution speed related - #define PORT_maxTxDataPrepare 10 // 305us (measured 82us) - #define PORT_maxRxAckPrepare 10 // 305us (measured 83us) - #define PORT_maxRxDataPrepare 4 // 122us (measured 22us) - #define PORT_maxTxAckPrepare 10 // 122us (measured 94us) - // radio speed related - #ifdef L2_SECURITY_ACTIVE - #define PORT_delayTx 14 // 366us (measured xxxus) - #else - #define PORT_delayTx 12 // 366us (measured xxxus) - #endif - #define PORT_delayRx 0 // 0us (can not measure) - // radio watchdog -#endif -#if SLOTDURATION==15 - // time-slot related - #define PORT_TsSlotDuration 492 // counter counts one extra count, see datasheet - // execution speed related - #define PORT_maxTxDataPrepare 66 // 2014us (measured 746us) - #define PORT_maxRxAckPrepare 10 // 305us (measured 83us) - #define PORT_maxRxDataPrepare 33 // 1007us (measured 84us) - #define PORT_maxTxAckPrepare 22 // 305us (measured 219us) - // radio speed related - #define PORT_delayTx 12 // 214us (measured 219us) - #define PORT_delayRx 0 // 0us (can not measure) - // radio watchdog -#endif +// Number of available radio settings +#define MAX_RADIOS 7 //===== adaptive_sync accuracy @@ -101,25 +69,25 @@ #define NUMSENSORS 7 -//====== Antenna options ==== +//=========================== Antenna options ================================= + #define BSP_ANTENNA_BASE GPIO_D_BASE #define BSP_ANTENNA_CC2538_24GHZ GPIO_PIN_4 //!< PD4 -- 2.4ghz #define BSP_ANTENNA_AT215_24GHZ GPIO_PIN_3 //!< PD3 -- subghz - //=========================== typedef ======================================== //=========================== variables ======================================= static const uint8_t rreg_uriquery[] = "h=ucb"; -static const uint8_t infoBoardname[] = "CC2538"; +static const uint8_t infoBoardname[] = "Openmote B"; static const uint8_t infouCName[] = "CC2538"; static const uint8_t infoRadioName[] = "CC2538 SoC"; //=========================== prototypes ====================================== //=========================== public ========================================== - +void eraseFlash(void); //=========================== private ========================================= #endif diff --git a/bsp/boards/openmote-b/cx2538xf53.icf b/bsp/boards/openmote-b/cx2538xf53.icf new file mode 100644 index 0000000000..4585a623ad --- /dev/null +++ b/bsp/boards/openmote-b/cx2538xf53.icf @@ -0,0 +1,109 @@ +/*###ICF### Section handled by ICF editor, don't touch! ****/ +/*-Editor annotation file-*/ +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ +/*-Specials-*/ +define symbol __ICFEDIT_intvec_start__ = 0x00200000; +/*-Memory Regions-*/ +define symbol __ICFEDIT_region_ROM_start__ = 0x00200000; +define symbol __ICFEDIT_region_ROM_end__ = 0x0027ffd3; +define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; +define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; +/*-Sizes-*/ +define symbol __ICFEDIT_size_cstack__ = 0x800; +define symbol __ICFEDIT_size_heap__ = 0x1000; +/**** End of ICF editor section. ###ICF###*/ + +// +// Define a memory region that covers the entire 4 GB addressible space of the +// processor. +// +define memory mem with size = 4G; + +// +// Define a region for the on-chip flash. +// This device has 512KB Flash size +// +define region FLASH = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; + +// +// Define a region for Customer Configuration Area in flash. +// +define region FLASH_CCA = mem:[from 0x0027ffd4 to 0x0027ffdf]; + +// +// Define a region for the on-chip SRAM. +// This device has 32KB RAM size +// +define region SRAM = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +// +// Define regions of retention and non-retention RAM. The stack and other +// variables that require retention through PM2/3 should be placed in the +// retention RAM region +// +define region SRAM_NON_RETENTION = mem:[from __ICFEDIT_region_RAM_start__ to 0x20003fff]; +define region SRAM_RETENTION = mem:[from 0x20004000 to __ICFEDIT_region_RAM_end__]; +define region SRAM_TOTAL = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; + +// +// Define a block for the heap. The size should be set to something other +// than zero if things in the C library that require the heap are used. +// +define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; + +// +// Indicate that the read/write values should be initialized by copying from +// flash. +// +initialize by copy { readwrite }; + +// +// Indicate that the noinit values should be left alone. +// +do not initialize { section .noinit }; + +// +// Place the interrupt vectors at the start of flash. +// +place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; + +// +// Place the cca area at the end of flash (start of FLASH_CCA). +// +place at start of FLASH_CCA { readonly section .flashcca }; + +// +// Place the remainder of the read-only items into flash. +// +place in FLASH { readonly }; + +// +// Place the RAM vector table at the start of retention ram. +// +place at start of SRAM_TOTAL { section VTABLE }; + +// +// Place all read/write items into retention SRAM. +// +place in SRAM_TOTAL { readwrite, block HEAP }; + +// +// Define CSTACK block to contain .stack section. This enables the IAR IDE +// to properly show the stack content during debug. Place stack at end of +// retention RAM, do not initialize (initializing the stack will destroy the +// return address from the initialization code, causing the processor to branch +// to zero and fault) +// +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { section .stack }; +do not initialize { section .stack }; +place at end of SRAM_TOTAL { block CSTACK }; + +// +// Export stack top symbol. Used by startup file. +// +define exported symbol STACK_TOP = __ICFEDIT_region_RAM_end__ + 1; + +// +// Variables that do not need retention should be defined here +// +place in SRAM_TOTAL { section .nonretenvar }; diff --git a/bsp/boards/openmote-b/i2c.c b/bsp/boards/openmote-b/i2c.c index d9028f5dd5..e5c1764a09 100644 --- a/bsp/boards/openmote-b/i2c.c +++ b/bsp/boards/openmote-b/i2c.c @@ -21,10 +21,10 @@ #define I2C_PERIPHERAL ( SYS_CTRL_PERIPH_I2C ) #define I2C_BASE ( GPIO_B_BASE ) -#define I2C_SCL ( GPIO_PIN_3 ) +#define I2C_SCL ( GPIO_PIN_5 ) #define I2C_SDA ( GPIO_PIN_4 ) -#define I2C_BAUDRATE ( 100000 ) -#define I2C_MAX_DELAY_US ( 100000 ) +#define I2C_BAUDRATE ( 400000 ) +#define I2C_MAX_DELAY_US ( 400000 ) //=========================== variables ======================================= diff --git a/bsp/boards/openmote-b/leds.c b/bsp/boards/openmote-b/leds.c index 248b6ed64a..aaf3c5bde4 100644 --- a/bsp/boards/openmote-b/leds.c +++ b/bsp/boards/openmote-b/leds.c @@ -59,34 +59,34 @@ uint8_t leds_error_isOn(void) { return (uint8_t)(ui32Toggle & BSP_LED_1)>>4; } -// orange +// green void leds_sync_on(void) { - bspLedSet(BSP_LED_2); + bspLedSet(BSP_LED_4); } void leds_sync_off(void) { - bspLedClear(BSP_LED_2); + bspLedClear(BSP_LED_4); } void leds_sync_toggle(void) { - bspLedToggle(BSP_LED_2); + bspLedToggle(BSP_LED_4); } uint8_t leds_sync_isOn(void) { - uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_2); - return (uint8_t)(ui32Toggle & BSP_LED_2)>>5; + uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_4); + return (uint8_t)(ui32Toggle & BSP_LED_4)>>5; } -// green +// orange void leds_radio_on(void) { - bspLedSet(BSP_LED_4); + bspLedSet(BSP_LED_2); } void leds_radio_off(void) { - bspLedClear(BSP_LED_4); + bspLedClear(BSP_LED_2); } void leds_radio_toggle(void) { - bspLedToggle(BSP_LED_4); + bspLedToggle(BSP_LED_2); } uint8_t leds_radio_isOn(void) { - uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_4); - return (uint8_t)(ui32Toggle & BSP_LED_4)>>7; + uint32_t ui32Toggle = GPIOPinRead(BSP_LED_BASE, BSP_LED_2); + return (uint8_t)(ui32Toggle & BSP_LED_2)>>7; } // yellow @@ -140,7 +140,7 @@ void leds_circular_shift(void) { // incrementally turn LED on for (i=0;i<10;i++) { bspLedSet(BSP_LED_1); - for (delay=0xffff;delay>0;delay--); + for (delay=0xffff;delay>0;delay--) bspLedClear(BSP_LED_1); bspLedSet(BSP_LED_2); for (delay=0xffff;delay>0;delay--); diff --git a/bsp/boards/openmote-b/radio.c b/bsp/boards/openmote-b/radio.c index 2d4281a5cf..b6c0a153f4 100644 --- a/bsp/boards/openmote-b/radio.c +++ b/bsp/boards/openmote-b/radio.c @@ -1,531 +1,324 @@ /** - * Author: Xavier Vilajosana (xvilajosana@eecs.berkeley.edu) - * Pere Tuset (peretuset@openmote.com) - * Date: July 2013 - * Description: CC2538-specific definition of the "radio" bsp module. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - + \brief Definition of the Open Radio interface for openmote-b + \author Mina Rady , March 2020. +*/ #include "board.h" -#include "cc2538rf.h" + +#include "spi.h" #include "debugpins.h" #include "leds.h" -#include "radio.h" #include "sctimer.h" -//=========================== defines ========================================= -/* Bit Masks for the last byte in the RX FIFO */ -#define CRC_BIT_MASK 0x80 -#define LQI_BIT_MASK 0x7F +#include +#include +#include +#include +#include + +#include +#include +#include +#include -/* RSSI Offset */ -#define RSSI_OFFSET 73 -#define CHECKSUM_LEN 2 +// Drivers of radios attached to openmote-b +#include "radio_at86rf215.h" +#include "radio_cc2538rf.h" -//=========================== variables ======================================= +// The generic radio driver header file +#include "radio.h" -typedef struct { - radio_capture_cbt startFrame_cb; - radio_capture_cbt endFrame_cb; - radio_state_t state; -} radio_vars_t; +//=========================== defines ========================================= -radio_vars_t radio_vars; -//=========================== prototypes ====================================== +// open radio functions callback types declaration + +typedef void (*radio_reset_cb_t)(void); +typedef void (*radio_init_cb_t)(void); +typedef void (*radio_setConfig_cb_t)(radioSetting_t radioSetting); +typedef void (*radio_setStartFrameCb_cb_t)(radio_capture_cbt cb); +typedef void (*radio_setEndFrameCb_cb_t)(radio_capture_cbt cb); +typedef void (*radio_setFrequency_cb_t)(uint16_t channel, radio_freq_t tx_or_rx); +typedef void (*radio_rfOn_cb_t)(void); +typedef void (*radio_rfOff_cb_t)(void); +typedef int8_t (*radio_getFrequencyOffset_cb_t)(void); +typedef void (*radio_loadPacket_cb_t)(uint8_t* packet, uint16_t len); +typedef radio_state_t (*radio_getState_cb_t)(void); +typedef void (*radio_txEnable_cb_t)(void); +typedef void (*radio_txNow_cb_t)(void); +typedef void (*radio_rxEnable_cb_t)(void); +typedef void (*radio_rxNow_cb_t)(void); +typedef void (*radio_getReceivedFrame_cb_t)( + uint8_t* bufRead, + uint8_t* lenRead, + uint8_t maxBufLen, + int8_t* rssi, + uint8_t* lqi, + bool* crc + ); +typedef kick_scheduler_t (*radio_isr_cb_t)(void); + + +// the template for radio function callbacks +typedef struct { + radio_reset_cb_t radio_reset; + radio_init_cb_t radio_init; + radio_setConfig_cb_t radio_setConfig; + radio_setStartFrameCb_cb_t radio_setStartFrameCb; + radio_setEndFrameCb_cb_t radio_setEndFrameCb; + radio_setFrequency_cb_t radio_setFrequency; + radio_rfOn_cb_t radio_rfOn; + radio_rfOff_cb_t radio_rfOff; + radio_getFrequencyOffset_cb_t radio_getFrequencyOffset; + radio_loadPacket_cb_t radio_loadPacket; + radio_txEnable_cb_t radio_txEnable; + radio_txNow_cb_t radio_txNow; + radio_rxEnable_cb_t radio_rxEnable; + radio_rxNow_cb_t radio_rxNow; + radio_getReceivedFrame_cb_t radio_getReceivedFrame; + radio_isr_cb_t radio_isr; +} radio_functions_t; + + +// global radio selection, will use the slowest by default at initialization. +uint8_t selected_radioSetting = RADIOSETTING_FSK_OPTION1_FEC; -void enable_radio_interrupts(void); -void disable_radio_interrupts(void); +//=========================== variables ======================================= -void radio_on(void); -void radio_off(void); +//function call back matrix +radio_functions_t dyn_funcs [MAX_RADIOS]; + +//=========================== Bootstrapping =================================== + +// initializing the lookup table for radio function callbacks +void radio_bootstrap (void) +{ + // RADIOSETTING_FSK_OPTION1_FEC + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_reset = radio_reset_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_init = radio_init_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_setConfig = radio_setConfig_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_setStartFrameCb = radio_setStartFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_setEndFrameCb = radio_setEndFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_setFrequency = radio_setFrequency_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_rfOn = radio_rfOn_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_rfOff = radio_rfOff_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_getFrequencyOffset = radio_getFrequencyOffset_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_loadPacket = radio_loadPacket_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_txEnable = radio_txEnable_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_txNow = radio_txNow_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_rxEnable = radio_rxEnable_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_rxNow = radio_rxNow_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_getReceivedFrame = radio_getReceivedFrame_at86rf215; + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_isr = radio_isr_at86rf215; + + + //RADIOSETTING_OQPSK_RATE3 + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_reset = radio_reset_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_init = radio_init_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_setConfig = radio_setConfig_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_setStartFrameCb = radio_setStartFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_setEndFrameCb = radio_setEndFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_setFrequency = radio_setFrequency_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_rfOn = radio_rfOn_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_rfOff = radio_rfOff_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_getFrequencyOffset = radio_getFrequencyOffset_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_loadPacket = radio_loadPacket_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_txEnable = radio_txEnable_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_txNow = radio_txNow_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_rxEnable = radio_rxEnable_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_rxNow = radio_rxNow_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_getReceivedFrame = radio_getReceivedFrame_at86rf215; + dyn_funcs [RADIOSETTING_OQPSK_RATE3].radio_isr = radio_isr_at86rf215; + + //RADIOSETTING_OFDM_OPTION_1_MCS0 + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_reset = radio_reset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_init = radio_init_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_setConfig = radio_setConfig_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_setStartFrameCb = radio_setStartFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_setEndFrameCb = radio_setEndFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_setFrequency = radio_setFrequency_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_rfOn = radio_rfOn_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_rfOff = radio_rfOff_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_getFrequencyOffset = radio_getFrequencyOffset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_loadPacket = radio_loadPacket_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_txEnable = radio_txEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_txNow = radio_txNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_rxEnable = radio_rxEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_rxNow = radio_rxNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_getReceivedFrame = radio_getReceivedFrame_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS0].radio_isr = radio_isr_at86rf215; + + //RADIOSETTING_OFDM_OPTION_1_MCS1 + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_reset = radio_reset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_init = radio_init_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_setConfig = radio_setConfig_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_setStartFrameCb = radio_setStartFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_setEndFrameCb = radio_setEndFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_setFrequency = radio_setFrequency_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_rfOn = radio_rfOn_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_rfOff = radio_rfOff_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_getFrequencyOffset = radio_getFrequencyOffset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_loadPacket = radio_loadPacket_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_txEnable = radio_txEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_txNow = radio_txNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_rxEnable = radio_rxEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_rxNow = radio_rxNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_getReceivedFrame = radio_getReceivedFrame_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS1].radio_isr = radio_isr_at86rf215; + + //RADIOSETTING_OFDM_OPTION_1_MCS2 + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_reset = radio_reset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_init = radio_init_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_setConfig = radio_setConfig_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_setStartFrameCb = radio_setStartFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_setEndFrameCb = radio_setEndFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_setFrequency = radio_setFrequency_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_rfOn = radio_rfOn_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_rfOff = radio_rfOff_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_getFrequencyOffset = radio_getFrequencyOffset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_loadPacket = radio_loadPacket_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_txEnable = radio_txEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_txNow = radio_txNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_rxEnable = radio_rxEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_rxNow = radio_rxNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_getReceivedFrame = radio_getReceivedFrame_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS2].radio_isr = radio_isr_at86rf215; + + //RADIOSETTING_OFDM_OPTION_1_MCS3 + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_reset = radio_reset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_init = radio_init_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_setConfig = radio_setConfig_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_setStartFrameCb = radio_setStartFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_setEndFrameCb = radio_setEndFrameCb_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_setFrequency = radio_setFrequency_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_rfOn = radio_rfOn_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_rfOff = radio_rfOff_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_getFrequencyOffset = radio_getFrequencyOffset_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_loadPacket = radio_loadPacket_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_txEnable = radio_txEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_txNow = radio_txNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_rxEnable = radio_rxEnable_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_rxNow = radio_rxNow_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_getReceivedFrame = radio_getReceivedFrame_at86rf215; + dyn_funcs [RADIOSETTING_OFDM_OPTION_1_MCS3].radio_isr = radio_isr_at86rf215; + + + //RADIOSETTING_24GHZ + dyn_funcs [RADIOSETTING_24GHZ].radio_reset = radio_reset_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_init = radio_init_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_setConfig = radio_setConfig_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_setStartFrameCb = radio_setStartFrameCb_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_setEndFrameCb = radio_setEndFrameCb_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_setFrequency = radio_setFrequency_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_rfOn = radio_rfOn_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_rfOff = radio_rfOff_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_getFrequencyOffset = radio_getFrequencyOffset_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_loadPacket = radio_loadPacket_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_txEnable = radio_txEnable_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_txNow = radio_txNow_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_rxEnable = radio_rxEnable_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_rxNow = radio_rxNow_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_getReceivedFrame = radio_getReceivedFrame_cc2538rf; + dyn_funcs [RADIOSETTING_24GHZ].radio_isr = radio_isr_cc2538rf; +} -void radio_error_isr(void); -void radio_isr_internal(void); //=========================== public ========================================== //===== admin - -void radio_init(void) { - - // clear variables - memset(&radio_vars,0,sizeof(radio_vars_t)); - - // change state - radio_vars.state = RADIOSTATE_STOPPED; - //flush fifos - CC2538_RF_CSP_ISFLUSHRX(); - CC2538_RF_CSP_ISFLUSHTX(); - - radio_off(); - - //disable radio interrupts - disable_radio_interrupts(); - - /* - This CORR_THR value should be changed to 0x14 before attempting RX. Testing has shown that - too many false frames are received if the reset value is used. Make it more likely to detect - sync by removing the requirement that both symbols in the SFD must have a correlation value - above the correlation threshold, and make sync word detection less likely by raising the - correlation threshold. - */ - HWREG(RFCORE_XREG_MDMCTRL1) = 0x14; - /* tuning adjustments for optimal radio performance; details available in datasheet */ - - HWREG(RFCORE_XREG_RXCTRL) = 0x3F; - /* Adjust current in synthesizer; details available in datasheet. */ - HWREG(RFCORE_XREG_FSCTRL) = 0x55; - - /* Makes sync word detection less likely by requiring two zero symbols before the sync word. - * details available in datasheet. - */ - HWREG(RFCORE_XREG_MDMCTRL0) = 0x85; - - /* Adjust current in VCO; details available in datasheet. */ - HWREG(RFCORE_XREG_FSCAL1) = 0x01; - /* Adjust target value for AGC control loop; details available in datasheet. */ - HWREG(RFCORE_XREG_AGCCTRL1) = 0x15; - - /* Tune ADC performance, details available in datasheet. */ - HWREG(RFCORE_XREG_ADCTEST0) = 0x10; - HWREG(RFCORE_XREG_ADCTEST1) = 0x0E; - HWREG(RFCORE_XREG_ADCTEST2) = 0x03; - - //update CCA register to -81db as indicated by manual.. won't be used.. - HWREG(RFCORE_XREG_CCACTRL0) = 0xF8; - /* - * Changes from default values - * See User Guide, section "Register Settings Update" - */ - HWREG(RFCORE_XREG_TXFILTCFG) = 0x09; /** TX anti-aliasing filter bandwidth */ - HWREG(RFCORE_XREG_AGCCTRL1) = 0x15; /** AGC target value */ - HWREG(ANA_REGS_O_IVCTRL) = 0x0B; /** Bias currents */ - - /* disable the CSPT register compare function */ - HWREG(RFCORE_XREG_CSPT) = 0xFFUL; - /* - * Defaults: - * Auto CRC; Append RSSI, CRC-OK and Corr. Val.; CRC calculation; - * RX and TX modes with FIFOs - */ - HWREG(RFCORE_XREG_FRMCTRL0) = RFCORE_XREG_FRMCTRL0_AUTOCRC; - - //poipoi disable frame filtering by now.. sniffer mode. - HWREG(RFCORE_XREG_FRMFILT0) &= ~RFCORE_XREG_FRMFILT0_FRAME_FILTER_EN; - - /* Disable source address matching and autopend */ - HWREG(RFCORE_XREG_SRCMATCH) = 0; - - /* MAX FIFOP threshold */ - HWREG(RFCORE_XREG_FIFOPCTRL) = CC2538_RF_MAX_PACKET_LEN; - - HWREG(RFCORE_XREG_TXPOWER) = CC2538_RF_TX_POWER; - HWREG(RFCORE_XREG_FREQCTRL) = CC2538_RF_CHANNEL_MIN; - - /* Enable RF interrupts see page 751 */ - // enable_radio_interrupts(); - - //register interrupt - IntRegister(INT_RFCORERTX, radio_isr_internal); - IntRegister(INT_RFCOREERR, radio_error_isr); - - IntEnable(INT_RFCORERTX); - - /* Enable all RF Error interrupts */ - HWREG(RFCORE_XREG_RFERRM) = RFCORE_XREG_RFERRM_RFERRM_M; //all errors - IntEnable(INT_RFCOREERR); - //radio_on(); - - // change state - radio_vars.state = RADIOSTATE_RFOFF; +void radio_init (void) { + //bootstrapping the radio look-up matrix + radio_bootstrap(); + + // Initializing the atmel radio + dyn_funcs [RADIOSETTING_FSK_OPTION1_FEC].radio_init(); + + // Initializing the ti radio + dyn_funcs [RADIOSETTING_24GHZ].radio_init(); } -void radio_setStartFrameCb(radio_capture_cbt cb) { - radio_vars.startFrame_cb = cb; -} - -void radio_setEndFrameCb(radio_capture_cbt cb) { - radio_vars.endFrame_cb = cb; -} - -//===== reset void radio_reset(void) { - /* Wait for ongoing TX to complete (e.g. this could be an outgoing ACK) */ - while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); - - //flush fifos - CC2538_RF_CSP_ISFLUSHRX(); - CC2538_RF_CSP_ISFLUSHTX(); - - /* Don't turn off if we are off as this will trigger a Strobe Error */ - if(HWREG(RFCORE_XREG_RXENABLE) != 0) { - CC2538_RF_CSP_ISRFOFF(); - } - radio_init(); + dyn_funcs [selected_radioSetting].radio_reset(); } -//===== RF admin -void radio_setFrequency(uint8_t frequency, radio_freq_t tx_or_rx) { - - // change state - radio_vars.state = RADIOSTATE_SETTING_FREQUENCY; - - radio_off(); - // configure the radio to the right frequency - if((frequency < CC2538_RF_CHANNEL_MIN) || (frequency > CC2538_RF_CHANNEL_MAX)) { - while(1); - } - - /* Changes to FREQCTRL take effect after the next recalibration */ - HWREG(RFCORE_XREG_FREQCTRL) = (CC2538_RF_CHANNEL_MIN - + (frequency - CC2538_RF_CHANNEL_MIN) * CC2538_RF_CHANNEL_SPACING); - - //radio_on(); - - // change state - radio_vars.state = RADIOSTATE_FREQUENCY_SET; +void radio_setConfig (radioSetting_t radioSetting){ + selected_radioSetting = radioSetting; + dyn_funcs [selected_radioSetting].radio_setConfig(selected_radioSetting); } -void radio_rfOn(void) { - //radio_on(); + +void radio_setStartFrameCb (radio_capture_cbt cb) { + dyn_funcs [selected_radioSetting].radio_setStartFrameCb(cb); } -void radio_rfOff(void) { - - // change state - radio_vars.state = RADIOSTATE_TURNING_OFF; - radio_off(); - // wiggle debug pin - debugpins_radio_clr(); - leds_radio_off(); - //enable radio interrupts - disable_radio_interrupts(); - - // change state - radio_vars.state = RADIOSTATE_RFOFF; +void radio_setEndFrameCb (radio_capture_cbt cb) { + dyn_funcs [selected_radioSetting].radio_setEndFrameCb(cb); } -//===== TX +//===== RF admin -void radio_loadPacket(uint8_t* packet, uint16_t len) { - uint8_t i=0; - - // change state - radio_vars.state = RADIOSTATE_LOADING_PACKET; - - // load packet in TXFIFO - /* - When we transmit in very quick bursts, make sure previous transmission - is not still in progress before re-writing to the TX FIFO - */ - while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); - - CC2538_RF_CSP_ISFLUSHTX(); - - /* Send the phy length byte first */ - HWREG(RFCORE_SFR_RFDATA) = len; //crc len is included - - for(i = 0; i < len; i++) { - HWREG(RFCORE_SFR_RFDATA) = packet[i]; - } - - // change state - radio_vars.state = RADIOSTATE_PACKET_LOADED; +void radio_setFrequency (uint16_t channel, radio_freq_t tx_or_rx) { + dyn_funcs [selected_radioSetting].radio_setFrequency(channel, tx_or_rx); } -void radio_txEnable(void) { - - // change state - radio_vars.state = RADIOSTATE_ENABLING_TX; - - // wiggle debug pin - debugpins_radio_set(); - leds_radio_on(); - - //do nothing -- radio is activated by the strobe on rx or tx - //radio_rfOn(); - - // change state - radio_vars.state = RADIOSTATE_TX_ENABLED; +void radio_rfOn (void) { + dyn_funcs [selected_radioSetting].radio_rfOn(); } -void radio_txNow(void) { - PORT_TIMER_WIDTH count; - - // change state - radio_vars.state = RADIOSTATE_TRANSMITTING; - - //enable radio interrupts - enable_radio_interrupts(); - - //make sure we are not transmitting already - while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); - - // send packet by STON strobe see pag 669 +void radio_rfOff (void) { + dyn_funcs [selected_radioSetting].radio_rfOff(); +} - CC2538_RF_CSP_ISTXON(); - //wait 192uS - count=0; - while(!((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE))){ - count++; //debug - } +int8_t radio_getFrequencyOffset (void){ + return dyn_funcs [selected_radioSetting].radio_getFrequencyOffset(); } -//===== RX +//===== TX -void radio_rxEnable(void) { - - // change state - radio_vars.state = RADIOSTATE_ENABLING_RX; - - //enable radio interrupts - - // do nothing as we do not want to receive anything yet. - // wiggle debug pin - debugpins_radio_set(); - leds_radio_on(); - - // change state - radio_vars.state = RADIOSTATE_LISTENING; +void radio_loadPacket (uint8_t* packet, uint16_t len) { + dyn_funcs [selected_radioSetting].radio_loadPacket(packet, len); } -void radio_rxNow(void) { - //empty buffer before receiving - //CC2538_RF_CSP_ISFLUSHRX(); - - //enable radio interrupts - CC2538_RF_CSP_ISFLUSHRX(); - enable_radio_interrupts(); - - CC2538_RF_CSP_ISRXON(); - // busy wait until radio really listening - while(!((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_RX_ACTIVE))); -} -void radio_getReceivedFrame(uint8_t* pBufRead, - uint8_t* pLenRead, - uint8_t maxBufLen, - int8_t* pRssi, - uint8_t* pLqi, - bool* pCrc) { - uint8_t crc_corr,i; - - uint8_t len=0; - - /* Check the length */ - len = HWREG(RFCORE_SFR_RFDATA); //first byte is len - - - /* Check for validity */ - if(len > CC2538_RF_MAX_PACKET_LEN) { - /* wrong len */ - CC2538_RF_CSP_ISFLUSHRX(); - return; - } - - - if(len <= CC2538_RF_MIN_PACKET_LEN) { - //too short - CC2538_RF_CSP_ISFLUSHRX(); - return; - } - - //check if this fits to the buffer - if(len > maxBufLen) { - CC2538_RF_CSP_ISFLUSHRX(); - return; - } - - // when reading the packet from the RX buffer, you get the following: - // - *[1B] length byte - // - [0-125B] packet (excluding CRC) - // - [1B] RSSI - // - *[2B] CRC - - //skip first byte is len - for(i = 0; i < len - 2; i++) { - pBufRead[i] = HWREG(RFCORE_SFR_RFDATA); - } - - *pRssi = ((int8_t)(HWREG(RFCORE_SFR_RFDATA)) - RSSI_OFFSET); - crc_corr = HWREG(RFCORE_SFR_RFDATA); - *pCrc = crc_corr & CRC_BIT_MASK; - *pLenRead = len; - - //flush it - CC2538_RF_CSP_ISFLUSHRX(); +void radio_txEnable (void) { + dyn_funcs [selected_radioSetting].radio_txEnable(); } -//=========================== private ========================================= +void radio_txNow (void) { + dyn_funcs [selected_radioSetting].radio_txNow(); +} -void enable_radio_interrupts(void){ - /* Enable RF interrupts 0, RXPKTDONE,SFD,FIFOP only -- see page 751 */ - HWREG(RFCORE_XREG_RFIRQM0) |= ((0x06|0x02|0x01) << RFCORE_XREG_RFIRQM0_RFIRQM_S) & RFCORE_XREG_RFIRQM0_RFIRQM_M; +//===== RX - /* Enable RF interrupts 1, TXDONE only */ - HWREG(RFCORE_XREG_RFIRQM1) |= ((0x02) << RFCORE_XREG_RFIRQM1_RFIRQM_S) & RFCORE_XREG_RFIRQM1_RFIRQM_M; +void radio_rxEnable (void) { + dyn_funcs [selected_radioSetting].radio_rxEnable(); } -void disable_radio_interrupts(void){ - /* Enable RF interrupts 0, RXPKTDONE,SFD,FIFOP only -- see page 751 */ - HWREG(RFCORE_XREG_RFIRQM0) = 0; - /* Enable RF interrupts 1, TXDONE only */ - HWREG(RFCORE_XREG_RFIRQM1) = 0; +void radio_rxNow (void) { + dyn_funcs [selected_radioSetting].radio_rxNow(); } -void radio_on(void){ - // CC2538_RF_CSP_ISFLUSHRX(); - CC2538_RF_CSP_ISRXON(); -} +void radio_getReceivedFrame ( + uint8_t* bufRead, + uint8_t* lenRead, + uint8_t maxBufLen, + int8_t* rssi, + uint8_t* lqi, + bool* crc +) { -void radio_off(void){ - /* Wait for ongoing TX to complete (e.g. this could be an outgoing ACK) */ - while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); - //CC2538_RF_CSP_ISFLUSHRX(); - - /* Don't turn off if we are off as this will trigger a Strobe Error */ - if(HWREG(RFCORE_XREG_RXENABLE) != 0) { - CC2538_RF_CSP_ISRFOFF(); - //clear fifo isr flag - HWREG(RFCORE_SFR_RFIRQF0) = ~(RFCORE_SFR_RFIRQF0_FIFOP|RFCORE_SFR_RFIRQF0_RXPKTDONE); - } + dyn_funcs [selected_radioSetting].radio_getReceivedFrame (bufRead, lenRead, maxBufLen, rssi, lqi, crc ); } +//=========================== private ========================================= + //=========================== callbacks ======================================= //=========================== interrupt handlers ============================== - -/** -\brief Stub function for the CC2538. - -In MSP430 platforms the CPU status after servicing an interrupt can be managed -toggling some bits in a special register, e.g. CPUOFF, LPM1, etc, within the -interrupt context itself. By default, after servicing an interrupt the CPU will -be off so it makes sense to return a value and enable it if something has -happened that needs the scheduler to run (a packet has been received that needs -to be processed). Otherwise, the CPU is kept in sleep mode without even -reaching the main loop. - -In the CC2538, however, the default behaviour is the contrary. After servicing -an interrupt the CPU will be on by default and it is the responsability of the -main thread to put it back to sleep (which is already done). This means that -the scheduler will always be kicked in after servicing an interrupt. This -behaviour can be changed by modifying the SLEEPEXIT field in the SYSCTRL -regiser (see page 131 of the CC2538 manual). -*/ kick_scheduler_t radio_isr(void) { - return DO_NOT_KICK_SCHEDULER; + return dyn_funcs [selected_radioSetting].radio_isr(); } -void radio_isr_internal(void) { - volatile PORT_TIMER_WIDTH capturedTime; - uint8_t irq_status0,irq_status1; - - debugpins_isr_set(); - - // capture the time - capturedTime = sctimer_readCounter(); - - // reading IRQ_STATUS - irq_status0 = HWREG(RFCORE_SFR_RFIRQF0); - irq_status1 = HWREG(RFCORE_SFR_RFIRQF1); - - IntPendClear(INT_RFCORERTX); - - //clear interrupt - HWREG(RFCORE_SFR_RFIRQF0) = 0; - HWREG(RFCORE_SFR_RFIRQF1) = 0; - - //STATUS0 Register - // start of frame event - if ((irq_status0 & RFCORE_SFR_RFIRQF0_SFD) == RFCORE_SFR_RFIRQF0_SFD) { - // change state - radio_vars.state = RADIOSTATE_RECEIVING; - if (radio_vars.startFrame_cb!=NULL) { - // call the callback - radio_vars.startFrame_cb(capturedTime); - debugpins_isr_clr(); - // kick the OS - return; - } else { - while(1); - } - } - - //or RXDONE is full -- we have a packet. - if (((irq_status0 & RFCORE_SFR_RFIRQF0_RXPKTDONE) == RFCORE_SFR_RFIRQF0_RXPKTDONE)) { - // change state - radio_vars.state = RADIOSTATE_TXRX_DONE; - if (radio_vars.endFrame_cb!=NULL) { - // call the callback - radio_vars.endFrame_cb(capturedTime); - debugpins_isr_clr(); - // kick the OS - return; - } else { - while(1); - } - } - - // or FIFOP is full -- we have a packet. - if (((irq_status0 & RFCORE_SFR_RFIRQF0_FIFOP) == RFCORE_SFR_RFIRQF0_FIFOP)) { - // change state - radio_vars.state = RADIOSTATE_TXRX_DONE; - if (radio_vars.endFrame_cb!=NULL) { - // call the callback - radio_vars.endFrame_cb(capturedTime); - debugpins_isr_clr(); - // kick the OS - return; - } else { - while(1); - } - } - - //STATUS1 Register - // end of frame event --either end of tx . - if (((irq_status1 & RFCORE_SFR_RFIRQF1_TXDONE) == RFCORE_SFR_RFIRQF1_TXDONE)) { - // change state - radio_vars.state = RADIOSTATE_TXRX_DONE; - if (radio_vars.endFrame_cb!=NULL) { - // call the callback - radio_vars.endFrame_cb(capturedTime); - debugpins_isr_clr(); - // kick the OS - return; - } else { - while(1); - } - } - debugpins_isr_clr(); - - return; -} -void radio_error_isr(void){ - uint8_t rferrm; - - rferrm = (uint8_t)HWREG(RFCORE_XREG_RFERRM); - - if ((HWREG(RFCORE_XREG_RFERRM) & (((0x02)<, September 2017. +*/ +#include "board.h" +#include "board_info.h" +#include "ssi.h" +#include "spi.h" +#include "gpio.h" +#include "ioc.h" +#include "sys_ctrl.h" + +#include +#include +#include +#include +#include +#include + + +//=========================== defines ========================================= + +#define SPI_PIN_SSI_CLK GPIO_PIN_2 // CLK +#define SPI_PIN_SSI_FSS GPIO_PIN_3 // CSn +#define SPI_PIN_SSI_RX GPIO_PIN_4 // MISO +#define SPI_PIN_SSI_TX GPIO_PIN_5 // MOSI +#define SPI_GPIO_SSI_BASE GPIO_A_BASE + +//=========================== variables ======================================= + +typedef struct { + // information about the current transaction + uint8_t* pNextTxByte; + uint16_t numTxedBytes; + uint16_t txBytesLeft; + spi_return_t returnType; + uint8_t* pNextRxByte; + uint16_t maxRxBytes; + spi_first_t isFirst; + spi_last_t isLast; + // state of the module + uint8_t busy; +#ifdef SPI_IN_INTERRUPT_MODE + // callback when module done + spi_cbt callback; +#endif +} spi_vars_t; + +spi_vars_t spi_vars; + +//=========================== prototypes ====================================== + +static void disableInterrupts(void); +static void enableInterrupts(void); + +//=========================== public ========================================== + +void spi_init() { + // clear variables + memset(&spi_vars,0,sizeof(spi_vars_t)); + + // set the clk miso and cs pins as output + GPIOPinTypeGPIOOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK); + GPIOPinTypeGPIOOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX); + GPIOPinTypeGPIOOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS); + + //set cs to high + GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS, SPI_PIN_SSI_FSS); + //set pins to low + GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX, 0); + GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK, 0); + + SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_SSI0); + SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_SSI0); + SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_SSI0); + + SSIDisable(SSI0_BASE); + SSIClockSourceSet(SSI0_BASE, SSI_CLOCK_PIOSC); + + IOCPinConfigPeriphOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK, IOC_MUX_OUT_SEL_SSI0_CLKOUT); + IOCPinConfigPeriphOutput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX, IOC_MUX_OUT_SEL_SSI0_TXD); + IOCPinConfigPeriphInput(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_RX, IOC_SSIRXD_SSI0); + + GPIOPinTypeSSI(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_CLK ); + GPIOPinTypeSSI(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_RX ); + GPIOPinTypeSSI(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_TX ); + + SSIConfigSetExpClk(SSI0_BASE, SysCtrlIOClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, /*SysCtrlIOClockGet()/2*/16000000, 8); + + // Enable the SSI0 module. + SSIEnable(SSI0_BASE); +} + +#ifdef SPI_IN_INTERRUPT_MODE +void spi_setCb(spi_cbt cb) { + spi_vars.spi_cb = cb; +} +#endif + +void spi_txrx(uint8_t* bufTx, + uint16_t lenbufTx, + spi_return_t returnType, + uint8_t* bufRx, + uint16_t maxLenBufRx, + spi_first_t isFirst, + spi_last_t isLast) { + + uint32_t data,i; + GPIOPinWrite(GPIO_B_BASE, GPIO_PIN_1, GPIO_PIN_1); + // register spi frame to send + spi_vars.pNextTxByte = bufTx; + spi_vars.numTxedBytes = 0; + spi_vars.txBytesLeft = lenbufTx; + spi_vars.returnType = returnType; + spi_vars.pNextRxByte = bufRx; + spi_vars.maxRxBytes = maxLenBufRx; + spi_vars.isFirst = isFirst; + spi_vars.isLast = isLast; + + // SPI is now busy + spi_vars.busy = 1; + + // lower CS signal to have slave listening + if (spi_vars.isFirst==SPI_FIRST) { + GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS, 0); + } + + for ( i = 0; i < lenbufTx; i++) + { + // Push a byte + SSIDataPut(SSI0_BASE, spi_vars.pNextTxByte[i]); + + // Wait until it is complete + while(SSIBusy(SSI0_BASE)); + + // Read a byte + SSIDataGet(SSI0_BASE, &data); + + // Store the result + spi_vars.pNextRxByte[i] = (uint8_t)(data & 0xFF); + // one byte less to go + } + + if (spi_vars.isLast==SPI_LAST) { + GPIOPinWrite(SPI_GPIO_SSI_BASE, SPI_PIN_SSI_FSS, SPI_PIN_SSI_FSS); + } + + // SPI is not busy anymore + spi_vars.busy = 0; + GPIOPinWrite(GPIO_B_BASE, GPIO_PIN_1, 0); +} + +//=========================== private ========================================= + +port_INLINE void enableInterrupts(void) +{ + // Enable the SPI interrupt + SSIIntEnable(SSI0_BASE, (SSI_TXFF | SSI_RXFF | SSI_RXTO | SSI_RXOR)); + + // Enable the SPI interrupt + IntEnable(INT_SSI0); +} + +port_INLINE void disableInterrupts(void) +{ + // Disable the SPI interrupt + SSIIntDisable(SSI0_BASE, (SSI_TXFF | SSI_RXFF | SSI_RXTO | SSI_RXOR)); + + // Disable the SPI interrupt + IntDisable(INT_SSI0); +} + +//=========================== interrupt handlers ============================== + +kick_scheduler_t spi_isr() { +#ifdef SPI_IN_INTERRUPT_MODE + uint32_t data; + // save the byte just received in the RX buffer + status = SSIIntStatus(SSI0_BASE, true); + + // Clear SPI interrupt in the NVIC + IntPendClear(INT_SSI0); + + SSIDataGet(SSI0_BASE, &data); + + // Store the result + spi_vars.pNextRxByte = (uint8_t)(data & 0xFF); + + // one byte less to go + spi_vars.pNextTxByte++; + spi_vars.pNextRxByte++; + spi_vars.txBytesLeft--; + + if (spi_vars.txBytesLeft>0) { + // write next byte to TX buffer + SSIDataPut(SSI0_BASE, *spi_vars.pNextTxByte); + + } else { + // SPI is not busy anymore + spi_vars.busy = 0; + + // SPI is done! + if (spi_vars.callback!=NULL) { + // call the callback + spi_vars.spi_cb(); + // kick the OS + return KICK_SCHEDULER; + } + } + +#endif + return DO_NOT_KICK_SCHEDULER; +} diff --git a/bsp/boards/openmote-b/startup_iar.c b/bsp/boards/openmote-b/startup_iar.c index e63d7bc74b..4b7c2ad585 100644 --- a/bsp/boards/openmote-b/startup_iar.c +++ b/bsp/boards/openmote-b/startup_iar.c @@ -39,8 +39,8 @@ #include #define FLASH_START_ADDR 0x00200000 -#define BOOTLOADER_BACKDOOR_ENABLE 0xF7FFFFFF // ENABLED: PORT A, PIN 6, LOW #define BOOTLOADER_BACKDOOR_DISABLE 0xEFFFFFFF +#define BOOTLOADER_BACKDOOR_ENABLE 0xF6FFFFFF // ENABLED: PORT A, PIN 6, LOW #define SYS_CTRL_EMUOVR 0x400D20B4 #define SYS_CTRL_I_MAP 0x400D2098 @@ -191,7 +191,7 @@ lockPageCCA_t; __root const lockPageCCA_t __cca @ ".flashcca" = { - BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor disabled + BOOTLOADER_BACKDOOR_ENABLE, // Bootloader backdoor enabled 0, // Image valid bytes FLASH_START_ADDR // Vector table located at flash start address }; diff --git a/bsp/boards/openmote-cc2538/board.c b/bsp/boards/openmote-cc2538/board.c index 9195d655a5..cb738b8533 100644 --- a/bsp/boards/openmote-cc2538/board.c +++ b/bsp/boards/openmote-cc2538/board.c @@ -3,7 +3,7 @@ * Pere Tuset (peretuset@openmote.com) * Date: July 2013 * Description: CC2538-specific definition of the "board" bsp module. - */ + **/ #include #include @@ -39,6 +39,10 @@ #else #define CC2538_FLASH_ADDRESS ( 0x0027F800 ) #endif + +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; + //=========================== prototypes ====================================== void board_timer_init(void); @@ -84,11 +88,50 @@ void board_init(void) { sensors_init(); cryptoengine_init(); pwm_init(); + board_init_slot_vars(); +} + +//==== bootstrapping slot info lookup table +void board_init_slot_vars(void){ + //10ms slot + slot_board_vars [SLOT_10ms].slotDuration = 328 ; // ms + slot_board_vars [SLOT_10ms].maxTxDataPrepare = 10 ; // 305us (measured 82us) + slot_board_vars [SLOT_10ms].maxRxAckPrepare = 10 ; // 305us (measured 83us) + slot_board_vars [SLOT_10ms].maxRxDataPrepare = 4 ; // 122us (measured 22us) + slot_board_vars [SLOT_10ms].maxTxAckPrepare = 10 ; // 122us (measured 94us) + #ifdef L2_SECURITY_ACTIVE + slot_board_vars [SLOT_10ms].delayTx = 14 ; // 366us (measured xxxus) + #else + slot_board_vars [SLOT_10ms].delayTx = 12 ; // 366us (measured xxxus) + #endif + slot_board_vars [SLOT_10ms].delayRx = 0 ; // 0us (can not measure) + + // 20ms slot + slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // ms + slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 10 ; // 305us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 15 ; // 457us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].delayTx = 13 ; // 396us (based on measurement) + slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) } +// To get the current slotDuration at any time +// used during initialization by sixtop to fire the first sixtop EB +uint16_t board_getSlotDuration (void) +{ + return slot_board_vars [selected_slot_type].slotDuration; +} + +// Setter/Getter function for slot_board_vars +slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) +{ + selected_slot_type = slot_type; + return slot_board_vars [selected_slot_type]; +} /** * Puts the board to sleep - */ + **/ void board_sleep(void) { SysCtrlPowerModeSet(SYS_CTRL_PM_NOACTION); SysCtrlSleep(); @@ -97,7 +140,7 @@ void board_sleep(void) { /** * Timer runs at 32 MHz and is 32-bit wide * The timer is divided by 32, whichs gives a 1 microsecond ticks - */ + **/ void board_timer_init(void) { // Configure the timer TimerConfigure(GPTIMER2_BASE, GPTIMER_CFG_PERIODIC_UP); @@ -109,7 +152,7 @@ void board_timer_init(void) { /** * Returns the current value of the timer * The timer is divided by 32, whichs gives a 1 microsecond ticks - */ + **/ uint32_t board_timer_get(void) { uint32_t current; @@ -121,7 +164,7 @@ uint32_t board_timer_get(void) { /** * Returns true if the timer has expired * The timer is divided by 32, whichs gives a 1 microsecond ticks - */ + **/ bool board_timer_expired(uint32_t future) { uint32_t current; int32_t remaining; @@ -139,7 +182,7 @@ bool board_timer_expired(uint32_t future) { /** * Resets the board - */ + **/ void board_reset(void) { SysCtrlReset(); } @@ -147,13 +190,13 @@ void board_reset(void) { //=========================== private ========================================= static void gpio_init(void) { - /* Set GPIOs as output */ + //Set GPIOs as output GPIOPinTypeGPIOOutput(GPIO_A_BASE, 0xFF); GPIOPinTypeGPIOOutput(GPIO_B_BASE, 0xFF); GPIOPinTypeGPIOOutput(GPIO_C_BASE, 0xFF); GPIOPinTypeGPIOOutput(GPIO_D_BASE, 0xFF); - /* Initialize GPIOs to low */ + //Initialize GPIOs to low GPIOPinWrite(GPIO_A_BASE, 0xFF, 0x00); GPIOPinWrite(GPIO_B_BASE, 0xFF, 0x00); GPIOPinWrite(GPIO_C_BASE, 0xFF, 0x00); @@ -161,35 +204,35 @@ static void gpio_init(void) { } static void clock_init(void) { - /* Disable global interrupts */ + //Disable global interrupts bool bIntDisabled = IntMasterDisable(); - /* Configure the 32 kHz pins, PD6 and PD7, for crystal operation */ - /* By default they are configured as GPIOs */ + //Configure the 32 kHz pins, PD6 and PD7, for crystal operation + //By default they are configured as GPIOs GPIODirModeSet(GPIO_D_BASE, 0x40, GPIO_DIR_MODE_IN); GPIODirModeSet(GPIO_D_BASE, 0x80, GPIO_DIR_MODE_IN); IOCPadConfigSet(GPIO_D_BASE, 0x40, IOC_OVERRIDE_ANA); IOCPadConfigSet(GPIO_D_BASE, 0x80, IOC_OVERRIDE_ANA); - /* Set the real-time clock to use the 32 kHz external crystal */ - /* Set the system clock to use the external 32 MHz crystal */ - /* Set the system clock to 32 MHz */ + //Set the real-time clock to use the 32 kHz external crystal + //Set the system clock to use the external 32 MHz crystal + //Set the system clock to 32 MHz SysCtrlClockSet(true, false, SYS_CTRL_SYSDIV_32MHZ); - /* Set the IO clock to operate at 16 MHz */ - /* This way peripherals can run while the system clock is gated */ + //Set the IO clock to operate at 16 MHz + //This way peripherals can run while the system clock is gated SysCtrlIOClockSet(SYS_CTRL_SYSDIV_16MHZ); - /* Wait until the selected clock configuration is stable */ + //Wait until the selected clock configuration is stable while (!((HWREG(SYS_CTRL_CLOCK_STA)) & (SYS_CTRL_CLOCK_STA_XOSC_STB))); - /* Define what peripherals run in each mode */ + //Define what peripherals run in each mode SysCtrlRunSetting(); SysCtrlSleepSetting(); SysCtrlDeepSleepSetting(); SysCtrlWakeupSetting(); - /* Re-enable interrupt if initially enabled */ + //Re-enable interrupt if initially enabled if (!bIntDisabled) { IntMasterEnable(); } @@ -197,48 +240,48 @@ static void clock_init(void) { /** * Configures the user button as input source - */ + **/ static void button_init(void) { volatile uint32_t i; - /* Delay to avoid pin floating problems */ + //Delay to avoid pin floating problems for (i = 0xFFFF; i != 0; i--); GPIOPinIntDisable(BSP_BUTTON_BASE, BSP_BUTTON_USER); GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER); - /* The button is an input GPIO on falling edge */ + //The button is an input GPIO on falling edge GPIOPinTypeGPIOInput(BSP_BUTTON_BASE, BSP_BUTTON_USER); GPIOIntTypeSet(BSP_BUTTON_BASE, BSP_BUTTON_USER, GPIO_FALLING_EDGE); - /* Register the interrupt */ + //Register the interrupt GPIOPortIntRegister(BSP_BUTTON_BASE, GPIO_C_Handler); - /* Clear and enable the interrupt */ + //Clear and enable the interrupt GPIOPinIntClear(BSP_BUTTON_BASE, BSP_BUTTON_USER); GPIOPinIntEnable(BSP_BUTTON_BASE, BSP_BUTTON_USER); user_button_initialized = TRUE; } static void SysCtrlRunSetting(void) { - /* Disable General Purpose Timers 0, 1, 2, 3 when running */ + //Disable General Purpose Timers 0, 1, 2, 3 when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_GPT0); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_GPT1); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_GPT3); - /* Disable SSI 0, 1 when running */ + //Disable SSI 0, 1 when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_SSI0); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_SSI1); - /* Disable UART1 when running */ + //Disable UART1 when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_UART1); - /* Disable I2C, AES and PKA when running */ + //Disable I2C, AES and PKA when running SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_I2C); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_PKA); SysCtrlPeripheralDisable(SYS_CTRL_PERIPH_AES); - /* Enable UART0 and RFC when running */ + //Enable UART0 and RFC when running SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_GPT2); SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_GPT3); SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_UART0); @@ -246,24 +289,24 @@ static void SysCtrlRunSetting(void) { } static void SysCtrlSleepSetting(void) { - /* Disable General Purpose Timers 0, 1, 2, 3 during sleep */ + //Disable General Purpose Timers 0, 1, 2, 3 during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_GPT0); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_GPT1); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_GPT3); - /* Disable SSI 0, 1 during sleep */ + //Disable SSI 0, 1 during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_SSI0); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_SSI1); - /* Disable UART 0, 1 during sleep */ + //Disable UART 0, 1 during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_UART1); - /* Disable I2C, PKA, AES during sleep */ + //Disable I2C, PKA, AES during sleep SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_I2C); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_PKA); SysCtrlPeripheralSleepDisable(SYS_CTRL_PERIPH_AES); - /* Enable UART and RFC during sleep */ + //Enable UART and RFC during sleep SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_GPT2); SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_GPT3); SysCtrlPeripheralSleepEnable(SYS_CTRL_PERIPH_UART0); @@ -271,21 +314,21 @@ static void SysCtrlSleepSetting(void) { } static void SysCtrlDeepSleepSetting(void) { - /* Disable General Purpose Timers 0, 1, 2, 3 during deep sleep */ + //Disable General Purpose Timers 0, 1, 2, 3 during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT0); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT1); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT2); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_GPT3); - /* Disable SSI 0, 1 during deep sleep */ + //Disable SSI 0, 1 during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_SSI0); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_SSI1); - /* Disable UART 0, 1 during deep sleep */ + //Disable UART 0, 1 during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_UART0); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_UART1); - /* Disable I2C, PKA, AES during deep sleep */ + //Disable I2C, PKA, AES during deep sleep SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_I2C); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_PKA); SysCtrlPeripheralDeepSleepDisable(SYS_CTRL_PERIPH_AES); @@ -293,7 +336,7 @@ static void SysCtrlDeepSleepSetting(void) { } static void SysCtrlWakeupSetting(void) { - /* Allow the SMTimer to wake up the processor */ + //Allow the SMTimer to wake up the processor GPIOIntWakeupEnable(GPIO_IWE_SM_TIMER); } @@ -302,18 +345,18 @@ static void SysCtrlWakeupSetting(void) { /** * GPIO_C interrupt handler. User button is GPIO_C_3 * Erases a Flash sector to trigger the bootloader backdoor - */ + **/ static void GPIO_C_Handler(void) { if (!user_button_initialized) return; - /* Disable the interrupts */ + //Disable the interrupts IntMasterDisable(); leds_all_off(); - /* Eras the CCA flash page */ + //Eras the CCA flash page FlashMainPageErase(CC2538_FLASH_ADDRESS); leds_circular_shift(); - /* Reset the board */ + //Reset the board SysCtrlReset(); } diff --git a/bsp/boards/openmote-cc2538/board_info.h b/bsp/boards/openmote-cc2538/board_info.h index 721f6e03fa..417f8845d2 100644 --- a/bsp/boards/openmote-cc2538/board_info.h +++ b/bsp/boards/openmote-cc2538/board_info.h @@ -58,44 +58,6 @@ #define PORT_PIN_RADIO_RESET_HIGH() // nothing #define PORT_PIN_RADIO_RESET_LOW() // nothing -//===== IEEE802154E timing - -#define SLOTDURATION 20 // in miliseconds - -//===== IEEE802154E timing - -#if SLOTDURATION==10 - // time-slot related - #define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet - // execution speed related - #define PORT_maxTxDataPrepare 10 // 305us (measured 82us) - #define PORT_maxRxAckPrepare 10 // 305us (measured 83us) - #define PORT_maxRxDataPrepare 4 // 122us (measured 22us) - #define PORT_maxTxAckPrepare 10 // 122us (measured 94us) - // radio speed related - #ifdef L2_SECURITY_ACTIVE - #define PORT_delayTx 14 // 366us (measured xxxus) - #else - #define PORT_delayTx 12 // 366us (measured xxxus) - #endif - #define PORT_delayRx 0 // 0us (can not measure) - // radio watchdog -#endif - -#if SLOTDURATION==20 - #define PORT_TsSlotDuration 655 // 20ms - - // execution speed related - #define PORT_maxTxDataPrepare 15 // 458us (measured 213us) - #define PORT_maxRxAckPrepare 10 // 305us (measured 86us) - #define PORT_maxRxDataPrepare 10 // 305us (measured 88us) - #define PORT_maxTxAckPrepare 15 // 458us (measured 211us) - - // radio speed related - #define PORT_delayTx 13 // 397us (measured 388us) - #define PORT_delayRx 0 // 0us (can not measure) -#endif - //===== adaptive_sync accuracy #define SYNC_ACCURACY 1 // ticks diff --git a/bsp/boards/openmote-cc2538/radio.c b/bsp/boards/openmote-cc2538/radio.c index b81dafeaa1..312e835884 100644 --- a/bsp/boards/openmote-cc2538/radio.c +++ b/bsp/boards/openmote-cc2538/radio.c @@ -45,6 +45,9 @@ typedef struct { radio_vars_t radio_vars; +// global radio selection, will use the slowest by default at initialization. +uint8_t selected_radioSetting = RADIOSETTING_24GHZ; + //=========================== prototypes ====================================== void enable_radio_interrupts(void); @@ -181,7 +184,12 @@ void radio_reset(void) { //===== RF admin -void radio_setFrequency(uint8_t frequency, radio_freq_t tx_or_rx) { +void radio_setConfig (radioSetting_t radioSetting){ + selected_radioSetting = radioSetting; + //do nothing +} + +void radio_setFrequency(uint16_t frequency, radio_freq_t tx_or_rx) { // change state radio_vars.state = RADIOSTATE_SETTING_FREQUENCY; diff --git a/bsp/boards/openmotestm/board.c b/bsp/boards/openmotestm/board.c index a0420b8a9a..4f9509e7fb 100644 --- a/bsp/boards/openmotestm/board.c +++ b/bsp/boards/openmotestm/board.c @@ -32,7 +32,9 @@ extern int mote_main(void); int main(void) { return mote_main(); } - +//=========================== variables ======================================= +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; //=========================== public ========================================== void board_init(void){ @@ -95,6 +97,37 @@ void board_init(void){ debugpins_init(); //enable nvic for the radio NVIC_radio(); + + board_init_slot_vars(); +} + +//==== bootstrapping slot info lookup table + +//===== IEEE802154E timing +void board_init_slot_vars(void){ + // 20ms slot + slot_board_vars [SLOT_20ms_24GHZ].slotDuration = 655 ; // ms + slot_board_vars [SLOT_20ms_24GHZ].maxTxDataPrepare = 66 ; // 2014us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxRxAckPrepare = 20 ; // 610us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxRxDataPrepare = 33 ; // 1007us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].maxTxAckPrepare = 30 ; // 915us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].delayTx = 10 ; // 305us (not measured) + slot_board_vars [SLOT_20ms_24GHZ].delayRx = 0 ; // 0us (can not measure) + +} + +// To get the current slotDuration at any time +// used during initialization by sixtop to fire the first sixtop EB +uint16_t board_getSlotDuration (void) +{ + return slot_board_vars [selected_slot_type].slotDuration; +} + +// Setter/Getter function for slot_board_vars +slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) +{ + selected_slot_type = slot_type; + return slot_board_vars [selected_slot_type]; } void board_sleep(void) { @@ -123,24 +156,24 @@ void board_reset(void){ void GPIO_Config_ALL_AIN(void){ GPIO_InitTypeDef GPIO_InitStructure; - /* Enable GPIOD and GPIOE clock */ + //Enable GPIOD and GPIOE clock RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO, ENABLE); - /* PA */ + //PA GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOA, &GPIO_InitStructure); - /* PB */ + //PB GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOB, &GPIO_InitStructure); - /* PC */ + //PC GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOC, &GPIO_InitStructure); - /* PD */ + //PD GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOD, &GPIO_InitStructure); diff --git a/bsp/boards/openmotestm/board_info.h b/bsp/boards/openmotestm/board_info.h index 0cfe4f67c0..43add1fb89 100644 --- a/bsp/boards/openmotestm/board_info.h +++ b/bsp/boards/openmotestm/board_info.h @@ -53,21 +53,6 @@ to return the board's description. #define PORT_PIN_RADIO_RESET_HIGH() //GPIOC->ODR |= 0X0040; #define PORT_PIN_RADIO_RESET_LOW() //GPIOC->ODR &= ~0X0040; -//===== IEEE802154E timing - -#define SLOTDURATION 20 // in miliseconds - -// time-slot related -#define PORT_TsSlotDuration 655 // counter counts one extra count, see datasheet -// execution speed related -#define PORT_maxTxDataPrepare 66 // 2014us (measured 746us) -#define PORT_maxRxAckPrepare 20 // 305us (measured 83us) -#define PORT_maxRxDataPrepare 33 // 1007us (measured 84us) -#define PORT_maxTxAckPrepare 30 // 305us (measured 219us) -// radio speed related -#define PORT_delayTx 10 // 214us (measured 219us) -#define PORT_delayRx 0 // 0us (can not measure) -// radio watchdog //===== adaptive_sync accuracy diff --git a/bsp/boards/python/board_info.h b/bsp/boards/python/board_info.h index bd753a556f..8bdab16286 100644 --- a/bsp/boards/python/board_info.h +++ b/bsp/boards/python/board_info.h @@ -29,20 +29,6 @@ #define SCHEDULER_WAKEUP() #define SCHEDULER_ENABLE_INTERRUPT() -#define SLOTDURATION 10 // in miliseconds - -//===== IEEE802154E timing -// time-slot related -#define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet -// execution speed related -#define PORT_maxTxDataPrepare 10 // 305us (measured 82us) -#define PORT_maxRxAckPrepare 10 // 305us (measured 83us) -#define PORT_maxRxDataPrepare 4 // 122us (measured 22us) -#define PORT_maxTxAckPrepare 4 // 122us (measured 94us) -// radio speed related -#define PORT_delayTx 7 // 366us (measured xxxus) -#define PORT_delayRx 0 // 0us (can not measure) - //===== adaptive_sync accuracy #define SYNC_ACCURACY 1 // when using openmoteSTM, change to 2 diff --git a/bsp/boards/python/board_obj.c b/bsp/boards/python/board_obj.c index 583a06b331..79dabe44a6 100644 --- a/bsp/boards/python/board_obj.c +++ b/bsp/boards/python/board_obj.c @@ -15,6 +15,8 @@ #include "sctimer_obj.h" //=========================== variables ======================================= +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; //=========================== prototypes ====================================== @@ -34,6 +36,8 @@ void board_init(OpenMote* self) { uart_init(self); radio_init(self); + board_init_slot_vars(); + // forward to Python result = PyObject_CallObject(self->callback[MOTE_NOTIF_board_init],NULL); if (result == NULL) { @@ -47,6 +51,33 @@ void board_init(OpenMote* self) { #endif } + +//==== bootstrapping slot info lookup table +void board_init_slot_vars(void){ + //10ms slot + slot_board_vars [SLOT_10ms].slotDuration = 328 ; // ms + slot_board_vars [SLOT_10ms].maxTxDataPrepare = 10 ; // 305us (measured 82us) + slot_board_vars [SLOT_10ms].maxRxAckPrepare = 10 ; // 305us (measured 83us) + slot_board_vars [SLOT_10ms].maxRxDataPrepare = 4 ; // 122us (measured 22us) + slot_board_vars [SLOT_10ms].maxTxAckPrepare = 4 ; // 122us (measured 94us) + slot_board_vars [SLOT_10ms].delayTx = 7 ; // 213us (measured xxxus) + slot_board_vars [SLOT_10ms].delayRx = 0 ; // 0us (can not measure) +} + +// To get the current slotDuration at any time +// used during initialization by sixtop to fire the first sixtop EB +uint16_t board_getSlotDuration (void) +{ + return slot_board_vars [selected_slot_type].slotDuration; +} + +// Setter/Getter function for slot_board_vars +slot_board_vars_t board_selectSlotTemplate (slotType_t slot_type) +{ + selected_slot_type = slot_type; + return slot_board_vars [selected_slot_type]; +} + void board_sleep(OpenMote* self) { PyObject* result; diff --git a/bsp/boards/python/radio_obj.c b/bsp/boards/python/radio_obj.c index d227f027f7..c24ab11db7 100644 --- a/bsp/boards/python/radio_obj.c +++ b/bsp/boards/python/radio_obj.c @@ -9,7 +9,8 @@ //=========================== defines ========================================= //=========================== variables ======================================= - +// global radio selection +uint8_t selected_radioSetting = RADIOSETTING_24GHZ; //=========================== prototypes ====================================== @@ -87,7 +88,13 @@ void radio_reset(OpenMote* self) { //===== RF admin -void radio_setFrequency(OpenMote* self, uint8_t frequency, radio_freq_t tx_or_rx) { +void radio_setConfig ( radioSetting_t radioSetting){ + selected_radioSetting = radioSetting; + //do nothing +} + + +void radio_setFrequency(OpenMote* self, uint16_t frequency, radio_freq_t tx_or_rx) { PyObject* result; PyObject* arglist; diff --git a/bsp/boards/radio.h b/bsp/boards/radio.h index df4333e870..9baae90501 100644 --- a/bsp/boards/radio.h +++ b/bsp/boards/radio.h @@ -47,6 +47,29 @@ typedef enum { FREQ_RX = 0x02, } radio_freq_t; +// radio settings available for the MAC layer and supported by openmote-b +typedef enum +{ + + // different "modulations" (AT86RF215-specific) + // At83rf215 settings start at index 0 because they are used directly in a sub-array in the atmel driver. + RADIOSETTING_FSK_OPTION1_FEC, + RADIOSETTING_OQPSK_RATE3, + RADIOSETTING_OFDM_OPTION_1_MCS0, + RADIOSETTING_OFDM_OPTION_1_MCS1, + RADIOSETTING_OFDM_OPTION_1_MCS2, + RADIOSETTING_OFDM_OPTION_1_MCS3, + + // default + RADIOSETTING_24GHZ, + + // can be useful for switching receiver between OFDMx MCS modes. + RADIOSETTING_NONE, + + RADIOSETTING_MAX + +} radioSetting_t; + //=========================== typedef ========================================= typedef void (*radio_capture_cbt)(PORT_TIMER_WIDTH timestamp); @@ -56,29 +79,49 @@ typedef void (*radio_capture_cbt)(PORT_TIMER_WIDTH timestamp); //=========================== prototypes ====================================== // admin +// used in MAC init void radio_init(void); +// referred to only inside projects. Never inside MAC or even drivers +void radio_powerOn(void); +// referred to in init and change of settings void radio_setStartFrameCb(radio_capture_cbt cb); void radio_setEndFrameCb(radio_capture_cbt cb); // reset +// I don't see it referenced anywhere in cource code. there are some references in pbi and pbd files void radio_reset(void); // RF admin -void radio_setFrequency(uint8_t frequency, radio_freq_t tx_or_rx); -//void radio_setFrequency(uint8_t frequency); +// This function never sets frequency in fact. It sets a "channel". It shoud change accordingly. +// Should be claculateChannel and it can take an 8 bit channel index. +void radio_setFrequency(uint16_t frequency, radio_freq_t tx_or_rx); + +void radio_setConfig(radioSetting_t radioSetting); + +//referred to in MAC init and in some projects void radio_rfOn(void); +//referenced at end of each rf activity in the MAC void radio_rfOff(void); +// not referenced in MAC but referenced in some projects int8_t radio_getFrequencyOffset(void); // TX #ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT +// why not put it under the scum implementation of loadpacket? void radio_loadPacket_prepare(uint8_t* packet, uint16_t len); #endif + + void radio_loadPacket(uint8_t* packet, uint16_t len); void radio_txEnable(void); void radio_txNow(void); // RX +//referenced in the MAC in scum context only. +// why not put it under the scum implementation of rxEnable? void radio_rxPacket_prepare(void); + void radio_rxEnable(void); +//referenced in the MAC in scum context only: why not have an implementation of rxEnable void radio_rxEnable_scum(void); void radio_rxNow(void); +// some older implementations support only 8bit lenRead and maxBufLen. They need to be generalized to 16bit because of big packets and to keep a flexible radio interface for non-openwsn applications where lengh can be up to 16bit) void radio_getReceivedFrame(uint8_t* bufRead, uint8_t* lenRead, uint8_t maxBufLen, @@ -87,6 +130,7 @@ void radio_getReceivedFrame(uint8_t* bufRead, bool* crc); // interrupt handlers +// kick_scheduler_t: a generalized version of this will need to maintain void return.? kick_scheduler_t radio_isr(void); /** diff --git a/bsp/boards/samr21_xpro/board.c b/bsp/boards/samr21_xpro/board.c index 25ed3b6e5b..46425b07a0 100644 --- a/bsp/boards/samr21_xpro/board.c +++ b/bsp/boards/samr21_xpro/board.c @@ -32,7 +32,7 @@ * */ -/* === INCLUDES ============================================================ */ +//=== INCLUDES ============================================================ #include "sam.h" #include "samr21_extint.h" #include "samr21_flash.h" @@ -55,19 +55,22 @@ #include "leds.h" #include "delay.h" +//=========================== variables ======================================= +slot_board_vars_t slot_board_vars [MAX_SLOT_TYPES]; +slotType_t selected_slot_type; -/* === MACROS ============================================================== */ +//=== MACROS ============================================================== -/* TRX Parameter: t10 */ +//TRX Parameter: t10 #define RST_PULSE_WIDTH_US (10) -/* TRX Parameter: tTR1 typical value */ +//TRX Parameter: tTR1 typical value #define P_ON_TO_CLKM_AVAILABLE_TYP_US (330) #define TRX_EXT_INT_CH (0) -/* === GLOBALS ============================================================= */ +//=== GLOBALS ============================================================= extern int mote_main(); @@ -98,43 +101,46 @@ int main(void) */ void board_init(void) { - /* Disable the irq before initialization */ + //Disable the irq before initialization cpu_irq_disable(); - /* Initialize the Clock and event system and more */ + // Initialize the Clock and event system and more sys_clock_init(); - /* Configure the Debug Pins */ + //Configure the Debug Pins debugpins_init(); - /* Configure the Radio Interrupt */ + //Configure the Radio Interrupt at86rfx_intc_init(); - /* Clear the Radio Interrupt */ + //Clear the Radio Interrupt extint_flag_clear(TRX_EXT_INT_CH); -/* Initialize board hardware - SPI Init Configure the Radio Pins and Like RST, SLP_TR, EXTI(IRQ on Rising Edge) - */ +// Initialize board hardware +// SPI Init Configure the Radio Pins and Like RST, SLP_TR, EXTI(IRQ on Rising Edge) + rf_interface_init(); - /* Initialize the LED Output */ + //Initialize the LED Output leds_init(); - /* Initialize the Button Input */ + //Initialize the Button Input button_init(); - /* Radio Init */ + //Radio Init radio_init(); - /* UART Init */ + //UART Init uart_init(); - /* BSP Timer Init*/ + //BSP Timer Init sctimer_init(); - /* Clear the Radio Interrupt */ + //Initialize slot vars + board_init_slot_vars(); + + //Clear the Radio Interrupt extint_enable_irq(TRX_EXT_INT_CH); - /* Enable the IRQ */ + //Enable the IRQ cpu_irq_enable(); } @@ -149,7 +155,7 @@ void board_init(void) void rf_interface_init(void) { pinmux_t pinmux; - /* Configure the RF233 SPI Interface */ + //Configure the RF233 SPI Interface pinmux.dir = PORT_PIN_DIR_OUTPUT; pinmux.mux_loc = SYSTEM_PINMUX_GPIO; pinmux.pull = PORT_PIN_PULLUP; @@ -169,7 +175,7 @@ void rf_interface_init(void) port_pin_set_level(AT86RFX_RST_PIN, SET_HIGH); port_pin_set_level(AT86RFX_SLP_PIN, SET_HIGH); - /* Enable the RF Block */ + //Enable the RF Block PM->APBCMASK.reg |= (1<>. 0x64 = txPwr=>0x04, max: 0x1F. - {RG_BBC0_IRQM, 0x1F},// TXFE, RXEM, RXAM, RXFE, RXFS interrupts enabled + {RG_RF09_PAC, 0x7F}, // Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F. + {RG_BBC0_IRQM, 0x1F}, // TXFE, RXEM, RXAM, RXFE, RXFS interrupts enabled {RG_BBC1_IRQM, 0x00}, - {RG_BBC0_PC, 0x1D},// No FCS filter, 32 bits FCS, FSK. >Mina: used to be 15. Set to 1D to use 16 bit FCS - {RG_BBC0_FSKDM, 0x01},//Direct modulation and preemphasis enabled. + {RG_BBC0_PC, 0x1D}, // No FCS filter, 16 bits FCS, FSK. + {RG_BBC0_FSKDM, 0x01}, //Direct modulation and preemphasis enabled. {RG_BBC0_FSKC0, 0xD6}, {RG_BBC0_FSKC1, 0x00}, // {RG_BBC0_FSKC2, 0x00}, @@ -4071,8 +4071,8 @@ static const registerSetting_t basic_settings_fsk_option3 []={ //DO NOT USE {RG_BBC0_FSKPHRTX, 0x00},// No data whitening SFD0 used. }; //------------------------------------ OQPSK -----------------------------------// -static const registerSetting_t basic_settings_oqpsk_rate1[] = { - {RG_BBC0_PC, 0x17}, +static const registerSetting_t basic_settings_oqpsk_rate0[] = { + {RG_BBC0_PC, 0x1F}, // 16bit FCS {RG_BBC0_OQPSKPHRTX, 0x00}, // MR-OQPSK, rate mode 0 {RG_BBC0_OQPSKC0, 0x10}, // 100kchips/s, RC-0.8 shaping, direct-modulation enabled // {RG_BBC0_OQPSKC1, 0x3F}, // MINIMUM preamble-detection sensitivities, rx-override disabled @@ -4092,7 +4092,7 @@ static const registerSetting_t basic_settings_oqpsk_rate1[] = { {RG_RF09_PAC, 0x7F},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F. }; -static const registerSetting_t basic_settings_oqpsk_rate2[] = { +static const registerSetting_t basic_settings_oqpsk_rate1[] = { {RG_BBC0_PC, 0x17}, {RG_BBC0_OQPSKPHRTX, 0x02}, // MR-OQPSK, rate mode 0 {RG_BBC0_OQPSKC0, 0x10}, // 100kchips/s, RC-0.8 shaping, direct-modulation enabled @@ -4113,9 +4113,9 @@ static const registerSetting_t basic_settings_oqpsk_rate2[] = { {RG_RF09_PAC, 0x7F},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F. }; -static const registerSetting_t basic_settings_oqpsk_rate3[] = { +static const registerSetting_t basic_settings_oqpsk_rate2[] = { {RG_BBC0_PC, 0x1F}, // Mina: used to be 17 but change to 1F make 2B FCS - {RG_BBC0_OQPSKPHRTX, 0x04}, // MR-OQPSK, rate mode 0 + {RG_BBC0_OQPSKPHRTX, 0x04}, // MR-OQPSK, rate mode 3 {RG_BBC0_OQPSKC0, 0x10}, // 100kchips/s, RC-0.8 shaping, direct-modulation enabled // {RG_BBC0_OQPSKC1, 0x3F}, // MINIMUM preamble-detection sensitivities, rx-override disabled // {RG_BBC0_OQPSKC2, 0x00}, // listen for MR-OQPSK frames only @@ -4134,9 +4134,9 @@ static const registerSetting_t basic_settings_oqpsk_rate3[] = { {RG_RF09_PAC, 0x7F},// Tx Power 5 bits >>. 0x64 = txPwr=>0x04, max: 0x1F. }; -static const registerSetting_t basic_settings_oqpsk_rate4[] = { - {RG_BBC0_PC, 0x17}, - {RG_BBC0_OQPSKPHRTX, 0x06}, // MR-OQPSK, rate mode 0 +static registerSetting_t basic_settings_oqpsk_rate3[] = { + {RG_BBC0_PC, 0x1F}, // 16 bit FCS + {RG_BBC0_OQPSKPHRTX, 0x06}, // MR-OQPSK, rate mode 0//ERORR {RG_BBC0_OQPSKC0, 0x10}, // 100kchips/s, RC-0.8 shaping, direct-modulation enabled // {RG_BBC0_OQPSKC1, 0x3F}, // MINIMUM preamble-detection sensitivities, rx-override disabled // {RG_BBC0_OQPSKC2, 0x00}, // listen for MR-OQPSK frames only @@ -4178,7 +4178,7 @@ static const registerSetting_t basic_settings_oqpsk_250kbps[] = { //------------------------------------ OFDM -----------------------------------// /** Preferred settings for OFDM */ -static const registerSetting_t basic_settings_ofdm_1_mcs0[] = { +static registerSetting_t basic_settings_ofdm_1_mcs0[] = { {RG_RF09_CMD, 0x02}, {RG_RF09_IRQM, 0x1F}, {RG_RF24_IRQM, 0x00}, @@ -4196,7 +4196,7 @@ static const registerSetting_t basic_settings_ofdm_1_mcs0[] = { {RG_BBC0_OFDMPHRTX, 0x00}, }; -static const registerSetting_t basic_settings_ofdm_1_mcs1[] = { +static registerSetting_t basic_settings_ofdm_1_mcs1[] = { {RG_RF09_CMD, 0x02}, {RG_RF09_IRQM, 0x1F}, {RG_RF24_IRQM, 0x00}, @@ -4214,7 +4214,7 @@ static const registerSetting_t basic_settings_ofdm_1_mcs1[] = { {RG_BBC0_OFDMPHRTX, 0x01}, }; -static const registerSetting_t basic_settings_ofdm_1_mcs2[] = { +static registerSetting_t basic_settings_ofdm_1_mcs2[] = { {RG_RF09_CMD, 0x02}, {RG_RF09_IRQM, 0x1F}, {RG_RF24_IRQM, 0x00}, @@ -4232,7 +4232,7 @@ static const registerSetting_t basic_settings_ofdm_1_mcs2[] = { {RG_BBC0_OFDMPHRTX, 0x02}, }; -static const registerSetting_t basic_settings_ofdm_1_mcs3[] = { //TODO +static registerSetting_t basic_settings_ofdm_1_mcs3[] = { //TODO {RG_RF09_CMD, 0x02}, {RG_RF09_IRQM, 0x1F}, {RG_RF24_IRQM, 0x00}, diff --git a/bsp/chips/at86rf215/radio.h b/bsp/chips/at86rf215/radio.h deleted file mode 100644 index b8b810db38..0000000000 --- a/bsp/chips/at86rf215/radio.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef __RADIO_H -#define __RADIO_H - -/** -\addtogroup BSP -\{ -\addtogroup radio -\{ - -\brief Cross-platform declaration "radio" bsp module. - -\author Thomas Watteyne , February 2012. -*/ - -/* -\modifications to implement the IEEE 802.15.4-SUN -\done by Jonathan Munoz -*/ - -#include "at86rf215.h" - -//=========================== define ========================================== - -#define LENGTH_CRC 2 - -//=========================== typedef ========================================= - -/** -\brief Current state of the radio. - -\note This radio driver is very minimal in that it does not follow a state machine. - It is up to the MAC layer to ensure that the different radio operations - are called in the righr order. The radio keeps a state for debugging purposes only. -*/ -typedef enum { - RADIOSTATE_STOPPED = 0x00, ///< Completely stopped. - RADIOSTATE_RFOFF = 0x01, ///< Listening for commands, but RF chain is off. - RADIOSTATE_SETTING_FREQUENCY = 0x02, ///< Configuring the frequency. - RADIOSTATE_FREQUENCY_SET = 0x03, ///< Done configuring the frequency. - RADIOSTATE_LOADING_PACKET = 0x04, ///< Loading packet into the radio's TX buffer. - RADIOSTATE_PACKET_LOADED = 0x05, ///< Packet is fully loaded in the radio's TX buffer. - RADIOSTATE_ENABLING_TX = 0x06, ///< The RF TX chaing is being enabled (includes locking the PLL). - RADIOSTATE_TX_ENABLED = 0x07, ///< Radio ready to transmit. - RADIOSTATE_TRANSMITTING = 0x08, ///< Busy transmitting bytes. - RADIOSTATE_ENABLING_RX = 0x09, ///< The RF RX chain is being enabled (includes locking the PLL). - RADIOSTATE_LISTENING = 0x0a, ///< RF chain is on, listening, but no packet received yet. - RADIOSTATE_RECEIVING = 0x0b, ///< Busy receiving bytes. - RADIOSTATE_TXRX_DONE = 0x0c, ///< Frame has been sent/received completely. - RADIOSTATE_TURNING_OFF = 0x0d, ///< Turning the RF chain off. -} radio_state_t; - -typedef enum { - FREQ_TX = 0x01, - FREQ_RX = 0x02, -} radio_freq_t; - -typedef void (*radio_capture_cbt)(PORT_TIMER_WIDTH timestamp); - -//=========================== variables ======================================= - -//=========================== prototypes ====================================== - -// admin -void radio_powerOn(void); -void radio_init(void); -void radio_setStartFrameCb(radio_capture_cbt cb); -void radio_setEndFrameCb(radio_capture_cbt cb); -// reset -void radio_reset(void); -// RF admin -void radio_setFrequency(uint16_t channel, radio_freq_t tx_or_rx); -void radio_rfOn(void); -void radio_rfOff(void); -void radio_change_modulation(registerSetting_t * mod); -void radio_change_size(uint16_t* size); -// TX -void radio_loadPacket(uint8_t* packet, uint16_t len); -void radio_txEnable(void); -void radio_txNow(void); -// RX -void radio_rxEnable(void); -void radio_rxNow(void); -void radio_getReceivedFrame(uint8_t* bufRead, - uint16_t* lenRead, - uint16_t maxBufLen, - int8_t* rssi, - uint8_t* lqi, - bool* crc); - -// interrupt handlers -void radio_isr(void); - -/** -\} -\} -*/ - -#endif diff --git a/bsp/chips/at86rf215/radio.c b/bsp/chips/at86rf215/radio_at86rf215.c similarity index 53% rename from bsp/chips/at86rf215/radio.c rename to bsp/chips/at86rf215/radio_at86rf215.c index 1171388777..7fe319fee6 100644 --- a/bsp/chips/at86rf215/radio.c +++ b/bsp/chips/at86rf215/radio_at86rf215.c @@ -2,16 +2,17 @@ \brief at86rf215-specific definition of the "radio" bsp module. \author Jonathan Munoz , July 2016. -*/ +Modified by Mina Rady +*/ #include "board.h" -#include "radio.h" #include "spi.h" #include "debugpins.h" #include "leds.h" #include "sctimer.h" + #include #include #include @@ -23,6 +24,11 @@ #include #include +#include "radio.h" +#include "radio_at86rf215.h" +#include "at86rf215.h" + + #define AT86RF215_IRQ_BASE ( GPIO_D_BASE ) #define AT86RF215_IRQ_PIN ( GPIO_PIN_0 ) #define AT86RF215_IRQ_IOC ( IOC_OVERRIDE_DIS ) @@ -43,28 +49,20 @@ #define ATMEL_FREQUENCY_TYPE FREQ_SUGHZ #endif -//=========================== variables ======================================= +//=========================== variables ========================================== +radio_vars_at86rf215_t radio_vars_at86rf215; -typedef struct { - radio_capture_cbt startFrame_cb; - radio_capture_cbt endFrame_cb; - radio_state_t state; - uint8_t rf09_isr; - uint8_t rf24_isr; - uint8_t bb0_isr; - uint8_t bb1_isr; -} radio_vars_t; - -radio_vars_t radio_vars; +// open radio register mapping: an array of pointers to registersettings arrays +radio_config_t radio_api; //=========================== public ========================================== -static void radio_read_isr(void); -static void radio_clear_isr(void); +static void radio_read_isr_at86rf215(void); +static void radio_clear_isr_at86rf215(void); //===== admin -void radio_powerOn(void) { +void radio_powerOn_at86rf215(void) { volatile uint32_t delay; GPIOPinTypeGPIOOutput(GPIO_C_BASE, GPIO_PIN_0); @@ -84,32 +82,31 @@ void radio_powerOn(void) { } -void radio_reset(void) { +void radio_reset_at86rf215(void) { at86rf215_spiWriteReg( RG_RF_RST, CMD_RF_RESET); } -void radio_init(void) { - - uint16_t i; +void radio_init_at86rf215(void) { + //power it on and configure pins - radio_powerOn(); + radio_powerOn_at86rf215(); spi_init(); // clear variables - memset(&radio_vars,0,sizeof(radio_vars_t)); + memset(&radio_vars_at86rf215,0,sizeof(radio_vars_at86rf215_t)); // change state - radio_vars.state = RADIOSTATE_STOPPED; + radio_vars_at86rf215.state = RADIOSTATE_STOPPED; // reset radio - radio_reset(); + radio_reset_at86rf215(); at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE); while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF); // change state - radio_vars.state = RADIOSTATE_RFOFF; + radio_vars_at86rf215.state = RADIOSTATE_RFOFF; //configure external radio interrupt in pin D0 GPIOPinIntDisable(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN); @@ -121,7 +118,7 @@ void radio_init(void) { GPIOPinIntClear(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN); /* Register the interrupt */ - GPIOPortIntRegister(AT86RF215_IRQ_BASE, radio_isr); + GPIOPortIntRegister(AT86RF215_IRQ_BASE, radio_isr_internal_at86rf215); /* Clear and enable the interrupt */ GPIOPinIntEnable(AT86RF215_IRQ_BASE, AT86RF215_IRQ_PIN); @@ -130,28 +127,37 @@ void radio_init(void) { if ((at86rf215_spiReadReg(RG_RF_PN) != 0x34) | (at86rf215_spiReadReg(RG_RF_VN) != 0x03)) { while(1); //UNKNOWN DEVICE, FINISH } - // Write registers to radio -- configuration 2-FSK-50kbps - if (ATMEL_FREQUENCY_TYPE==FREQ_SUGHZ){ - for( i = 0; i < (sizeof(basic_settings_fsk_option1)/sizeof(registerSetting_t)); i++) { - at86rf215_spiWriteReg( basic_settings_fsk_option1[i].addr, basic_settings_fsk_option1[i].data); - }; - } else { - for( i = 0; i < (sizeof(basic_settings_oqpsk_250kbps)/sizeof(registerSetting_t)); i++) { - at86rf215_spiWriteReg( basic_settings_oqpsk_250kbps[i].addr, basic_settings_oqpsk_250kbps[i].data); - }; - } - - - radio_read_isr(); + + //Initialize the lookup table for register configurations + + radio_local_bootstrap_at86rf215(); + + // select the radio configuration to use -- configuration 2-FSK-50kbps + radio_setConfig_at86rf215 (RADIOSETTING_FSK_OPTION1_FEC); + radio_read_isr_at86rf215(); } -void radio_change_size(uint16_t* size){ +void radio_change_size_at86rf215(uint16_t* size){ static int i = 0; *size = sizes[i%4]; i++; } -void radio_change_modulation(registerSetting_t * mod){ +// This function accepts one of the existing radio presets and writes them to the radio chip. +void radio_setConfig_at86rf215(radioSetting_t radioSetting){ + uint16_t _register; + + at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE); + while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF); + + for( _register = 0; _register < radio_api.size[radioSetting]; _register++) { + at86rf215_spiWriteReg(radio_api.radios[radioSetting][_register].addr, radio_api.radios[radioSetting][_register].data); + }; + radio_read_isr_at86rf215(); +} + +// This function writes a specific set of register values to customize the configuration of the radio chip +void radio_change_modulation_at86rf215(registerSetting_t * mod){ static int mod_list = 1; uint16_t i; @@ -161,23 +167,23 @@ void radio_change_modulation(registerSetting_t * mod){ for( i = 0; i < (sizeof(*mod)/sizeof(registerSetting_t)); i++) { at86rf215_spiWriteReg( mod[i].addr, mod[i].data); }; - radio_read_isr(); + radio_read_isr_at86rf215(); mod_list++; } -void radio_setStartFrameCb(radio_capture_cbt cb) { - radio_vars.startFrame_cb = cb; +void radio_setStartFrameCb_at86rf215(radio_capture_cbt cb) { + radio_vars_at86rf215.startFrame_cb = cb; } -void radio_setEndFrameCb(radio_capture_cbt cb) { - radio_vars.endFrame_cb = cb; +void radio_setEndFrameCb_at86rf215(radio_capture_cbt cb) { + radio_vars_at86rf215.endFrame_cb = cb; } //===== RF admin //channel spacing in KHz //frequency_0 in kHz //frequency_nb integer -void radio_setFrequency(uint16_t channel, radio_freq_t tx_or_rx) { +void radio_setFrequency_at86rf215(uint16_t channel, radio_freq_t tx_or_rx) { uint16_t frequency_0; @@ -203,19 +209,19 @@ void radio_setFrequency(uint16_t channel, radio_freq_t tx_or_rx) { } // change state - radio_vars.state = RADIOSTATE_FREQUENCY_SET; + radio_vars_at86rf215.state = RADIOSTATE_FREQUENCY_SET; } -void radio_rfOn(void) { +void radio_rfOn_at86rf215(void) { //put the radio in the TRXPREP state at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE); while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF); } -void radio_rfOff(void) { +void radio_rfOff_at86rf215(void) { // change state - radio_vars.state = RADIOSTATE_TURNING_OFF; + radio_vars_at86rf215.state = RADIOSTATE_TURNING_OFF; at86rf215_spiStrobe(CMD_RF_TRXOFF, ATMEL_FREQUENCY_TYPE); while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TRXOFF); @@ -224,10 +230,10 @@ void radio_rfOff(void) { leds_radio_off(); // change state - radio_vars.state = RADIOSTATE_RFOFF; + radio_vars_at86rf215.state = RADIOSTATE_RFOFF; } -int8_t radio_getFrequencyOffset(void){ +int8_t radio_getFrequencyOffset_at86rf215(void){ // not available return 0; @@ -235,23 +241,23 @@ int8_t radio_getFrequencyOffset(void){ //===== TX -void radio_loadPacket(uint8_t* packet, uint16_t len) { +void radio_loadPacket_at86rf215(uint8_t* packet, uint16_t len) { - radio_vars.state = RADIOSTATE_LOADING_PACKET; + radio_vars_at86rf215.state = RADIOSTATE_LOADING_PACKET; at86rf215_spiWriteFifo(packet, len, ATMEL_FREQUENCY_TYPE); // change state - radio_vars.state = RADIOSTATE_PACKET_LOADED; + radio_vars_at86rf215.state = RADIOSTATE_PACKET_LOADED; //at86rf215_readBurst(0x0306, packet, len); } -radio_state_t radio_getState(void){ - return radio_vars.state; +radio_state_t radio_getState_at86rf215(void){ + return radio_vars_at86rf215.state; } -void radio_txEnable(void) { +void radio_txEnable_at86rf215(void) { // change state - radio_vars.state = RADIOSTATE_ENABLING_TX; + radio_vars_at86rf215.state = RADIOSTATE_ENABLING_TX; at86rf215_spiStrobe(CMD_RF_TXPREP, ATMEL_FREQUENCY_TYPE); while(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_TXPREP); @@ -260,41 +266,41 @@ void radio_txEnable(void) { debugpins_radio_set(); leds_radio_on(); - radio_vars.state = RADIOSTATE_TX_ENABLED; + radio_vars_at86rf215.state = RADIOSTATE_TX_ENABLED; } -void radio_txNow(void) { +void radio_txNow_at86rf215(void) { PORT_TIMER_WIDTH capturedTime; // change state - radio_vars.state = RADIOSTATE_TRANSMITTING; + radio_vars_at86rf215.state = RADIOSTATE_TRANSMITTING; at86rf215_spiStrobe(CMD_RF_TX, ATMEL_FREQUENCY_TYPE); - if (radio_vars.startFrame_cb!=NULL) { + if (radio_vars_at86rf215.startFrame_cb!=NULL) { // capture the time capturedTime = sctimer_readCounter(); // call the callback - radio_vars.startFrame_cb(capturedTime); + radio_vars_at86rf215.startFrame_cb(capturedTime); } } //===== RX -void radio_rxEnable(void) { +void radio_rxEnable_at86rf215(void) { // change state - radio_vars.state = RADIOSTATE_ENABLING_RX; + radio_vars_at86rf215.state = RADIOSTATE_ENABLING_RX; // wiggle debug pin debugpins_radio_set(); leds_radio_on(); at86rf215_spiStrobe(CMD_RF_RX, ATMEL_FREQUENCY_TYPE); // change state - radio_vars.state = RADIOSTATE_LISTENING; + radio_vars_at86rf215.state = RADIOSTATE_LISTENING; } -void radio_rxNow(void) { +void radio_rxNow_at86rf215(void) { //nothing to do if(at86rf215_status(ATMEL_FREQUENCY_TYPE) != RF_STATE_RX){ leds_error_toggle(); @@ -302,10 +308,10 @@ void radio_rxNow(void) { } } -void radio_getReceivedFrame( +void radio_getReceivedFrame_at86rf215( uint8_t* bufRead, - uint16_t* lenRead, - uint16_t maxBufLen, + uint8_t* lenRead, + uint8_t maxBufLen, int8_t* rssi, uint8_t* lqi, bool* crc @@ -324,7 +330,7 @@ void radio_getReceivedFrame( } // read the received packet from the RXFIFO - at86rf215_spiReadRxFifo(bufRead, lenRead, ATMEL_FREQUENCY_TYPE, maxBufLen); + at86rf215_spiReadRxFifo(bufRead, (uint16_t*)lenRead, ATMEL_FREQUENCY_TYPE, maxBufLen); *rssi = at86rf215_spiReadReg(register_edv); *crc = (at86rf215_spiReadReg(register_bbc_pc)>>5); @@ -332,23 +338,48 @@ void radio_getReceivedFrame( //=========================== private ========================================= -void radio_read_isr(void){ +//This function creates a matrix of register configurations of each modulation supported by the readio chip. It is used for dynamic modulation change inside the chip. +void radio_local_bootstrap_at86rf215(void){ + + radio_api.radios [RADIOSETTING_FSK_OPTION1_FEC] = basic_settings_fsk_option1; + radio_api.radios [RADIOSETTING_OQPSK_RATE3] = basic_settings_oqpsk_rate3; + radio_api.radios [RADIOSETTING_OFDM_OPTION_1_MCS0] = basic_settings_ofdm_1_mcs0; + radio_api.radios [RADIOSETTING_OFDM_OPTION_1_MCS1] = basic_settings_ofdm_1_mcs1; + radio_api.radios [RADIOSETTING_OFDM_OPTION_1_MCS2] = basic_settings_ofdm_1_mcs2; + radio_api.radios [RADIOSETTING_OFDM_OPTION_1_MCS3] = basic_settings_ofdm_1_mcs3; + + radio_api.size [RADIOSETTING_FSK_OPTION1_FEC] = sizeof(basic_settings_fsk_option1)/sizeof(registerSetting_t); + radio_api.size [RADIOSETTING_OQPSK_RATE3] = sizeof(basic_settings_oqpsk_rate3)/sizeof(registerSetting_t); + radio_api.size [RADIOSETTING_OFDM_OPTION_1_MCS0] = sizeof(basic_settings_ofdm_1_mcs0)/sizeof(registerSetting_t); + radio_api.size [RADIOSETTING_OFDM_OPTION_1_MCS1] = sizeof(basic_settings_ofdm_1_mcs1)/sizeof(registerSetting_t); + radio_api.size [RADIOSETTING_OFDM_OPTION_1_MCS2] = sizeof(basic_settings_ofdm_1_mcs2)/sizeof(registerSetting_t); + radio_api.size [RADIOSETTING_OFDM_OPTION_1_MCS3] = sizeof(basic_settings_ofdm_1_mcs3)/sizeof(registerSetting_t); +} +void radio_read_isr_at86rf215(void){ uint8_t flags[4]; at86rf215_read_isr(flags, ATMEL_FREQUENCY_TYPE); - radio_vars.rf09_isr = flags[0]; - radio_vars.rf24_isr = flags[1]; - radio_vars.bb0_isr = flags[2]; - radio_vars.bb1_isr = flags[3]; + radio_vars_at86rf215.rf09_isr = flags[0]; + radio_vars_at86rf215.rf24_isr = flags[1]; + radio_vars_at86rf215.bb0_isr = flags[2]; + radio_vars_at86rf215.bb1_isr = flags[3]; } + //=========================== callbacks ======================================= //=========================== interrupt handlers ============================== -void radio_isr(void) { + +// Wrapper function for radio_isr_at86rf215 to be called by the radio interrupt +void radio_isr_internal_at86rf215(void) { + + kick_scheduler_t ks = radio_isr_at86rf215(); + +} +kick_scheduler_t radio_isr_at86rf215(void) { PORT_TIMER_WIDTH capturedTime; - // kick_scheduler_t result = DO_NOT_KICK_SCHEDULER; + kick_scheduler_t result = DO_NOT_KICK_SCHEDULER; debugpins_isr_set(); @@ -357,50 +388,52 @@ void radio_isr(void) { // capture the time capturedTime = sctimer_readCounter(); //get isr that happened from radio - radio_read_isr(); + radio_read_isr_at86rf215(); - if (radio_vars.bb0_isr & IRQS_RXFS_MASK){ - radio_vars.state = RADIOSTATE_RECEIVING; - if (radio_vars.startFrame_cb!=NULL) { + if (radio_vars_at86rf215.bb0_isr & IRQS_RXFS_MASK){ + radio_vars_at86rf215.state = RADIOSTATE_RECEIVING; + if (radio_vars_at86rf215.startFrame_cb!=NULL) { // call the callback - radio_vars.startFrame_cb(capturedTime); + radio_vars_at86rf215.startFrame_cb(capturedTime); // kick the OS - // result = KICK_SCHEDULER; + result = KICK_SCHEDULER; } else { //while(1); } } else { - if ((radio_vars.bb0_isr & IRQS_TXFE_MASK)){ - radio_vars.state = RADIOSTATE_TXRX_DONE; - if (radio_vars.endFrame_cb!=NULL) { + if ((radio_vars_at86rf215.bb0_isr & IRQS_TXFE_MASK)){ + radio_vars_at86rf215.state = RADIOSTATE_TXRX_DONE; + if (radio_vars_at86rf215.endFrame_cb!=NULL) { // call the callback - radio_vars.endFrame_cb(capturedTime); + radio_vars_at86rf215.endFrame_cb(capturedTime); // kick the OS - // result = KICK_SCHEDULER; + result = KICK_SCHEDULER; } else { //while(1); } } else { - if ((radio_vars.bb0_isr & IRQS_RXFE_MASK)){ - radio_vars.state = RADIOSTATE_TXRX_DONE; - if (radio_vars.endFrame_cb!=NULL) { + if ((radio_vars_at86rf215.bb0_isr & IRQS_RXFE_MASK)){ + radio_vars_at86rf215.state = RADIOSTATE_TXRX_DONE; + if (radio_vars_at86rf215.endFrame_cb!=NULL) { // call the callback - radio_vars.endFrame_cb(capturedTime); + radio_vars_at86rf215.endFrame_cb(capturedTime); + // kick the OS - //result = KICK_SCHEDULER; + result = KICK_SCHEDULER; } else { // while(1); } } } } - radio_clear_isr(); + radio_clear_isr_at86rf215(); debugpins_isr_clr(); + return result; } -port_INLINE void radio_clear_isr(){ - radio_vars.rf09_isr = 0; - radio_vars.rf24_isr = 0; - radio_vars.bb0_isr = 0; - radio_vars.bb1_isr = 0; +port_INLINE void radio_clear_isr_at86rf215(){ + radio_vars_at86rf215.rf09_isr = 0; + radio_vars_at86rf215.rf24_isr = 0; + radio_vars_at86rf215.bb0_isr = 0; + radio_vars_at86rf215.bb1_isr = 0; } diff --git a/bsp/chips/at86rf215/radio_at86rf215.h b/bsp/chips/at86rf215/radio_at86rf215.h new file mode 100644 index 0000000000..96e462f788 --- /dev/null +++ b/bsp/chips/at86rf215/radio_at86rf215.h @@ -0,0 +1,96 @@ +#ifndef __RADIO_AT86RF215_H +#define __RADIO_AT86RF215_H + +/** +\addtogroup BSP +\{ +\addtogroup radio +\{ + +\brief Cross-platform declaration "radio" bsp module. + +\author Thomas Watteyne , February 2012. +*/ + +/* +\modifications to implement the IEEE 802.15.4-SUN +\done by Jonathan Munoz +*/ + +#include "radio.h" +#include "at86rf215.h" + +//=========================== define ========================================== + +// Number of modulations available on this radio chip. This is different from MAC_RADIOS which is for all the board and defined in board_info.h +#define MAX_MODULATIONS 6 + +//=========================== typedef ========================================= + + +typedef struct { + radio_capture_cbt startFrame_cb; + radio_capture_cbt endFrame_cb; + radio_state_t state; + uint8_t rf09_isr; + uint8_t rf24_isr; + uint8_t bb0_isr; + uint8_t bb1_isr; +} radio_vars_at86rf215_t; + + + + +// open radio register mapping: an array of pointers to registersettings arrays + +typedef struct { + registerSetting_t * radios [MAX_MODULATIONS]; + size_t size [MAX_MODULATIONS]; +} radio_config_t; + + +//=========================== variables ======================================= + +//=========================== prototypes ====================================== + +// admin +void radio_powerOn_at86rf215(void); +void radio_init_at86rf215(void); +void radio_setStartFrameCb_at86rf215(radio_capture_cbt cb); +void radio_setEndFrameCb_at86rf215(radio_capture_cbt cb); +// reset +void radio_reset_at86rf215(void); +// RF admin +void radio_setFrequency_at86rf215(uint16_t channel, radio_freq_t tx_or_rx); +int8_t radio_getFrequencyOffset_at86rf215(void); +void radio_rfOn_at86rf215(void); +void radio_rfOff_at86rf215(void); +void radio_setConfig_at86rf215 (radioSetting_t radioSetting); +void radio_change_modulation_at86rf215(registerSetting_t * mod); +void radio_change_size_at86rf215(uint16_t* size); +// TX +void radio_loadPacket_at86rf215(uint8_t* packet, uint16_t len); +radio_state_t radio_getState_at86rf215(void); +void radio_txEnable_at86rf215(void); +void radio_txNow_at86rf215(void); +// RX +void radio_rxEnable_at86rf215(void); +void radio_rxNow_at86rf215(void); +void radio_getReceivedFrame_at86rf215(uint8_t* bufRead, + uint8_t* lenRead, + uint8_t maxBufLen, + int8_t* rssi, + uint8_t* lqi, + bool* crc); + +// interrupt handlers +kick_scheduler_t radio_isr_at86rf215(void); +// private +void radio_isr_internal_at86rf215(void); +void radio_local_bootstrap_at86rf215(void); +/** +\} +\} +*/ + +#endif diff --git a/bsp/chips/at86rf231/radio.c b/bsp/chips/at86rf231/radio.c index a5792ab6f6..e7428b37a7 100644 --- a/bsp/chips/at86rf231/radio.c +++ b/bsp/chips/at86rf231/radio.c @@ -25,6 +25,9 @@ typedef struct { radio_vars_t radio_vars; +// global radio selection. +uint8_t selected_radioSetting = RADIOSETTING_24GHZ; + //=========================== prototypes ====================================== void radio_spiWriteReg(uint8_t reg_addr, uint8_t reg_setting); @@ -86,12 +89,16 @@ void radio_reset(void) { //===== RF admin -void radio_setFrequency(uint8_t frequency, radio_freq_t tx_or_rx) { +void radio_setConfig (radioSetting_t radioSetting){ + selected_radioSetting = radioSetting; + //do nothing +} +void radio_setFrequency(uint16_t frequency, radio_freq_t tx_or_rx) { // change state radio_vars.state = RADIOSTATE_SETTING_FREQUENCY; // configure the radio to the right frequecy - radio_spiWriteReg(RG_PHY_CC_CCA,0x20+frequency); + radio_spiWriteReg(RG_PHY_CC_CCA,0x20+ frequency); // change state radio_vars.state = RADIOSTATE_FREQUENCY_SET; diff --git a/bsp/chips/cc2538rf/SConscript b/bsp/chips/cc2538rf/SConscript new file mode 100644 index 0000000000..cfbcf68cfb --- /dev/null +++ b/bsp/chips/cc2538rf/SConscript @@ -0,0 +1,13 @@ +# chip support sconscripts are expected to return a list of objects, so +# that they can be included in a board bsp library. This allows the board +# to include the chip support without knowing exactly what the filenames +# are or where they live. + +Import('env') + +localEnv = env.Clone() + +source = ['radio_cc2538rf.c'] +cc2538rf = localEnv.Object(source=source) + +Return('cc2538rf') \ No newline at end of file diff --git a/bsp/chips/cc2538rf/radio_cc2538rf.c b/bsp/chips/cc2538rf/radio_cc2538rf.c new file mode 100644 index 0000000000..fa113c2680 --- /dev/null +++ b/bsp/chips/cc2538rf/radio_cc2538rf.c @@ -0,0 +1,539 @@ +/** + * Author: Xavier Vilajosana (xvilajosana@eecs.berkeley.edu) + * Pere Tuset (peretuset@openmote.com) + * Date: July 2013 + * Description: CC2538-specific definition of the "radio" bsp module. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "board.h" +#include "debugpins.h" +#include "leds.h" +#include "radio_cc2538rf.h" +#include "radio.h" +#include "sctimer.h" + +//=========================== defines ========================================= + +/* Bit Masks for the last byte in the RX FIFO */ +#define CRC_BIT_MASK 0x80 +#define LQI_BIT_MASK 0x7F + +/* RSSI Offset */ +#define RSSI_OFFSET 73 +#define CHECKSUM_LEN 2 + +//=========================== variables ======================================= + + +radio_vars_cc2538rf_t radio_vars_cc2538rf; + +//=========================== prototypes ====================================== + +void enable_radio_interrupts(void); +void disable_radio_interrupts(void); + +void radio_on(void); +void radio_off(void); + +void radio_error_isr_cc2538rf(void); +void radio_isr_internal_cc2538rf(void); + +//=========================== public ========================================== + +//===== admin + +void radio_init_cc2538rf(void) { + + // clear variables + memset(&radio_vars_cc2538rf,0,sizeof(radio_vars_cc2538rf_t)); + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_STOPPED; + //flush fifos + CC2538_RF_CSP_ISFLUSHRX(); + CC2538_RF_CSP_ISFLUSHTX(); + + radio_off(); + + //disable radio interrupts + disable_radio_interrupts(); + + /* + This CORR_THR value should be changed to 0x14 before attempting RX. Testing has shown that + too many false frames are received if the reset value is used. Make it more likely to detect + sync by removing the requirement that both symbols in the SFD must have a correlation value + above the correlation threshold, and make sync word detection less likely by raising the + correlation threshold. + */ + HWREG(RFCORE_XREG_MDMCTRL1) = 0x14; + /* tuning adjustments for optimal radio performance; details available in datasheet */ + + HWREG(RFCORE_XREG_RXCTRL) = 0x3F; + /* Adjust current in synthesizer; details available in datasheet. */ + HWREG(RFCORE_XREG_FSCTRL) = 0x55; + + /* Makes sync word detection less likely by requiring two zero symbols before the sync word. + * details available in datasheet. + */ + HWREG(RFCORE_XREG_MDMCTRL0) = 0x85; + + /* Adjust current in VCO; details available in datasheet. */ + HWREG(RFCORE_XREG_FSCAL1) = 0x01; + /* Adjust target value for AGC control loop; details available in datasheet. */ + HWREG(RFCORE_XREG_AGCCTRL1) = 0x15; + + /* Tune ADC performance, details available in datasheet. */ + HWREG(RFCORE_XREG_ADCTEST0) = 0x10; + HWREG(RFCORE_XREG_ADCTEST1) = 0x0E; + HWREG(RFCORE_XREG_ADCTEST2) = 0x03; + + //update CCA register to -81db as indicated by manual.. won't be used.. + HWREG(RFCORE_XREG_CCACTRL0) = 0xF8; + /* + * Changes from default values + * See User Guide, section "Register Settings Update" + */ + HWREG(RFCORE_XREG_TXFILTCFG) = 0x09; /** TX anti-aliasing filter bandwidth */ + HWREG(RFCORE_XREG_AGCCTRL1) = 0x15; /** AGC target value */ + HWREG(ANA_REGS_O_IVCTRL) = 0x0B; /** Bias currents */ + + /* disable the CSPT register compare function */ + HWREG(RFCORE_XREG_CSPT) = 0xFFUL; + /* + * Defaults: + * Auto CRC; Append RSSI, CRC-OK and Corr. Val.; CRC calculation; + * RX and TX modes with FIFOs + */ + HWREG(RFCORE_XREG_FRMCTRL0) = RFCORE_XREG_FRMCTRL0_AUTOCRC; + + //poipoi disable frame filtering by now.. sniffer mode. + HWREG(RFCORE_XREG_FRMFILT0) &= ~RFCORE_XREG_FRMFILT0_FRAME_FILTER_EN; + + /* Disable source address matching and autopend */ + HWREG(RFCORE_XREG_SRCMATCH) = 0; + + /* MAX FIFOP threshold */ + HWREG(RFCORE_XREG_FIFOPCTRL) = CC2538_RF_MAX_PACKET_LEN; + + HWREG(RFCORE_XREG_TXPOWER) = CC2538_RF_TX_POWER; + HWREG(RFCORE_XREG_FREQCTRL) = CC2538_RF_CHANNEL_MIN; + + /* Enable RF interrupts see page 751 */ + // enable_radio_interrupts(); + + //register interrupt + IntRegister(INT_RFCORERTX, radio_isr_internal_cc2538rf); + IntRegister(INT_RFCOREERR, radio_error_isr_cc2538rf); + + IntEnable(INT_RFCORERTX); + + /* Enable all RF Error interrupts */ + HWREG(RFCORE_XREG_RFERRM) = RFCORE_XREG_RFERRM_RFERRM_M; //all errors + IntEnable(INT_RFCOREERR); + //radio_on(); + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_RFOFF; +} + +void radio_setStartFrameCb_cc2538rf(radio_capture_cbt cb) { + radio_vars_cc2538rf.startFrame_cb = cb; +} + +void radio_setEndFrameCb_cc2538rf(radio_capture_cbt cb) { + radio_vars_cc2538rf.endFrame_cb = cb; +} + +//===== reset + +void radio_reset_cc2538rf(void) { + /* Wait for ongoing TX to complete (e.g. this could be an outgoing ACK) */ + while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); + + //flush fifos + CC2538_RF_CSP_ISFLUSHRX(); + CC2538_RF_CSP_ISFLUSHTX(); + + /* Don't turn off if we are off as this will trigger a Strobe Error */ + if(HWREG(RFCORE_XREG_RXENABLE) != 0) { + CC2538_RF_CSP_ISRFOFF(); + } + radio_init(); +} + +//===== RF admin + +void radio_setFrequency_cc2538rf(uint16_t frequency, radio_freq_t tx_or_rx) { + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_SETTING_FREQUENCY; + + radio_off(); + // configure the radio to the right frequecy + if((frequency < CC2538_RF_CHANNEL_MIN) || (frequency > CC2538_RF_CHANNEL_MAX)) { + while(1); + } + + /* Changes to FREQCTRL take effect after the next recalibration */ + HWREG(RFCORE_XREG_FREQCTRL) = (CC2538_RF_CHANNEL_MIN + + (frequency - CC2538_RF_CHANNEL_MIN) * CC2538_RF_CHANNEL_SPACING); + + //radio_on(); + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_FREQUENCY_SET; +} + +void radio_setConfig_cc2538rf(radioSetting_t radioSetting){ + // do nothing +} + +void radio_rfOn_cc2538rf(void) { + //radio_on(); +} + +void radio_rfOff_cc2538rf(void) { + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_TURNING_OFF; + radio_off(); + // wiggle debug pin + debugpins_radio_clr(); + leds_radio_off(); + //enable radio interrupts + disable_radio_interrupts(); + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_RFOFF; +} + +int8_t radio_getFrequencyOffset_cc2538rf(void){ + + int8_t freq_offset; + + freq_offset = HWREG(RFCORE_XREG_FREQEST); + + return freq_offset; +} + +//===== TX + +void radio_loadPacket_cc2538rf(uint8_t* packet, uint16_t len) { + uint8_t i=0; + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_LOADING_PACKET; + + // load packet in TXFIFO + /* + When we transmit in very quick bursts, make sure previous transmission + is not still in progress before re-writing to the TX FIFO + */ + while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); + + CC2538_RF_CSP_ISFLUSHTX(); + + /* Send the phy length byte first */ + HWREG(RFCORE_SFR_RFDATA) = len; //crc len is included + + for(i = 0; i < len; i++) { + HWREG(RFCORE_SFR_RFDATA) = packet[i]; + } + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_PACKET_LOADED; +} + +void radio_txEnable_cc2538rf(void) { + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_ENABLING_TX; + + // wiggle debug pin + debugpins_radio_set(); + leds_radio_on(); + + //do nothing -- radio is activated by the strobe on rx or tx + //radio_rfOn(); + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_TX_ENABLED; +} + +void radio_txNow_cc2538rf(void) { + PORT_TIMER_WIDTH count; + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_TRANSMITTING; + + //enable radio interrupts + enable_radio_interrupts(); + + //make sure we are not transmitting already + while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); + + // send packet by STON strobe see pag 669 + + CC2538_RF_CSP_ISTXON(); + //wait 192uS + count=0; + while(!((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE))){ + count++; //debug + } +} + +//===== RX + +void radio_rxEnable_cc2538rf(void) { + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_ENABLING_RX; + + //enable radio interrupts + + // do nothing as we do not want to receive anything yet. + // wiggle debug pin + debugpins_radio_set(); + leds_radio_on(); + + // change state + radio_vars_cc2538rf.state = RADIOSTATE_LISTENING; +} + +void radio_rxNow_cc2538rf(void) { + //empty buffer before receiving + //CC2538_RF_CSP_ISFLUSHRX(); + + //enable radio interrupts + CC2538_RF_CSP_ISFLUSHRX(); + enable_radio_interrupts(); + + CC2538_RF_CSP_ISRXON(); + // busy wait until radio really listening + while(!((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_RX_ACTIVE))); +} + +void radio_getReceivedFrame_cc2538rf(uint8_t* pBufRead, + uint8_t* pLenRead, + uint8_t maxBufLen, + int8_t* pRssi, + uint8_t* pLqi, + bool* pCrc) { + uint8_t crc_corr,i; + + uint8_t len=0; + + /* Check the length */ + len = HWREG(RFCORE_SFR_RFDATA); //first byte is len + + + /* Check for validity */ + if(len > CC2538_RF_MAX_PACKET_LEN) { + /* wrong len */ + CC2538_RF_CSP_ISFLUSHRX(); + return; + } + + + if(len < CC2538_RF_MIN_PACKET_LEN) { + //too short + CC2538_RF_CSP_ISFLUSHRX(); + return; + } + + //check if this fits to the buffer + if(len > maxBufLen) { + CC2538_RF_CSP_ISFLUSHRX(); + return; + } + + // when reading the packet from the RX buffer, you get the following: + // - *[1B] length byte + // - [0-125B] packet (excluding CRC) + // - [1B] RSSI + // - *[2B] CRC + + //skip first byte is len + for(i = 0; i < len - 2; i++) { + pBufRead[i] = HWREG(RFCORE_SFR_RFDATA); + } + + *pRssi = ((int8_t)(HWREG(RFCORE_SFR_RFDATA)) - RSSI_OFFSET); + crc_corr = HWREG(RFCORE_SFR_RFDATA); + *pCrc = crc_corr & CRC_BIT_MASK; + *pLenRead = len; + + //flush it + CC2538_RF_CSP_ISFLUSHRX(); +} + +//=========================== private ========================================= + +void enable_radio_interrupts(void){ + /* Enable RF interrupts 0, RXPKTDONE,SFD,FIFOP only -- see page 751 */ + HWREG(RFCORE_XREG_RFIRQM0) |= ((0x06|0x02|0x01) << RFCORE_XREG_RFIRQM0_RFIRQM_S) & RFCORE_XREG_RFIRQM0_RFIRQM_M; + + /* Enable RF interrupts 1, TXDONE only */ + HWREG(RFCORE_XREG_RFIRQM1) |= ((0x02) << RFCORE_XREG_RFIRQM1_RFIRQM_S) & RFCORE_XREG_RFIRQM1_RFIRQM_M; +} + +void disable_radio_interrupts(void){ + /* Enable RF interrupts 0, RXPKTDONE,SFD,FIFOP only -- see page 751 */ + HWREG(RFCORE_XREG_RFIRQM0) = 0; + /* Enable RF interrupts 1, TXDONE only */ + HWREG(RFCORE_XREG_RFIRQM1) = 0; +} + +void radio_on(void){ + // CC2538_RF_CSP_ISFLUSHRX(); + CC2538_RF_CSP_ISRXON(); +} + +void radio_off(void){ + /* Wait for ongoing TX to complete (e.g. this could be an outgoing ACK) */ + while(HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE); + //CC2538_RF_CSP_ISFLUSHRX(); + + /* Don't turn off if we are off as this will trigger a Strobe Error */ + if(HWREG(RFCORE_XREG_RXENABLE) != 0) { + CC2538_RF_CSP_ISRFOFF(); + //clear fifo isr flag + HWREG(RFCORE_SFR_RFIRQF0) = ~(RFCORE_SFR_RFIRQF0_FIFOP|RFCORE_SFR_RFIRQF0_RXPKTDONE); + } +} + +//=========================== callbacks ======================================= + +//=========================== interrupt handlers ============================== + +/** +\brief Stub function for the CC2538. + +In MSP430 platforms the CPU status after servicing an interrupt can be managed +toggling some bits in a special register, e.g. CPUOFF, LPM1, etc, within the +interrupt context itself. By default, after servicing an interrupt the CPU will +be off so it makes sense to return a value and enable it if something has +happened that needs the scheduler to run (a packet has been received that needs +to be processed). Otherwise, the CPU is kept in sleep mode without even +reaching the main loop. + +In the CC2538, however, the default behaviour is the contrary. After servicing +an interrupt the CPU will be on by default and it is the responsability of the +main thread to put it back to sleep (which is already done). This means that +the scheduler will always be kicked in after servicing an interrupt. This +behaviour can be changed by modifying the SLEEPEXIT field in the SYSCTRL +regiser (see page 131 of the CC2538 manual). +*/ +kick_scheduler_t radio_isr_cc2538rf(void) { + return DO_NOT_KICK_SCHEDULER; +} + +void radio_isr_internal_cc2538rf(void) { + volatile PORT_TIMER_WIDTH capturedTime; + uint8_t irq_status0,irq_status1; + + debugpins_isr_set(); + + // capture the time + capturedTime = sctimer_readCounter(); + + // reading IRQ_STATUS + irq_status0 = HWREG(RFCORE_SFR_RFIRQF0); + irq_status1 = HWREG(RFCORE_SFR_RFIRQF1); + + IntPendClear(INT_RFCORERTX); + + //clear interrupt + HWREG(RFCORE_SFR_RFIRQF0) = 0; + HWREG(RFCORE_SFR_RFIRQF1) = 0; + + //STATUS0 Register + // start of frame event + if ((irq_status0 & RFCORE_SFR_RFIRQF0_SFD) == RFCORE_SFR_RFIRQF0_SFD) { + // change state + radio_vars_cc2538rf.state = RADIOSTATE_RECEIVING; + if (radio_vars_cc2538rf.startFrame_cb!=NULL) { + // call the callback + radio_vars_cc2538rf.startFrame_cb(capturedTime); + debugpins_isr_clr(); + // kick the OS + return; + } else { + while(1); + } + } + + //or RXDONE is full -- we have a packet. + if (((irq_status0 & RFCORE_SFR_RFIRQF0_RXPKTDONE) == RFCORE_SFR_RFIRQF0_RXPKTDONE)) { + // change state + radio_vars_cc2538rf.state = RADIOSTATE_TXRX_DONE; + if (radio_vars_cc2538rf.endFrame_cb!=NULL) { + // call the callback + radio_vars_cc2538rf.endFrame_cb(capturedTime); + debugpins_isr_clr(); + // kick the OS + return; + } else { + while(1); + } + } + + // or FIFOP is full -- we have a packet. + if (((irq_status0 & RFCORE_SFR_RFIRQF0_FIFOP) == RFCORE_SFR_RFIRQF0_FIFOP)) { + // change state + radio_vars_cc2538rf.state = RADIOSTATE_TXRX_DONE; + if (radio_vars_cc2538rf.endFrame_cb!=NULL) { + // call the callback + radio_vars_cc2538rf.endFrame_cb(capturedTime); + debugpins_isr_clr(); + // kick the OS + return; + } else { + while(1); + } + } + + //STATUS1 Register + // end of frame event --either end of tx . + if (((irq_status1 & RFCORE_SFR_RFIRQF1_TXDONE) == RFCORE_SFR_RFIRQF1_TXDONE)) { + // change state + radio_vars_cc2538rf.state = RADIOSTATE_TXRX_DONE; + if (radio_vars_cc2538rf.endFrame_cb!=NULL) { + // call the callback + radio_vars_cc2538rf.endFrame_cb(capturedTime); + debugpins_isr_clr(); + // kick the OS + return; + } else { + while(1); + } + } + debugpins_isr_clr(); + + return; +} + +void radio_error_isr_cc2538rf(void){ + uint8_t rferrm; + + rferrm = (uint8_t)HWREG(RFCORE_XREG_RFERRM); + + if ((HWREG(RFCORE_XREG_RFERRM) & (((0x02)< #include - +#include "radio.h" /*--------------------------------------------------------------------------- * RF Config *---------------------------------------------------------------------------*/ /* Constants */ #define CC2538_RF_CCA_THRES_USER_GUIDE 0xF8 -#define CC2538_RF_TX_POWER_RECOMMENDED 0xD5 /* TODO: Check value */ -#define CC2538_RF_CHANNEL_MIN 11 //poipoi -- in fact is sending on 0x17 check that. +/** Tx Power register + dbm - value +{ 7, 0xFF }, +{ 5, 0xED }, +{ 3, 0xD5 }, +{ 1, 0xC5 }, +{ 0, 0xB6 }, +{ -1, 0xB0 }, +{ -3, 0xA1 }, +{ -5, 0x91 }, +{ -7, 0x88 }, +{ -9, 0x72 }, +{-11, 0x62 }, +{-13, 0x58 }, +{-15, 0x42 }, +{-24, 0x00 }, +*/ +#define CC2538_RF_TX_POWER_RECOMMENDED 0xFF // use 7dbm maxmium txpower +#define CC2538_RF_CHANNEL_MIN 11 // poipoi -- in fact is sending on 0x17 check that. #define CC2538_RF_CHANNEL_MAX 26 #define CC2538_RF_CHANNEL_SPACING 5 #define CC2538_RF_MAX_PACKET_LEN 127 #define CC2538_RF_MIN_PACKET_LEN 4 #define CC2538_RF_CCA_CLEAR 1 #define CC2538_RF_CCA_BUSY 0 + + + /*---------------------------------------------------------------------------*/ #ifdef CC2538_RF_CONF_TX_POWER #define CC2538_RF_TX_POWER CC2538_RF_CONF_TX_POWER @@ -88,6 +108,50 @@ HWREG(RFCORE_SFR_RFST) = CC2538_RF_CSP_OP_ISFLUSHTX; \ } while(0) /*---------------------------------------------------------------------------*/ +typedef struct { + radio_capture_cbt startFrame_cb; + radio_capture_cbt endFrame_cb; + radio_state_t state; +} radio_vars_cc2538rf_t; + +//=========================== variables ======================================= + +//=========================== prototypes ====================================== + +// admin +void radio_init_cc2538rf(void); +void radio_setStartFrameCb_cc2538rf(radio_capture_cbt cb); +void radio_setEndFrameCb_cc2538rf(radio_capture_cbt cb); +// reset +void radio_reset_cc2538rf(void); +// RF admin +void radio_setFrequency_cc2538rf(uint16_t channel, radio_freq_t tx_or_rx); +int8_t radio_getFrequencyOffset_cc2538rf(void); +void radio_rfOn_cc2538rf(void); +void radio_rfOff_cc2538rf(void); +void radio_setConfig_cc2538rf (radioSetting_t radioSetting); + +// TX +void radio_loadPacket_cc2538rf(uint8_t* packet, uint16_t len); +void radio_txEnable_cc2538rf(void); +void radio_txNow_cc2538rf(void); +// RX +void radio_rxEnable_cc2538rf(void); +void radio_rxNow_cc2538rf(void); +void radio_getReceivedFrame_cc2538rf(uint8_t* bufRead, + uint8_t* lenRead, + uint8_t maxBufLen, + int8_t* rssi, + uint8_t* lqi, + bool* crc); + +// interrupt handlers +kick_scheduler_t radio_isr_cc2538rf(void); + +/** +\} +\} +*/ -#endif /* CC2538RF_H_ */ +#endif /* RADIO_CC2538RF_H_ */ diff --git a/drivers/common/opentimers.c b/drivers/common/opentimers.c index 718b39a3a4..f502f21cd5 100644 --- a/drivers/common/opentimers.c +++ b/drivers/common/opentimers.c @@ -8,6 +8,7 @@ at most MAX_NUM_TIMERS timers. */ #include "opendefs.h" +#include "board.h" #include "opentimers.h" // some dsp modules are required #include "sctimer.h" diff --git a/drivers/common/opentimers.h b/drivers/common/opentimers.h index 763035e420..fdffaa6c32 100644 --- a/drivers/common/opentimers.h +++ b/drivers/common/opentimers.h @@ -8,7 +8,7 @@ #define __OPENTIMERS_H #include "opendefs.h" - +#include "board.h" /** \addtogroup drivers \{ @@ -32,7 +32,8 @@ #define TIMER_NUMBER_NON_GENERAL 2 #define SPLITE_TIMER_DURATION 15 // in ticks -#define PRE_CALL_TIMER_WINDOW PORT_TsSlotDuration + +#define PRE_CALL_TIMER_WINDOW board_getSlotDuration() typedef void (*opentimers_cbt)(opentimers_id_t id); diff --git a/inc/opendefs.h b/inc/opendefs.h index fbc0692da6..17dc5b13f9 100644 --- a/inc/opendefs.h +++ b/inc/opendefs.h @@ -36,7 +36,7 @@ static const uint8_t infoStackName[] = "OpenWSN "; #define LENGTH_ADDR64b 8 #define LENGTH_ADDR128b 16 -#define MAXNUMNEIGHBORS 30 +#define MAXNUMNEIGHBORS 45 // maximum celllist length #define CELLLIST_MAX_LEN 5 diff --git a/openapps/uinject/uinject.c b/openapps/uinject/uinject.c index 475545ab67..21b805c695 100644 --- a/openapps/uinject/uinject.c +++ b/openapps/uinject/uinject.c @@ -6,6 +6,7 @@ #include "scheduler.h" #include "IEEE802154E.h" #include "schedule.h" +#include "neighbors.h" #include "icmpv6rpl.h" #include "idmanager.h" #include "openrandom.h" @@ -14,7 +15,7 @@ //=========================== defines ========================================= -#define UINJECT_TRAFFIC_RATE 2 ///> the value X indicates 1 packet/X minutes +#define UINJECT_TRAFFIC_RATE 1 ///> the value X indicates 1 packet/X minutes //=========================== variables ======================================= @@ -93,10 +94,14 @@ void uinject_task_cb(void) { OpenQueueEntry_t* pkt; uint8_t asnArray[5]; uint8_t numCellsUsed; + uint8_t numNeighbors; + uint16_t DAGRank; open_addr_t parentNeighbor; bool foundNeighbor; uint32_t ticksOn; + uint32_t ticksTx; + uint32_t ticksRx; uint32_t ticksInTotal; // don't run if not synch @@ -163,6 +168,7 @@ void uinject_task_cb(void) { pkt->payload[3] = asnArray[3]; pkt->payload[4] = asnArray[4]; + // number of cells packetfunctions_reserveHeaderSize(pkt,sizeof(uint8_t)); numCellsUsed = msf_getPreviousNumCellsUsed(CELLTYPE_TX); pkt->payload[0] = numCellsUsed; @@ -171,10 +177,33 @@ void uinject_task_cb(void) { numCellsUsed = msf_getPreviousNumCellsUsed(CELLTYPE_RX); pkt->payload[0] = numCellsUsed; + // number of neighbors + packetfunctions_reserveHeaderSize(pkt,sizeof(uint8_t)); + numNeighbors = neighbors_getNumNeighbors(); + pkt->payload[0] = numNeighbors; + + // queue stats + openqueue_stats_t oqs = openqueue_get_stats(); + openqueue_reset_stats(); + + packetfunctions_reserveHeaderSize(pkt,sizeof(uint8_t)); + pkt->payload[0] = oqs.maxBuffSize; + + packetfunctions_reserveHeaderSize(pkt,sizeof(uint8_t)); + pkt->payload[0] = oqs.minBuffSize; + + // address packetfunctions_reserveHeaderSize(pkt,sizeof(uint16_t)); pkt->payload[1] = (uint8_t)(idmanager_getMyID(ADDR_16B)->addr_16b[0]); pkt->payload[0] = (uint8_t)(idmanager_getMyID(ADDR_16B)->addr_16b[1]); + + // DAG Rank + DAGRank = icmpv6rpl_getMyDAGrank(); + packetfunctions_reserveHeaderSize(pkt,sizeof(uint16_t)); + pkt->payload[1] = (uint8_t)((DAGRank & 0x0000ff00) >> 8); + pkt->payload[0] = (uint8_t)( DAGRank & 0x000000ff); + // duty cycle info ieee154e_getTicsInfo(&ticksOn, &ticksInTotal); packetfunctions_reserveHeaderSize(pkt,sizeof(uint32_t)); pkt->payload[3] = (uint8_t)((ticksOn & 0xff000000) >> 24); @@ -182,12 +211,26 @@ void uinject_task_cb(void) { pkt->payload[1] = (uint8_t)((ticksOn & 0x0000ff00) >> 8); pkt->payload[0] = (uint8_t)( ticksOn & 0x000000ff); + ieee154e_getRadioTicsInfo(&ticksTx, &ticksRx, &ticksInTotal); + packetfunctions_reserveHeaderSize(pkt,sizeof(uint32_t)); + pkt->payload[3] = (uint8_t)((ticksTx & 0xff000000) >> 24); + pkt->payload[2] = (uint8_t)((ticksTx & 0x00ff0000) >> 16); + pkt->payload[1] = (uint8_t)((ticksTx & 0x0000ff00) >> 8); + pkt->payload[0] = (uint8_t)( ticksTx & 0x000000ff); + packetfunctions_reserveHeaderSize(pkt,sizeof(uint32_t)); + pkt->payload[3] = (uint8_t)((ticksRx & 0xff000000) >> 24); + pkt->payload[2] = (uint8_t)((ticksRx & 0x00ff0000) >> 16); + pkt->payload[1] = (uint8_t)((ticksRx & 0x0000ff00) >> 8); + pkt->payload[0] = (uint8_t)( ticksRx & 0x000000ff); + packetfunctions_reserveHeaderSize(pkt,sizeof(uint32_t)); pkt->payload[3] = (uint8_t)((ticksInTotal & 0xff000000) >> 24); pkt->payload[2] = (uint8_t)((ticksInTotal & 0x00ff0000) >> 16); pkt->payload[1] = (uint8_t)((ticksInTotal & 0x0000ff00) >> 8); pkt->payload[0] = (uint8_t)( ticksInTotal & 0x000000ff); - + // resettin mac stats + ieee154e_resetStats(); + if ((openudp_send(pkt))==E_FAIL) { openqueue_freePacketBuffer(pkt); } else { diff --git a/openstack/02a-MAClow/IEEE802154E.c b/openstack/02a-MAClow/IEEE802154E.c index 07921ae300..b4cde0960c 100644 --- a/openstack/02a-MAClow/IEEE802154E.c +++ b/openstack/02a-MAClow/IEEE802154E.c @@ -17,14 +17,18 @@ #include "sctimer.h" #include "openrandom.h" #include "msf.h" - +#include "board.h" +#include "board_info.h" //=========================== definition ====================================== //=========================== variables ======================================= -ieee154e_vars_t ieee154e_vars; -ieee154e_stats_t ieee154e_stats; -ieee154e_dbg_t ieee154e_dbg; +ieee154e_vars_t ieee154e_vars; +ieee154e_stats_t ieee154e_stats; +ieee154e_dbg_t ieee154e_dbg; + +slotTemplate_t slotTemplate; +slot_154e_vars_t slot_154e_vars [MAX_SLOT_TYPES]; //=========================== prototypes ====================================== @@ -88,7 +92,6 @@ void changeIsSync(bool newIsSync); void notif_sendDone(OpenQueueEntry_t* packetSent, owerror_t error); void notif_receive(OpenQueueEntry_t* packetReceived); // statistics -void resetStats(void); void updateStats(PORT_SIGNED_INT_WIDTH timeCorrection); // misc uint8_t calculateFrequency(uint8_t channelOffset); @@ -110,20 +113,19 @@ Call this function once before any other function in this module, possibly during boot-up. */ void ieee154e_init(void) { - // initialize variables memset(&ieee154e_vars,0,sizeof(ieee154e_vars_t)); memset(&ieee154e_dbg,0,sizeof(ieee154e_dbg_t)); // set singleChannel to 0 to enable channel hopping. -#if IEEE802154E_SINGLE_CHANNEL +#if IEEE802154E_SINGLE_CHANNEL ieee154e_vars.singleChannel = IEEE802154E_SINGLE_CHANNEL; #else ieee154e_vars.singleChannel = 0; // 0 means channel hopping #endif ieee154e_vars.isAckEnabled = TRUE; ieee154e_vars.isSecurityEnabled = FALSE; - ieee154e_vars.slotDuration = TsSlotDuration; + ieee154e_vars.numOfSleepSlots = 1; // default hopping template @@ -139,9 +141,29 @@ void ieee154e_init(void) { changeIsSync(FALSE); } - resetStats(); + ieee154e_resetStats(); ieee154e_stats.numDeSync = 0; + // initialize slot template lookup table + ieee154e_slot_template_init(); + + /* select the desired slot template to use, default is SLOT_20ms_24GHZ + currently, the following slot template/radio setting combinations are supported: + + SLOT_20ms_24GHZ , RADIOSETTING_24GHZ --> Default + SLOT_40ms_24GHZ , RADIOSETTING_24GHZ + SLOT_40ms_FSK_SUBGHZ , RADIOSETTING_FSK_OPTION1_FEC + SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS0 + SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS1 + SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS2 + SLOT_40ms_OFDM1MCS0_3_SUBGHZ , RADIOSETTING_OFDM_OPTION_1_MCS3 + */ + ieee154e_select_slot_template (SLOT_40ms_FSK_SUBGHZ); + ieee154e_vars.slotDuration = slotTemplate.slotDuration; + + //set the radio setting to use, default is RADIOSETTING_24GHZ + radio_setConfig (RADIOSETTING_FSK_OPTION1_FEC); + // switch radio on radio_rfOn(); @@ -167,6 +189,89 @@ void ieee154e_init(void) { ieee154e_vars.serialInhibitTimerId = opentimers_create(TIMER_INHIBIT, TASKPRIO_NONE); } +/** +\brief This function initializes the lookup table for the slot templates. + +Call this function once, preferrably at end of the ieee154e_init function +*/ +void ieee154e_slot_template_init(void) +{ + //10ms slot + slot_154e_vars [SLOT_10ms].TsTxOffset = ( 2120 /PORT_US_PER_TICK ) ; // 2120us + slot_154e_vars [SLOT_10ms].TsLongGT = ( 1100 /PORT_US_PER_TICK ) ; // 1100us + slot_154e_vars [SLOT_10ms].TsTxAckDelay = ( 1000 /PORT_US_PER_TICK ) ; // 1000us + slot_154e_vars [SLOT_10ms].TsShortGT = ( 500 /PORT_US_PER_TICK ) ; // 500us; The standardlized value for this is 400/2=200us(7ticks). Currectly 7 doesn't work for short packet; change it back to 7 when found the problem. + slot_154e_vars [SLOT_10ms].wdRadioTx = ( 1342 /PORT_US_PER_TICK ) ; // 1000us (needs to be >delayTx) (SCuM need a larger value; 45 is tested and works) + slot_154e_vars [SLOT_10ms].wdDataDuration = ( 5000 /PORT_US_PER_TICK ) ; // 5000us (measured 4280us with max payload) + slot_154e_vars [SLOT_10ms].wdAckDuration = ( 3000 /PORT_US_PER_TICK ) ; // 3000us (measured 1000us) + + // 20ms slot for 24ghz cc2538 + slot_154e_vars [SLOT_20ms_24GHZ].TsTxOffset = ( 5215 /PORT_US_PER_TICK ) ; // 5215us + slot_154e_vars [SLOT_20ms_24GHZ].TsLongGT = ( 1311 /PORT_US_PER_TICK ) ; // 1311us + slot_154e_vars [SLOT_20ms_24GHZ].TsTxAckDelay = ( 5521 /PORT_US_PER_TICK ) ; // 5521us + slot_154e_vars [SLOT_20ms_24GHZ].TsShortGT = ( 700 /PORT_US_PER_TICK ) ; // 700us + slot_154e_vars [SLOT_20ms_24GHZ].wdRadioTx = ( 1342 /PORT_US_PER_TICK ) ; // 1000us (needs to be >delayTx) (SCuM need a larger value; 45 is tested and works) + slot_154e_vars [SLOT_20ms_24GHZ].wdDataDuration = ( 5000 /PORT_US_PER_TICK ) ; // 5000us (measured 4280us with max payload) + slot_154e_vars [SLOT_20ms_24GHZ].wdAckDuration = ( 3000 /PORT_US_PER_TICK ) ; // 3000us (measured 1000us) + + //40ms slot for 24ghz cc2538 + slot_154e_vars [SLOT_40ms_24GHZ].TsTxOffset = ( 5215 /PORT_US_PER_TICK ) ; // 5215us + slot_154e_vars [SLOT_40ms_24GHZ].TsLongGT = ( 1311 /PORT_US_PER_TICK ) ; // 1311us + slot_154e_vars [SLOT_40ms_24GHZ].TsTxAckDelay = ( 5521 /PORT_US_PER_TICK ) ; // 5521us + slot_154e_vars [SLOT_40ms_24GHZ].TsShortGT = ( 700 /PORT_US_PER_TICK ) ; // 700us + slot_154e_vars [SLOT_40ms_24GHZ].wdRadioTx = ( 1342 /PORT_US_PER_TICK ) ; // 1000us (needs to be >delayTx) (SCuM need a larger value; 45 is tested and works) + slot_154e_vars [SLOT_40ms_24GHZ].wdDataDuration = ( 5000 /PORT_US_PER_TICK ) ; // 5000us (measured 4280us with max payload) + slot_154e_vars [SLOT_40ms_24GHZ].wdAckDuration = ( 3000 /PORT_US_PER_TICK ) ; // 3000us (measured 1000us) + + //40ms slot for FSK + slot_154e_vars [SLOT_40ms_FSK_SUBGHZ].TsTxOffset = ( 4000 /PORT_US_PER_TICK ); // measured: 131 ticks + slot_154e_vars [SLOT_40ms_FSK_SUBGHZ].TsLongGT = ( 2000 /PORT_US_PER_TICK ); // measured: 66 ticks + slot_154e_vars [SLOT_40ms_FSK_SUBGHZ].TsTxAckDelay = ( 3700 /PORT_US_PER_TICK ); // measured: 121 ticks + slot_154e_vars [SLOT_40ms_FSK_SUBGHZ].TsShortGT = ( 1831 /PORT_US_PER_TICK ); // measured: 60 ticks + slot_154e_vars [SLOT_40ms_FSK_SUBGHZ].wdRadioTx = ( 7000 /PORT_US_PER_TICK ); // 230 ticks 7019us delayTx+Tx time for 10 bytes( (needs to be >delayTx) (SCuM need a larger value; 45 is tested and works) + slot_154e_vars [SLOT_40ms_FSK_SUBGHZ].wdDataDuration = ( 30000 /PORT_US_PER_TICK ); // 983 ticks ; estimated based on max payload + slot_154e_vars [SLOT_40ms_FSK_SUBGHZ].wdAckDuration = ( 20000 /PORT_US_PER_TICK ); // 655 ticks; estimated + + //40ms slot for OFDM1 MCS0-3 + slot_154e_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].TsTxOffset = ( 3500 /PORT_US_PER_TICK ); // measured: 115 ticks; + slot_154e_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].TsLongGT = ( 2000 /PORT_US_PER_TICK ); // measured: 66 ticks; + slot_154e_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].TsTxAckDelay = ( 3700 /PORT_US_PER_TICK ); // measured: 121 ticks + slot_154e_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].TsShortGT = ( 1831 /PORT_US_PER_TICK ); // measured: 60 ticks + slot_154e_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].wdRadioTx = ( 7000 /PORT_US_PER_TICK ); // 230 ticks 7019us delayTx+Tx time for 10 bytes( (needs to be >delayTx) (SCuM need a larger value; 45 is tested and works) + slot_154e_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].wdDataDuration = ( 30000 /PORT_US_PER_TICK ); // 983 ticks; estimated based on max payload + slot_154e_vars [SLOT_40ms_OFDM1MCS0_3_SUBGHZ].wdAckDuration = ( 20000 /PORT_US_PER_TICK ); // 655 ticks; estimated +} + +/** +\brief This function initializes the lookup table for the slot templates. + +Call this function once, preferrably at end of the ieee154e_init function +*/ +void ieee154e_select_slot_template(slotType_t slotType) +{ + slot_board_vars_t slot_board_vars= board_selectSlotTemplate(slotType); + + // board-specific template details + slotTemplate.slotDuration = slot_board_vars.slotDuration; + slotTemplate.maxTxDataPrepare = slot_board_vars.maxTxDataPrepare; + slotTemplate.maxRxAckPrepare = slot_board_vars.maxRxAckPrepare; + slotTemplate.maxRxDataPrepare = slot_board_vars.maxRxDataPrepare; + slotTemplate.maxTxAckPrepare = slot_board_vars.maxTxAckPrepare; + slotTemplate.delayTx = slot_board_vars.delayTx; + slotTemplate.delayRx = slot_board_vars.delayRx; + + //154e general slot template + slotTemplate.TsTxOffset = slot_154e_vars [slotType].TsTxOffset; + slotTemplate.TsLongGT = slot_154e_vars [slotType].TsLongGT; + slotTemplate.TsTxAckDelay = slot_154e_vars [slotType].TsTxAckDelay; + slotTemplate.TsShortGT = slot_154e_vars [slotType].TsShortGT; + slotTemplate.wdRadioTx = slot_154e_vars [slotType].wdRadioTx; + slotTemplate.wdDataDuration = slot_154e_vars [slotType].wdDataDuration; + slotTemplate.wdAckDuration = slot_154e_vars [slotType].wdAckDuration; + +} + + //=========================== public ========================================== /** @@ -285,12 +390,12 @@ void isr_ieee154e_newSlot(opentimers_id_t id) { opentimers_scheduleAbsolute( ieee154e_vars.timerId, // timerId - TsSlotDuration, // duration + slotTemplate.slotDuration, // duration ieee154e_vars.startOfSlotReference, // reference TIME_TICS, // timetype isr_ieee154e_newSlot // callback ); - ieee154e_vars.slotDuration = TsSlotDuration; + ieee154e_vars.slotDuration = slotTemplate.slotDuration; // radiotimer_setPeriod(ieee154e_vars.slotDuration); if (ieee154e_vars.isSync==FALSE) { @@ -554,6 +659,7 @@ port_INLINE void activity_synchronize_newSlot(void) { } ieee154e_vars.radioOnInit=sctimer_readCounter(); + ieee154e_vars.radioTxRxInit = ieee154e_vars.radioOnInit; ieee154e_vars.radioOnThisSlot=TRUE; // if this is the first time I call this function while not synchronized, @@ -586,6 +692,7 @@ port_INLINE void activity_synchronize_newSlot(void) { } else { // I'm listening last slot ieee154e_stats.numTicsOn += ieee154e_vars.slotDuration; + ieee154e_stats.numRxTics += ieee154e_vars.slotDuration; ieee154e_stats.numTicsTotal += ieee154e_vars.slotDuration; #ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT @@ -719,8 +826,8 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime) // retrieve the received data frame from the radio's Rx buffer ieee154e_vars.dataReceived->payload = &(ieee154e_vars.dataReceived->packet[FIRST_FRAME_BYTE]); - radio_getReceivedFrame( ieee154e_vars.dataReceived->payload, - (uint8_t*)&ieee154e_vars.dataReceived->length, + radio_getReceivedFrame( ieee154e_vars.dataReceived->payload, + (uint8_t*)&ieee154e_vars.dataReceived->length, sizeof(ieee154e_vars.dataReceived->packet), &ieee154e_vars.dataReceived->l1_rssi, &ieee154e_vars.dataReceived->l1_lqi, @@ -798,6 +905,7 @@ port_INLINE void activity_synchronize_endOfFrame(PORT_TIMER_WIDTH capturedTime) // compute radio duty cycle ieee154e_vars.radioOnTics += (sctimer_readCounter()-ieee154e_vars.radioOnInit); + ieee154e_vars.radioRxTics += (sctimer_readCounter()-ieee154e_vars.radioTxRxInit); // toss the IEs packetfunctions_tossHeader(ieee154e_vars.dataReceived,lenIE); @@ -942,13 +1050,13 @@ port_INLINE void activity_ti1ORri1(void) { opentimers_scheduleAbsolute( ieee154e_vars.timerId, // timerId - TsSlotDuration*(ieee154e_vars.numOfSleepSlots), // duration + slotTemplate.slotDuration*(ieee154e_vars.numOfSleepSlots), // duration ieee154e_vars.startOfSlotReference, // reference TIME_TICS, // timetype isr_ieee154e_newSlot // callback ); - ieee154e_vars.slotDuration = TsSlotDuration*(ieee154e_vars.numOfSleepSlots); - // radiotimer_setPeriod(TsSlotDuration*(ieee154e_vars.numOfSleepSlots)); + ieee154e_vars.slotDuration = slotTemplate.slotDuration*(ieee154e_vars.numOfSleepSlots); + // radiotimer_setPeriod(slotDuration*(ieee154e_vars.numOfSleepSlots)); //increase ASN by numOfSleepSlots-1 slots as at this slot is already incremented by 1 for (i=0;ipayload = &(ieee154e_vars.ackReceived->packet[FIRST_FRAME_BYTE]); radio_getReceivedFrame( ieee154e_vars.ackReceived->payload, - (uint8_t*)&ieee154e_vars.ackReceived->length, + (uint8_t*)&ieee154e_vars.ackReceived->length, sizeof(ieee154e_vars.ackReceived->packet), &ieee154e_vars.ackReceived->l1_rssi, &ieee154e_vars.ackReceived->l1_lqi, @@ -1662,6 +1784,14 @@ port_INLINE void activity_ri4(PORT_TIMER_WIDTH capturedTime) { // change state changeState(S_RXDATA); + + // capture time for radio rx duy cycle calculation + ieee154e_vars.radioTxRxInit = sctimer_readCounter(); + + //indicate on LA that a frame reception has actually started + debugpins_radio_toggle(); + debugpins_radio_toggle(); + #ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT // cancel rt3 @@ -1708,6 +1838,10 @@ port_INLINE void activity_rie3(void) { } port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) { + //indicate on LA that a frame reception has ended + debugpins_radio_toggle(); + debugpins_radio_toggle(); + ieee802154_header_iht ieee802514_header; uint16_t lenIE=0; open_addr_t addressToWrite; @@ -1732,6 +1866,8 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) { // turn off the radio radio_rfOff(); ieee154e_vars.radioOnTics+=sctimer_readCounter()-ieee154e_vars.radioOnInit; + ieee154e_vars.radioRxTics+=sctimer_readCounter()-ieee154e_vars.radioTxRxInit; + // get a buffer to put the (received) data in ieee154e_vars.dataReceived = openqueue_getFreePacketBuffer(COMPONENT_IEEE802154E); if (ieee154e_vars.dataReceived==NULL) { @@ -1764,7 +1900,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) { ieee154e_vars.dataReceived->payload = &(ieee154e_vars.dataReceived->packet[FIRST_FRAME_BYTE]); radio_getReceivedFrame( ieee154e_vars.dataReceived->payload, - (uint8_t*)&ieee154e_vars.dataReceived->length, + (uint8_t*)&ieee154e_vars.dataReceived->length, sizeof(ieee154e_vars.dataReceived->packet), &ieee154e_vars.dataReceived->l1_rssi, &ieee154e_vars.dataReceived->l1_lqi, @@ -1857,7 +1993,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) { } // record the timeCorrection and print out at end of slot - ieee154e_vars.dataReceived->l2_timeCorrection = (PORT_SIGNED_INT_WIDTH)((PORT_SIGNED_INT_WIDTH)TsTxOffset-(PORT_SIGNED_INT_WIDTH)ieee154e_vars.syncCapturedTime); + ieee154e_vars.dataReceived->l2_timeCorrection = (PORT_SIGNED_INT_WIDTH)((PORT_SIGNED_INT_WIDTH)slotTemplate.TsTxOffset-(PORT_SIGNED_INT_WIDTH)ieee154e_vars.syncCapturedTime); // check if ack requested if (ieee802514_header.ackRequested==1 && ieee154e_vars.isAckEnabled == TRUE) { @@ -1941,6 +2077,7 @@ port_INLINE void activity_ri5(PORT_TIMER_WIDTH capturedTime) { ); // radiotimer_schedule(DURATION_rt5); #endif + } else { // synchronize to the received packet if I'm not a DAGroot and this is my preferred parent // or in case I'm in the middle of the join process when parent is not yet selected @@ -2021,7 +2158,7 @@ port_INLINE void activity_ri6(void) { // calculate the time timeCorrection (this is the time the sender is off w.r.t to this node. A negative number means // the sender is too late. - ieee154e_vars.timeCorrection = (PORT_SIGNED_INT_WIDTH)((PORT_SIGNED_INT_WIDTH)TsTxOffset-(PORT_SIGNED_INT_WIDTH)ieee154e_vars.syncCapturedTime); + ieee154e_vars.timeCorrection = (PORT_SIGNED_INT_WIDTH)((PORT_SIGNED_INT_WIDTH)slotTemplate.TsTxOffset-(PORT_SIGNED_INT_WIDTH)ieee154e_vars.syncCapturedTime); // prepend the IEEE802.15.4 header to the ACK ieee154e_vars.ackToSend->l2_frameType = IEEE154_TYPE_ACK; @@ -2111,6 +2248,10 @@ port_INLINE void activity_rie5(void) { port_INLINE void activity_ri8(PORT_TIMER_WIDTH capturedTime) { // change state changeState(S_TXACK); + + // capture time for radio tx duy cycle calculation + ieee154e_vars.radioTxRxInit = sctimer_readCounter(); + #ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT // cancel rt7 sctimer_actionCancel(ACTION_SET_TIMEOUT); @@ -2156,6 +2297,14 @@ port_INLINE void activity_rie6(void) { port_INLINE void activity_ri9(PORT_TIMER_WIDTH capturedTime) { // change state changeState(S_RXPROC); + // turn off the radio + radio_rfOff(); + + // compute radio duty cycle + //ieee154e_vars.radioOnTics += (sctimer_readCounter()-ieee154e_vars.radioOnInit); + // calculate radio tics for tx duty cycle calculations + ieee154e_vars.radioTxTics += (sctimer_readCounter()-ieee154e_vars.radioTxRxInit); + #ifdef SLOT_FSM_IMPLEMENTATION_MULTIPLE_TIMER_INTERRUPT // cancel rt8 sctimer_actionCancel(ACTION_SET_TIMEOUT); @@ -2313,6 +2462,13 @@ void ieee154e_getTicsInfo(uint32_t* numTicsOn, uint32_t* numTicsTotal){ *numTicsTotal = (uint32_t)(ieee154e_stats.numTicsTotal); } +void ieee154e_getRadioTicsInfo(uint32_t* numTxTics, uint32_t* numRxTics, uint32_t* numTicsTotal){ + + *numTxTics = (uint32_t)(ieee154e_stats.numTxTics); + *numRxTics = (uint32_t)(ieee154e_stats.numRxTics); + *numTicsTotal = (uint32_t)(ieee154e_stats.numTicsTotal); +} + port_INLINE void joinPriorityStoreFromEB(uint8_t jp){ ieee154e_vars.dataReceived->l2_joinPriority = jp; ieee154e_vars.dataReceived->l2_joinPriorityPresent = TRUE; @@ -2608,7 +2764,7 @@ void synchronizePacket(PORT_TIMER_WIDTH timeReceived) { currentPeriod = ieee154e_vars.slotDuration; // calculate new period - timeCorrection = (PORT_SIGNED_INT_WIDTH)((PORT_SIGNED_INT_WIDTH)timeReceived-(PORT_SIGNED_INT_WIDTH)TsTxOffset); + timeCorrection = (PORT_SIGNED_INT_WIDTH)((PORT_SIGNED_INT_WIDTH)timeReceived-(PORT_SIGNED_INT_WIDTH)slotTemplate.TsTxOffset); // The interrupt beginning a new slot can either occur after the packet has been // or while it is being received, possibly because the mote is not yet synchronized. @@ -2626,7 +2782,7 @@ void synchronizePacket(PORT_TIMER_WIDTH timeReceived) { // detect whether I'm too close to the edge of the slot, in that case, // skip a slot and increase the temporary slot length to be 2 slots long if ((PORT_SIGNED_INT_WIDTH)newPeriod - (PORT_SIGNED_INT_WIDTH)currentValue < (PORT_SIGNED_INT_WIDTH)RESYNCHRONIZATIONGUARD) { - newPeriod += TsSlotDuration; + newPeriod += slotTemplate.slotDuration; incrementAsnOffset(); } @@ -2673,7 +2829,6 @@ void synchronizePacket(PORT_TIMER_WIDTH timeReceived) { void synchronizeAck(PORT_SIGNED_INT_WIDTH timeCorrection) { PORT_TIMER_WIDTH newPeriod; PORT_TIMER_WIDTH currentPeriod; - // calculate new period currentPeriod = ieee154e_vars.slotDuration; newPeriod = (PORT_TIMER_WIDTH)((PORT_SIGNED_INT_WIDTH)currentPeriod+timeCorrection); @@ -2723,7 +2878,7 @@ void changeIsSync(bool newIsSync) { if (ieee154e_vars.isSync==TRUE) { leds_sync_on(); - resetStats(); + ieee154e_resetStats(); } else { leds_sync_off(); schedule_resetBackoff(); @@ -2761,13 +2916,14 @@ void notif_receive(OpenQueueEntry_t* packetReceived) { } //======= stats - -port_INLINE void resetStats(void) { +port_INLINE void ieee154e_resetStats(void) { ieee154e_stats.numSyncPkt = 0; ieee154e_stats.numSyncAck = 0; ieee154e_stats.minCorrection = 127; ieee154e_stats.maxCorrection = -127; ieee154e_stats.numTicsOn = 0; + ieee154e_stats.numTxTics = 0; + ieee154e_stats.numRxTics = 0; ieee154e_stats.numTicsTotal = 0; // do not reset the number of de-synchronizations } @@ -2803,6 +2959,8 @@ different channel offsets in the same slot. \returns The calculated frequency channel, an integer between 11 and 26. */ + +// Should be calculateChannel port_INLINE uint8_t calculateFrequency(uint8_t channelOffset) { if (ieee154e_vars.singleChannel >= 11 && ieee154e_vars.singleChannel <= 26 ) { return ieee154e_vars.singleChannel; // single channel @@ -2874,7 +3032,7 @@ function should already have been done. If this is not the case, this function will do that for you, but assume that something went wrong. */ void endSlot(void) { - + open_addr_t slotNeighbor; open_addr_t parentAddress; slotinfo_element_t info; @@ -2903,9 +3061,15 @@ void endSlot(void) { ieee154e_vars.lastCapturedTime = 0; ieee154e_vars.syncCapturedTime = 0; - // compute duty cycle. + // compute duty cycle for radio on time. ieee154e_stats.numTicsOn+=ieee154e_vars.radioOnTics;//accumulate and tics the radio is on for that window ieee154e_stats.numTicsTotal+=ieee154e_vars.slotDuration;//increment total tics by timer period. + + // compute duty cycle for raio tx time. + ieee154e_stats.numTxTics+=ieee154e_vars.radioTxTics;//accumulate and tics the radio is transmitting for that window + + // compute duty cycle for raio rx time. + ieee154e_stats.numRxTics+=ieee154e_vars.radioRxTics;//accumulate and tics the radio is receiving for that window if (ieee154e_stats.numTicsTotal>DUTY_CYCLE_WINDOW_LIMIT){ ieee154e_stats.numTicsTotal = ieee154e_stats.numTicsTotal>>1; @@ -2914,6 +3078,8 @@ void endSlot(void) { // clear vars for duty cycle on this slot ieee154e_vars.radioOnTics=0; + ieee154e_vars.radioTxTics=0; + ieee154e_vars.radioRxTics=0; ieee154e_vars.radioOnThisSlot=FALSE; // clean up dataToSend diff --git a/openstack/02a-MAClow/IEEE802154E.h b/openstack/02a-MAClow/IEEE802154E.h index 117aa7f3e6..f089e4ebf6 100644 --- a/openstack/02a-MAClow/IEEE802154E.h +++ b/openstack/02a-MAClow/IEEE802154E.h @@ -1,347 +1,361 @@ -#ifndef __IEEE802154E_H -#define __IEEE802154E_H - -/** -\addtogroup MAClow -\{ -\addtogroup IEEE802154E -\{ -*/ - -#include "opendefs.h" -#include "board.h" -#include "opentimers.h" -#include "schedule.h" - -//=========================== debug define ==================================== - -//=========================== static ========================================== -static const uint8_t chTemplate_default[] = { - 5,6,12,7,15,4,14,11,8,0,1,2,13,3,9,10 -}; - -// refer to RFC8180: https://tools.ietf.org/html/rfc8180#appendix-A.1 -// ASN and join Metric are replaced later when sending an EB -static const uint8_t ebIEsBytestream[] = { - 0x1A,0x88,0x06,0x1A,0x00,0x00, 0x00,0x00, 0x00,0x00,0x01,0x1C,0x00,0x01, - 0xC8,0x00,0x0A,0x1B,0x01,0x00,SLOTFRAME_LENGTH,0x00,SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS,0x00,0x00,0x00,0x00,0x0F -}; -//=========================== define ========================================== - -#define EB_ASN0_OFFSET 4 -#define EB_JP_OFFSET 9 -#define EB_SLOTFRAME_TS_ID_OFFSET 12 -#define EB_SLOTFRAME_CH_ID_OFFSET 15 -#define EB_SLOTFRAME_LEN_OFFSET 20 -#define EB_SLOTFRAME_NUMLINK_OFFSET 22 - -#define EB_IE_LEN 28 - -#define NUM_CHANNELS 16 // number of channels to channel hop on -#define TXRETRIES 15 // number of MAC retries before declaring failed -#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value) -#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize -#define EB_PORTION 10 // set EB on minimal cell for 1/EB_PORTION portion -#define MAXKAPERIOD 1000 // in slots: 1500@20ms per slot -> ~30 seconds. Max value used by adaptive synchronization. -#define DESYNCTIMEOUT 1750 // in slots: 1750@20ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT. -#define LIMITLARGETIMECORRECTION 5 // threshold number of ticks to declare a timeCorrection "large" -#define LENGTH_IEEE154_MAX 128 // max length of a valid radio packet -#define DUTY_CYCLE_WINDOW_LIMIT (0xFFFFFFFF>>1) // limit of the dutycycle window -#define SERIALINHIBITGUARD (1000/PORT_US_PER_TICK) // 32@32kHz ~ 1ms - -//15.4e information elements related -#define IEEE802154E_PAYLOAD_DESC_LEN_SHIFT 0x04 -#define IEEE802154E_PAYLOAD_DESC_GROUP_ID_MLME (1<<11) -#define IEEE802154E_PAYLOAD_DESC_TYPE_MLME (1<<15) -#define IEEE802154E_DESC_TYPE_LONG ((uint16_t)(1<<15)) -#define IEEE802154E_DESC_TYPE_SHORT ((uint16_t)(0<<15)) - -// GROUP_ID changed to 5 (IETF IE) https://openwsn.atlassian.net/browse/FW-569 -#define IANA_IETF_IE_GROUP_ID (5<<11) -#define IANA_IETF_IE_TYPE (1<<15) -#define IEEE802154E_DESC_LEN_PAYLOAD_ID_TYPE_MASK 0xF800 - -#define IEEE802154E_DESC_TYPE_HEADER_IE 0x0000 -#define IEEE802154E_DESC_TYPE_PAYLOAD_IE 0x8000 -//len field on PAYLOAD/HEADER DESC -#define IEEE802154E_DESC_LEN_HEADER_IE_MASK 0x007F -#define IEEE802154E_DESC_LEN_PAYLOAD_IE_MASK 0x07FF - -//groupID/elementID field on PAYLOAD/HEADER DESC -#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_MASK 0x7F80 -#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_MASK 0x7800 - -#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_SHIFT 7 -#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_SHIFT 11 - -//type field on PAYLOAD/HEADER DESC -#define IEEE802154E_DESC_TYPE_IE_MASK 0x8000 - -#define IEEE802154E_DESC_TYPE_IE_SHIFT 15 - -//MLME Sub IE LONG page 83 -#define IEEE802154E_DESC_LEN_LONG_MLME_IE_MASK 0x07FF -#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_MASK 0x7800 - -#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_SHIFT 11 - -//MLME Sub IE SHORT page 82 -#define IEEE802154E_DESC_LEN_SHORT_MLME_IE_MASK 0x00FF -#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_MASK 0x7F00 - -#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_SHIFT 8 - -#define IEEE802154E_MLME_SYNC_IE_SUBID 0x1A -#define IEEE802154E_MLME_SYNC_IE_SUBID_SHIFT 8 -#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID 0x1B -#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID_SHIFT 8 -#define IEEE802154E_MLME_TIMESLOT_IE_SUBID 0x1c -#define IEEE802154E_MLME_TIMESLOT_IE_SUBID_SHIFT 8 -#define IEEE802154E_MLME_CHANNELHOPPING_IE_SUBID 0x09 -#define IEEE802154E_MLME_CHANNELHOPPING_IE_SUBID_SHIFT 11 - -#define IEEE802154E_MLME_IE_GROUPID 0x01 -#define IEEE802154E_ACK_NACK_TIMECORRECTION_ELEMENTID 0x1E - -/** -When a packet is received, it is written inside the OpenQueueEntry_t->packet -buffer, starting at the byte defined below. When a packet is relayed, it -traverses the stack in which the MAC and IPHC headers are parsed and stripped -off, then put on again. During that process, the IPv6 hop limit field is -decremented. Depending on the new value of the hop limit, the IPHC header -compression algorithm might not be able to compress it, and hence has to carry -it inline, adding a byte to the header. To avoid having to move bytes around -inside OpenQueueEntry_t->packet buffer, we start writing the received packet a -bit after the start of the packet. -*/ -#define FIRST_FRAME_BYTE 1 - -// the different states of the IEEE802.15.4e state machine -typedef enum { - S_SLEEP = 0x00, // ready for next slot - // synchronizing - S_SYNCLISTEN = 0x01, // listened for packet to synchronize to network - S_SYNCRX = 0x02, // receiving packet to synchronize to network - S_SYNCPROC = 0x03, // processing packet just received - // TX - S_TXDATAOFFSET = 0x04, // waiting to prepare for Tx data - S_TXDATAPREPARE = 0x05, // preparing for Tx data - S_TXDATAREADY = 0x06, // ready to Tx data, waiting for 'go' - S_TXDATADELAY = 0x07, // 'go' signal given, waiting for SFD Tx data - S_TXDATA = 0x08, // Tx data SFD received, sending bytes - S_RXACKOFFSET = 0x09, // Tx data done, waiting to prepare for Rx ACK - S_RXACKPREPARE = 0x0a, // preparing for Rx ACK - S_RXACKREADY = 0x0b, // ready to Rx ACK, waiting for 'go' - S_RXACKLISTEN = 0x0c, // idle listening for ACK - S_RXACK = 0x0d, // Rx ACK SFD received, receiving bytes - S_TXPROC = 0x0e, // processing sent data - // RX - S_RXDATAOFFSET = 0x0f, // waiting to prepare for Rx data - S_RXDATAPREPARE = 0x10, // preparing for Rx data - S_RXDATAREADY = 0x11, // ready to Rx data, waiting for 'go' - S_RXDATALISTEN = 0x12, // idle listening for data - S_RXDATA = 0x13, // data SFD received, receiving more bytes - S_TXACKOFFSET = 0x14, // waiting to prepare for Tx ACK - S_TXACKPREPARE = 0x15, // preparing for Tx ACK - S_TXACKREADY = 0x16, // Tx ACK ready, waiting for 'go' - S_TXACKDELAY = 0x17, // 'go' signal given, waiting for SFD Tx ACK - S_TXACK = 0x18, // Tx ACK SFD received, sending bytes - S_RXPROC = 0x19, // processing received data -} ieee154e_state_t; - -#define TIMESLOT_TEMPLATE_ID 0x00 -#define CHANNELHOPPING_TEMPLATE_ID 0x00 - -// Atomic durations -// expressed in 32kHz ticks: -// - ticks = duration_in_seconds * 32768 -// - duration_in_seconds = ticks / 32768 -enum ieee154e_atomicdurations_enum { - -// time-slot related -#if SLOTDURATION==10 - TsTxOffset = (2120/PORT_US_PER_TICK), // 2120us - TsLongGT = (1100/PORT_US_PER_TICK), // 1100us - TsTxAckDelay = (1000/PORT_US_PER_TICK), // 1000us - TsShortGT = (500/PORT_US_PER_TICK), // 500us, The standardlized value for this is 400/2=200us(7ticks). Currectly 7 doesn't work for short packet, change it back to 7 when found the problem. - wdRadioTx = (1342/PORT_US_PER_TICK), // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works) - wdDataDuration = (5000/PORT_US_PER_TICK), // 5000us (measured 4280us with max payload) - wdAckDuration = (3000/PORT_US_PER_TICK), // 3000us (measured 1000us) -#endif - -#if SLOTDURATION==20 - TsTxOffset = (5215/PORT_US_PER_TICK), // 5215us - TsLongGT = (1311/PORT_US_PER_TICK), // 1311us - TsTxAckDelay = (5521/PORT_US_PER_TICK), // 5521us - TsShortGT = (700/PORT_US_PER_TICK), // 700us - wdRadioTx = (1342/PORT_US_PER_TICK), // 1000us (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works) - wdDataDuration = (5000/PORT_US_PER_TICK), // 5000us (measured 4280us with max payload) - wdAckDuration = (3000/PORT_US_PER_TICK), // 3000us (measured 1000us) -#endif - -#if SLOTDURATION==160 - TsTxOffset = (10986/PORT_US_PER_TICK), // 360 ticks, 10986us - TsLongGT = (7324/PORT_US_PER_TICK), // 240 ticks, 7324us - TsTxAckDelay = (11047/PORT_US_PER_TICK), // 362 ticks, 11047us - TsShortGT = (1831/PORT_US_PER_TICK), // 60 ticksz 1831us - // radio watchdog - wdRadioTx = (7019/PORT_US_PER_TICK), // 230 ticks 7019us delayTx+Tx time for 10 bytes( (needs to be >delayTx) (SCuM need a larger value, 45 is tested and works) - wdDataDuration = (81238/PORT_US_PER_TICK), // 2662 ticks 81238us (measured with max payload) - wdAckDuration = (18310/PORT_US_PER_TICK), // 600 ticks 18310us (measured) - -#endif - TsSlotDuration = PORT_TsSlotDuration, - // execution speed related - maxTxDataPrepare = PORT_maxTxDataPrepare, - maxRxAckPrepare = PORT_maxRxAckPrepare, - maxRxDataPrepare = PORT_maxRxDataPrepare, - maxTxAckPrepare = PORT_maxTxAckPrepare, - // radio speed related - delayTx = PORT_delayTx, // between GO signal and SFD - delayRx = PORT_delayRx, // between GO signal and start listening - // radio watchdog - -}; - -//shift of bytes in the linkOption bitmap: draft-ietf-6tisch-minimal-10.txt: page 6 -enum ieee154e_linkOption_enum { - FLAG_TX_S = 0, - FLAG_RX_S = 1, - FLAG_SHARED_S = 2, - FLAG_TIMEKEEPING_S = 3, -}; - -// FSM timer durations (combinations of atomic durations) -// TX -#define DURATION_tt1 ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx-maxTxDataPrepare -#define DURATION_tt2 ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx -#define DURATION_tt3 ieee154e_vars.lastCapturedTime+TsTxOffset-delayTx+wdRadioTx -#define DURATION_tt4 ieee154e_vars.lastCapturedTime+wdDataDuration -#define DURATION_tt5 ieee154e_vars.lastCapturedTime+TsTxAckDelay-TsShortGT-delayRx-maxRxAckPrepare -#define DURATION_tt6 ieee154e_vars.lastCapturedTime+TsTxAckDelay-TsShortGT-delayRx -#define DURATION_tt7 ieee154e_vars.lastCapturedTime+TsTxAckDelay+TsShortGT -#define DURATION_tt8 ieee154e_vars.lastCapturedTime+wdAckDuration -// RX -#define DURATION_rt1 ieee154e_vars.lastCapturedTime+TsTxOffset-TsLongGT-delayRx-maxRxDataPrepare -#define DURATION_rt2 ieee154e_vars.lastCapturedTime+TsTxOffset-TsLongGT-delayRx -#define DURATION_rt3 ieee154e_vars.lastCapturedTime+TsTxOffset+TsLongGT -#define DURATION_rt4 ieee154e_vars.lastCapturedTime+wdDataDuration -#define DURATION_rt5 ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx-maxTxAckPrepare -#define DURATION_rt6 ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx -#define DURATION_rt7 ieee154e_vars.lastCapturedTime+TsTxAckDelay-delayTx+wdRadioTx -#define DURATION_rt8 ieee154e_vars.lastCapturedTime+wdAckDuration -// serialInhibit -#define DURATION_si ieee154e_vars.slotDuration-SERIALINHIBITGUARD - -//=========================== typedef ========================================= - -// IEEE802.15.4E acknowledgement (ACK) -typedef struct { - PORT_SIGNED_INT_WIDTH timeCorrection; -} IEEE802154E_ACK_ht; - -//=========================== module variables ================================ - -typedef struct { - // misc - asn_t asn; // current absolute slot number - slotOffset_t slotOffset; // current slot offset - slotOffset_t nextActiveSlotOffset; // next active slot offset - PORT_TIMER_WIDTH deSyncTimeout; // how many slots left before looses sync - bool isSync; // TRUE iff mote is synchronized to network - OpenQueueEntry_t localCopyForTransmission;// copy of the frame used for current TX - PORT_TIMER_WIDTH numOfSleepSlots; // number of slots to sleep between active slots - // as shown on the chronogram - ieee154e_state_t state; // state of the FSM - OpenQueueEntry_t* dataToSend; // pointer to the data to send - OpenQueueEntry_t* dataReceived; // pointer to the data received - OpenQueueEntry_t* ackToSend; // pointer to the ack to send - OpenQueueEntry_t* ackReceived; // pointer to the ack received - PORT_TIMER_WIDTH lastCapturedTime; // last captured time - PORT_TIMER_WIDTH syncCapturedTime; // captured time used to sync - // channel hopping - uint8_t freq; // frequency of the current slot - uint8_t asnOffset; // offset inside the frame - uint8_t singleChannel; // the single channel used for transmission - bool singleChannelChanged; // detect id singleChannelChanged - uint8_t chTemplate[NUM_CHANNELS];// storing the template of hopping sequence - // template ID - uint8_t tsTemplateId; // timeslot template id - uint8_t chTemplateId; // channel hopping tempalte id - - PORT_TIMER_WIDTH radioOnInit; // when within the slot the radio turns on - PORT_TIMER_WIDTH radioOnTics; // how many tics within the slot the radio is on - bool radioOnThisSlot; // to control if the radio has been turned on in a slot. - - // control - bool isAckEnabled; // whether reply for ack, used for synchronization test - bool isSecurityEnabled; // whether security is applied - // time correction - int16_t timeCorrection; // store the timeCorrection, prepend and retrieve it inside of frame header - - uint16_t slotDuration; // duration of slot - opentimers_id_t timerId; // id of timer used for implementing TSCH slot FSM - uint32_t startOfSlotReference; // the time refer to the beginning of slot - opentimers_id_t serialInhibitTimerId; // id of serial inhibit timer used for scheduling serial output - - // for msf downstream traffic adaptation - uint32_t receivedFrameFromParent; // True when received a frame from parent - - uint16_t compensatingCounter; -} ieee154e_vars_t; - -BEGIN_PACK -typedef struct { - uint8_t numSyncPkt; // how many times synchronized on a non-ACK packet - uint8_t numSyncAck; // how many times synchronized on an ACK - int16_t minCorrection; // minimum time correction - int16_t maxCorrection; // maximum time correction - uint8_t numDeSync; // number of times a desync happened - uint32_t numTicsOn; // mac dutyCycle - uint32_t numTicsTotal; // total tics for which the dutycycle is computed -} ieee154e_stats_t; -END_PACK - -typedef struct { - PORT_TIMER_WIDTH num_newSlot; - PORT_TIMER_WIDTH num_timer; - PORT_TIMER_WIDTH num_startOfFrame; - PORT_TIMER_WIDTH num_endOfFrame; -} ieee154e_dbg_t; - -//=========================== prototypes ====================================== - -// admin -void ieee154e_init(void); -// public -PORT_TIMER_WIDTH ieee154e_asnDiff(asn_t* someASN); -#ifdef DEADLINE_OPTION_ENABLED -int16_t ieee154e_computeAsnDiff(asn_t* h_asn, asn_t* l_asn); -void ieee154e_calculateExpTime(uint16_t max_delay, uint8_t* et_asn); -void ieee154e_orderToASNStructure(uint8_t* in,asn_t* val_asn); -#endif -bool ieee154e_isSynch(void); -void ieee154e_getAsn(uint8_t* array); -void ieee154e_setIsAckEnabled(bool isEnabled); -void ieee154e_setSingleChannel(uint8_t channel); -void ieee154e_setIsSecurityEnabled(bool isEnabled); -void ieee154e_setSlotDuration(uint16_t duration); -uint16_t ieee154e_getSlotDuration(void); - -uint16_t ieee154e_getTimeCorrection(void); -void ieee154e_getTicsInfo(uint32_t* numTicsOn, uint32_t* numTicsTotal); -// events -void ieee154e_startOfFrame(PORT_TIMER_WIDTH capturedTime); -void ieee154e_endOfFrame(PORT_TIMER_WIDTH capturedTime); -// misc -bool debugPrint_asn(void); -bool debugPrint_isSync(void); -bool debugPrint_macStats(void); - -/** -\} -\} -*/ - -#endif - +#ifndef __IEEE802154E_H +#define __IEEE802154E_H + +/** +\addtogroup MAClow +\{ +\addtogroup IEEE802154E +\{ +*/ + +#include "opendefs.h" +#include "board.h" +#include "opentimers.h" +#include "schedule.h" + +//=========================== debug define ==================================== + +//=========================== static ========================================== +static const uint8_t chTemplate_default[] = { + 5,6,12,7,15,4,14,11,8,0,1,2,13,3,9,10 +}; + +// refer to RFC8180: https://tools.ietf.org/html/rfc8180#appendix-A.1 +// ASN and join Metric are replaced later when sending an EB +static const uint8_t ebIEsBytestream[] = { + 0x1A,0x88,0x06,0x1A,0x00,0x00, 0x00,0x00, 0x00,0x00,0x01,0x1C,0x00,0x01, + 0xC8,0x00,0x0A,0x1B,0x01,0x00,SLOTFRAME_LENGTH,0x00,SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS,0x00,0x00,0x00,0x00,0x0F +}; +//=========================== define ========================================== + +#define EB_ASN0_OFFSET 4 +#define EB_JP_OFFSET 9 +#define EB_SLOTFRAME_TS_ID_OFFSET 12 +#define EB_SLOTFRAME_CH_ID_OFFSET 15 +#define EB_SLOTFRAME_LEN_OFFSET 20 +#define EB_SLOTFRAME_NUMLINK_OFFSET 22 + +#define EB_IE_LEN 28 + +#define NUM_CHANNELS 16 // number of channels to channel hop on +#define TXRETRIES 15 // number of MAC retries before declaring failed +#define TX_POWER 31 // 1=-25dBm, 31=0dBm (max value) +#define RESYNCHRONIZATIONGUARD 5 // in 32kHz ticks. min distance to the end of the slot to successfully synchronize +#define EB_PORTION 10 // set EB on minimal cell for 1/EB_PORTION portion +#define MAXKAPERIOD 1000 // in slots: 1500@20ms per slot -> ~30 seconds. Max value used by adaptive synchronization. +#define DESYNCTIMEOUT 1750 // in slots: 1750@20ms per slot -> ~35 seconds. A larger DESYNCTIMEOUT is needed if using a larger KATIMEOUT. +#define LIMITLARGETIMECORRECTION 5 // threshold number of ticks to declare a timeCorrection "large" +#define LENGTH_IEEE154_MAX 128 // max length of a valid radio packet +#define DUTY_CYCLE_WINDOW_LIMIT (0xFFFFFFFF>>1) // limit of the dutycycle window +#define SERIALINHIBITGUARD (1000/PORT_US_PER_TICK) // 32@32kHz ~ 1ms + +//15.4e information elements related +#define IEEE802154E_PAYLOAD_DESC_LEN_SHIFT 0x04 +#define IEEE802154E_PAYLOAD_DESC_GROUP_ID_MLME (1<<11) +#define IEEE802154E_PAYLOAD_DESC_TYPE_MLME (1<<15) +#define IEEE802154E_DESC_TYPE_LONG ((uint16_t)(1<<15)) +#define IEEE802154E_DESC_TYPE_SHORT ((uint16_t)(0<<15)) + +// GROUP_ID changed to 5 (IETF IE) https://openwsn.atlassian.net/browse/FW-569 +#define IANA_IETF_IE_GROUP_ID (5<<11) +#define IANA_IETF_IE_TYPE (1<<15) +#define IEEE802154E_DESC_LEN_PAYLOAD_ID_TYPE_MASK 0xF800 + +#define IEEE802154E_DESC_TYPE_HEADER_IE 0x0000 +#define IEEE802154E_DESC_TYPE_PAYLOAD_IE 0x8000 +//len field on PAYLOAD/HEADER DESC +#define IEEE802154E_DESC_LEN_HEADER_IE_MASK 0x007F +#define IEEE802154E_DESC_LEN_PAYLOAD_IE_MASK 0x07FF + +//groupID/elementID field on PAYLOAD/HEADER DESC +#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_MASK 0x7F80 +#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_MASK 0x7800 + +#define IEEE802154E_DESC_ELEMENTID_HEADER_IE_SHIFT 7 +#define IEEE802154E_DESC_GROUPID_PAYLOAD_IE_SHIFT 11 + +//type field on PAYLOAD/HEADER DESC +#define IEEE802154E_DESC_TYPE_IE_MASK 0x8000 + +#define IEEE802154E_DESC_TYPE_IE_SHIFT 15 + +//MLME Sub IE LONG page 83 +#define IEEE802154E_DESC_LEN_LONG_MLME_IE_MASK 0x07FF +#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_MASK 0x7800 + +#define IEEE802154E_DESC_SUBID_LONG_MLME_IE_SHIFT 11 + +//MLME Sub IE SHORT page 82 +#define IEEE802154E_DESC_LEN_SHORT_MLME_IE_MASK 0x00FF +#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_MASK 0x7F00 + +#define IEEE802154E_DESC_SUBID_SHORT_MLME_IE_SHIFT 8 + +#define IEEE802154E_MLME_SYNC_IE_SUBID 0x1A +#define IEEE802154E_MLME_SYNC_IE_SUBID_SHIFT 8 +#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID 0x1B +#define IEEE802154E_MLME_SLOTFRAME_LINK_IE_SUBID_SHIFT 8 +#define IEEE802154E_MLME_TIMESLOT_IE_SUBID 0x1c +#define IEEE802154E_MLME_TIMESLOT_IE_SUBID_SHIFT 8 +#define IEEE802154E_MLME_CHANNELHOPPING_IE_SUBID 0x09 +#define IEEE802154E_MLME_CHANNELHOPPING_IE_SUBID_SHIFT 11 + +#define IEEE802154E_MLME_IE_GROUPID 0x01 +#define IEEE802154E_ACK_NACK_TIMECORRECTION_ELEMENTID 0x1E + +/** +When a packet is received, it is written inside the OpenQueueEntry_t->packet +buffer, starting at the byte defined below. When a packet is relayed, it +traverses the stack in which the MAC and IPHC headers are parsed and stripped +off, then put on again. During that process, the IPv6 hop limit field is +decremented. Depending on the new value of the hop limit, the IPHC header +compression algorithm might not be able to compress it, and hence has to carry +it inline, adding a byte to the header. To avoid having to move bytes around +inside OpenQueueEntry_t->packet buffer, we start writing the received packet a +bit after the start of the packet. +*/ +#define FIRST_FRAME_BYTE 1 + +// the different states of the IEEE802.15.4e state machine +typedef enum { + S_SLEEP = 0x00, // ready for next slot + // synchronizing + S_SYNCLISTEN = 0x01, // listened for packet to synchronize to network + S_SYNCRX = 0x02, // receiving packet to synchronize to network + S_SYNCPROC = 0x03, // processing packet just received + // TX + S_TXDATAOFFSET = 0x04, // waiting to prepare for Tx data + S_TXDATAPREPARE = 0x05, // preparing for Tx data + S_TXDATAREADY = 0x06, // ready to Tx data, waiting for 'go' + S_TXDATADELAY = 0x07, // 'go' signal given, waiting for SFD Tx data + S_TXDATA = 0x08, // Tx data SFD received, sending bytes + S_RXACKOFFSET = 0x09, // Tx data done, waiting to prepare for Rx ACK + S_RXACKPREPARE = 0x0a, // preparing for Rx ACK + S_RXACKREADY = 0x0b, // ready to Rx ACK, waiting for 'go' + S_RXACKLISTEN = 0x0c, // idle listening for ACK + S_RXACK = 0x0d, // Rx ACK SFD received, receiving bytes + S_TXPROC = 0x0e, // processing sent data + // RX + S_RXDATAOFFSET = 0x0f, // waiting to prepare for Rx data + S_RXDATAPREPARE = 0x10, // preparing for Rx data + S_RXDATAREADY = 0x11, // ready to Rx data, waiting for 'go' + S_RXDATALISTEN = 0x12, // idle listening for data + S_RXDATA = 0x13, // data SFD received, receiving more bytes + S_TXACKOFFSET = 0x14, // waiting to prepare for Tx ACK + S_TXACKPREPARE = 0x15, // preparing for Tx ACK + S_TXACKREADY = 0x16, // Tx ACK ready, waiting for 'go' + S_TXACKDELAY = 0x17, // 'go' signal given, waiting for SFD Tx ACK + S_TXACK = 0x18, // Tx ACK SFD received, sending bytes + S_RXPROC = 0x19, // processing received data +} ieee154e_state_t; + +#define TIMESLOT_TEMPLATE_ID 0x00 +#define CHANNELHOPPING_TEMPLATE_ID 0x00 + +//===== Slot Template Configurations + +//general MAC slot template +typedef struct { + uint16_t TsTxOffset; + uint16_t TsLongGT; + uint16_t TsTxAckDelay; + uint16_t TsShortGT; + uint16_t wdRadioTx; + uint16_t wdDataDuration; + uint16_t wdAckDuration; +} slot_154e_vars_t; + + +//======== global 802154e atomic duration variables + +// - ticks = duration_in_seconds * 32768 +// - duration_in_seconds = ticks / 32768 + +// This slotTemplate should be instantiated only once for the currently used slotTemplate +typedef struct { + +// 1. slot template variables +// data transmission template +uint16_t TsTxOffset; //tx +uint16_t TsLongGT; //rx + +// ack transmission template +uint16_t TsTxAckDelay; //tx +uint16_t TsShortGT; //rx + +// watchdog (safety check) template +uint16_t wdRadioTx; +uint16_t wdDataDuration; +uint16_t wdAckDuration; + +// 2. board/implementation specific durations +// note that these variables MUST respect (i.e. fit) the slot template section 1 in order for the scedule to maintain its integrity. + +uint16_t slotDuration; +uint16_t maxTxDataPrepare; +uint16_t maxRxAckPrepare; +uint16_t maxRxDataPrepare; +uint16_t maxTxAckPrepare; + +//3. radio setting specific durations + +// this parameter is specifically helpful in tuning the radio transmission timing to meet the TsTxOffset for accurate synchronization +uint16_t delayTx; // between GO signal and SFD + +// this parameter is helpful to have the radio listen later or earlier to save energy in listening state. +uint16_t delayRx; // between GO signal and start listening +} slotTemplate_t; + +//shift of bytes in the linkOption bitmap: draft-ietf-6tisch-minimal-10.txt: page 6 +enum ieee154e_linkOption_enum { + FLAG_TX_S = 0, + FLAG_RX_S = 1, + FLAG_SHARED_S = 2, + FLAG_TIMEKEEPING_S = 3, +}; + +// FSM timer durations (combinations of atomic durations) +// TX +#define DURATION_tt1 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxOffset-slotTemplate.delayTx-slotTemplate.maxTxDataPrepare +#define DURATION_tt2 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxOffset-slotTemplate.delayTx +#define DURATION_tt3 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxOffset-slotTemplate.delayTx+slotTemplate.wdRadioTx +#define DURATION_tt4 ieee154e_vars.lastCapturedTime+slotTemplate.wdDataDuration +#define DURATION_tt5 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxAckDelay-slotTemplate.TsShortGT-slotTemplate.delayRx-slotTemplate.maxRxAckPrepare +#define DURATION_tt6 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxAckDelay-slotTemplate.TsShortGT-slotTemplate.delayRx +#define DURATION_tt7 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxAckDelay+slotTemplate.TsShortGT +#define DURATION_tt8 ieee154e_vars.lastCapturedTime+slotTemplate.wdAckDuration +// RX +#define DURATION_rt1 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxOffset-slotTemplate.TsLongGT-slotTemplate.delayRx-slotTemplate.maxRxDataPrepare +#define DURATION_rt2 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxOffset-slotTemplate.TsLongGT-slotTemplate.delayRx +#define DURATION_rt3 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxOffset+slotTemplate.TsLongGT +#define DURATION_rt4 ieee154e_vars.lastCapturedTime+slotTemplate.wdDataDuration +#define DURATION_rt5 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxAckDelay-slotTemplate.delayTx-slotTemplate.maxTxAckPrepare +#define DURATION_rt6 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxAckDelay-slotTemplate.delayTx +#define DURATION_rt7 ieee154e_vars.lastCapturedTime+slotTemplate.TsTxAckDelay-slotTemplate.delayTx+slotTemplate.wdRadioTx +#define DURATION_rt8 ieee154e_vars.lastCapturedTime+slotTemplate.wdAckDuration +// serialInhibit +#define DURATION_si ieee154e_vars.slotDuration-SERIALINHIBITGUARD + +//=========================== typedef ========================================= + +// IEEE802.15.4E acknowledgement (ACK) +typedef struct { + PORT_SIGNED_INT_WIDTH timeCorrection; +} IEEE802154E_ACK_ht; + +//=========================== module variables ================================ + +typedef struct { + // misc + asn_t asn; // current absolute slot number + slotOffset_t slotOffset; // current slot offset + slotOffset_t nextActiveSlotOffset; // next active slot offset + PORT_TIMER_WIDTH deSyncTimeout; // how many slots left before looses sync + bool isSync; // TRUE iff mote is synchronized to network + OpenQueueEntry_t localCopyForTransmission;// copy of the frame used for current TX + PORT_TIMER_WIDTH numOfSleepSlots; // number of slots to sleep between active slots + // as shown on the chronogram + ieee154e_state_t state; // state of the FSM + OpenQueueEntry_t* dataToSend; // pointer to the data to send + OpenQueueEntry_t* dataReceived; // pointer to the data received + OpenQueueEntry_t* ackToSend; // pointer to the ack to send + OpenQueueEntry_t* ackReceived; // pointer to the ack received + PORT_TIMER_WIDTH lastCapturedTime; // last captured time + PORT_TIMER_WIDTH syncCapturedTime; // captured time used to sync + // channel hopping + uint8_t freq; // frequency of the current slot + uint8_t asnOffset; // offset inside the frame + uint8_t singleChannel; // the single channel used for transmission + bool singleChannelChanged; // detect id singleChannelChanged + uint8_t chTemplate[NUM_CHANNELS];// storing the template of hopping sequence + // template ID + uint8_t tsTemplateId; // timeslot template id + uint8_t chTemplateId; // channel hopping tempalte id + + PORT_TIMER_WIDTH radioOnInit; // when within the slot the radio turns on + PORT_TIMER_WIDTH radioOnTics; // how many tics within the slot the radio is on + PORT_TIMER_WIDTH radioTxRxInit; // when within the slot the radio tx/rx activity begins + PORT_TIMER_WIDTH radioTxTics; // how many tics within the slot the radio is transmitting + PORT_TIMER_WIDTH radioRxTics; // how many tics within the slot the radio is receiving + bool radioOnThisSlot; // to control if the radio has been turned on in a slot. + + // control + bool isAckEnabled; // whether reply for ack, used for synchronization test + bool isSecurityEnabled; // whether security is applied + // time correction + int16_t timeCorrection; // store the timeCorrection, prepend and retrieve it inside of frame header + + uint16_t slotDuration; // duration of slot + opentimers_id_t timerId; // id of timer used for implementing TSCH slot FSM + uint32_t startOfSlotReference; // the time refer to the beginning of slot + opentimers_id_t serialInhibitTimerId; // id of serial inhibit timer used for scheduling serial output + + // for msf downstream traffic adaptation + uint32_t receivedFrameFromParent; // True when received a frame from parent + + uint16_t compensatingCounter; + +} ieee154e_vars_t; + +BEGIN_PACK +typedef struct { + uint8_t numSyncPkt; // how many times synchronized on a non-ACK packet + uint8_t numSyncAck; // how many times synchronized on an ACK + int16_t minCorrection; // minimum time correction + int16_t maxCorrection; // maximum time correction + uint8_t numDeSync; // number of times a desync happened + uint32_t numTicsOn; // mac dutyCycle + uint32_t numTicsTotal; // total tics for which the dutycycle is computed + uint32_t numTxTics; // mac tx dutyCycle + uint32_t numRxTics; // mac rx dutyCycle +} ieee154e_stats_t; +END_PACK + +typedef struct { + PORT_TIMER_WIDTH num_newSlot; + PORT_TIMER_WIDTH num_timer; + PORT_TIMER_WIDTH num_startOfFrame; + PORT_TIMER_WIDTH num_endOfFrame; +} ieee154e_dbg_t; + +//=========================== prototypes ====================================== + +// admin +void ieee154e_init(void); +void ieee154e_slot_template_init(void); +void ieee154e_select_slot_template(slotType_t slotType); +slotTemplate_t ieee154e_getSlotTemplate (void); +// public +PORT_TIMER_WIDTH ieee154e_asnDiff(asn_t* someASN); +#ifdef DEADLINE_OPTION_ENABLED +int16_t ieee154e_computeAsnDiff(asn_t* h_asn, asn_t* l_asn); +void ieee154e_calculateExpTime(uint16_t max_delay, uint8_t* et_asn); +void ieee154e_orderToASNStructure(uint8_t* in,asn_t* val_asn); +#endif +bool ieee154e_isSynch(void); +void ieee154e_getAsn(uint8_t* array); +void ieee154e_setIsAckEnabled(bool isEnabled); +void ieee154e_setSingleChannel(uint8_t channel); +void ieee154e_setIsSecurityEnabled(bool isEnabled); +void ieee154e_setSlotDuration(uint16_t duration); +uint16_t ieee154e_getSlotDuration(void); + +uint16_t ieee154e_getTimeCorrection(void); +void ieee154e_getTicsInfo(uint32_t* numTicsOn, uint32_t* numTicsTotal); +void ieee154e_getRadioTicsInfo(uint32_t* numTxTics, uint32_t* numRxTics, uint32_t* numTicsTotal); +// events +void ieee154e_startOfFrame(PORT_TIMER_WIDTH capturedTime); +void ieee154e_endOfFrame(PORT_TIMER_WIDTH capturedTime); +// misc +bool debugPrint_asn(void); +bool debugPrint_isSync(void); +bool debugPrint_macStats(void); +void ieee154e_resetStats(void); + +/** +\} +\} +*/ + +#endif + diff --git a/openstack/02b-MAChigh/schedule.h b/openstack/02b-MAChigh/schedule.h index dc3b9f50e1..472cdee9b4 100644 --- a/openstack/02b-MAChigh/schedule.h +++ b/openstack/02b-MAChigh/schedule.h @@ -17,7 +17,7 @@ The superframe reappears over time and can be arbitrarily long. */ -#define SLOTFRAME_LENGTH 101 //should be 101 +#define SLOTFRAME_LENGTH 41 //should be 101 //draft-ietf-6tisch-minimal-06 #define SCHEDULE_MINIMAL_6TISCH_ACTIVE_CELLS 1 diff --git a/openstack/02b-MAChigh/sixtop.c b/openstack/02b-MAChigh/sixtop.c index b42926b194..ef9d143674 100644 --- a/openstack/02b-MAChigh/sixtop.c +++ b/openstack/02b-MAChigh/sixtop.c @@ -31,7 +31,6 @@ //=========================== variables ======================================= sixtop_vars_t sixtop_vars; - //=========================== prototypes ====================================== // send internal @@ -51,9 +50,9 @@ void timer_sixtop_sendEb_fired(void); void timer_sixtop_management_fired(void); void sixtop_sendEB(void); void sixtop_sendKA(void); +uint8_t get_dynamic_eb_portion (void); //=== six2six task - void timer_sixtop_six2six_timeout_fired(void); void sixtop_six2six_sendDone( OpenQueueEntry_t* msg, @@ -117,7 +116,7 @@ void sixtop_init(void) { sixtop_vars.ebSendingTimerId = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_SIXTOP); opentimers_scheduleIn( sixtop_vars.ebSendingTimerId, - SLOTFRAME_LENGTH*SLOTDURATION, + SLOTFRAME_LENGTH*(SLOTDURATION_MS), TIME_MS, TIMER_PERIODIC, sixtop_sendingEb_timer_cb @@ -608,6 +607,7 @@ owerror_t sixtop_send_internal( // this is a new packet which I never attempted to send msg->l2_numTxAttempts = 0; // transmit with the default TX power + msg->l1_txPower = TX_POWER; // add a IEEE802.15.4 header ieee802154_prependHeader( @@ -674,9 +674,17 @@ void sixtop_timeout_timer_cb(opentimers_id_t id) { //======= EB/KA task +uint8_t get_dynamic_eb_portion (void){ + uint8_t i = neighbors_getNumNeighbors (); + if (icreator = COMPONENT_FRAG; allocate_vrb(msg, size, tag); - return iphc_receive(msg); + iphc_receive(msg); } } } else if (dispatch == DISPATCH_FRAG_SUBSEQ) { @@ -436,7 +435,6 @@ static void store_fragment(OpenQueueEntry_t *msg, uint16_t size, uint16_t tag, u for (i = 0; i < FRAGMENT_BUFFER_SIZE; i++) { if (frag_vars.fragmentBuf[i].datagram_tag == tag && frag_vars.fragmentBuf[i].datagram_offset == offset) { openqueue_freePacketBuffer(msg); - return; } if (frag_vars.fragmentBuf[i].datagram_tag == tag && frag_vars.fragmentBuf[i].reassembly_timer != 0) { diff --git a/openstack/03a-IPHC/frag.h b/openstack/03a-IPHC/frag.h index 54b3998b52..7c778c6bbe 100644 --- a/openstack/03a-IPHC/frag.h +++ b/openstack/03a-IPHC/frag.h @@ -27,7 +27,7 @@ * If L2 security is not active MAX_FRAGMENT_SIZE can be set to 96 bytes, but the corresponding variable in * openvisualizer must then also be updated to the same value. */ -#define MAX_FRAGMENT_SIZE 80 +#define MAX_FRAGMENT_SIZE 96 #define FRAGMENT_BUFFER_SIZE (((IPV6_PACKET_SIZE / MAX_FRAGMENT_SIZE) + 1) * BIGQUEUELENGTH) #define NUM_OF_VRBS 2 diff --git a/openstack/03b-IPv6/icmpv6rpl.c b/openstack/03b-IPv6/icmpv6rpl.c index 86e1c7d3f9..06f090ed14 100644 --- a/openstack/03b-IPv6/icmpv6rpl.c +++ b/openstack/03b-IPv6/icmpv6rpl.c @@ -131,7 +131,7 @@ void icmpv6rpl_init(void) { opentimers_scheduleIn( icmpv6rpl_vars.timerIdDIO, - SLOTFRAME_LENGTH*SLOTDURATION, + SLOTFRAME_LENGTH*(SLOTDURATION_MS), TIME_MS, TIMER_PERIODIC, icmpv6rpl_timer_DIO_cb @@ -180,7 +180,7 @@ void icmpv6rpl_init(void) { icmpv6rpl_vars.timerIdDAO = opentimers_create(TIMER_GENERAL_PURPOSE, TASKPRIO_RPL); opentimers_scheduleIn( icmpv6rpl_vars.timerIdDAO, - SLOTFRAME_LENGTH*SLOTDURATION, + SLOTFRAME_LENGTH*(SLOTDURATION_MS), TIME_MS, TIMER_PERIODIC, icmpv6rpl_timer_DAO_cb diff --git a/openstack/03b-IPv6/icmpv6rpl.h b/openstack/03b-IPv6/icmpv6rpl.h index f98f5d753b..fad92255af 100644 --- a/openstack/03b-IPv6/icmpv6rpl.h +++ b/openstack/03b-IPv6/icmpv6rpl.h @@ -12,7 +12,7 @@ //=========================== define ========================================== -#define DIO_PERIOD 10000 // in miliseconds +#define DIO_PERIOD 20000 // in miliseconds //original 10000 #define DAO_PERIOD 60000 // in miliseconds // Non-Storing Mode of Operation (1) diff --git a/openstack/cross-layers/openqueue.c b/openstack/cross-layers/openqueue.c index 1bc569dd5a..97d69d8071 100644 --- a/openstack/cross-layers/openqueue.c +++ b/openstack/cross-layers/openqueue.c @@ -15,6 +15,7 @@ //=========================== variables ======================================= openqueue_vars_t openqueue_vars; +openqueue_stats_t openqueue_stats; //=========================== prototypes ====================================== @@ -22,6 +23,10 @@ void openqueue_reset_entry(OpenQueueEntry_t *entry); void openqueue_reset_big_entry(OpenQueueBigEntry_t *entry); +void openqueue_update_stats(void); + +uint8_t openqueue_getBusyPacketBufferSize(void); + //=========================== public ========================================== //======= admin @@ -38,6 +43,8 @@ void openqueue_init(void) { for (i = 0; i < BIGQUEUELENGTH; i++) { openqueue_reset_big_entry(&(openqueue_vars.big_queue[i])); } + + openqueue_reset_stats(); } /** @@ -97,6 +104,7 @@ OpenQueueEntry_t* openqueue_getFreePacketBuffer(uint8_t creator) { if (openqueue_vars.queue[i].owner == COMPONENT_NULL) { openqueue_vars.queue[i].creator = creator; openqueue_vars.queue[i].owner = COMPONENT_OPENQUEUE; + openqueue_update_stats(); ENABLE_INTERRUPTS(); return &openqueue_vars.queue[i]; } @@ -123,7 +131,6 @@ OpenQueueEntry_t* openqueue_getFreeBigPacketBuffer(uint8_t creator) { openqueue_vars.big_queue[i].standard_entry.creator = creator; openqueue_vars.big_queue[i].standard_entry.owner = COMPONENT_OPENQUEUE; openqueue_vars.big_queue[i].standard_entry.is_big_packet = TRUE; - ENABLE_INTERRUPTS(); return &openqueue_vars.big_queue[i].standard_entry; @@ -134,6 +141,7 @@ OpenQueueEntry_t* openqueue_getFreeBigPacketBuffer(uint8_t creator) { return NULL; } + /** \brief Free a previously-allocated packet buffer. @@ -157,7 +165,6 @@ owerror_t openqueue_freePacketBuffer(OpenQueueEntry_t *pkt) { (errorparameter_t) 0, (errorparameter_t) 0); } - openqueue_reset_big_entry((OpenQueueBigEntry_t *) pkt); ENABLE_INTERRUPTS(); return E_SUCCESS; @@ -174,6 +181,7 @@ owerror_t openqueue_freePacketBuffer(OpenQueueEntry_t *pkt) { (errorparameter_t) 0); } openqueue_reset_entry(&(openqueue_vars.queue[i])); + openqueue_update_stats(); ENABLE_INTERRUPTS(); return E_SUCCESS; } @@ -189,6 +197,7 @@ owerror_t openqueue_freePacketBuffer(OpenQueueEntry_t *pkt) { return E_FAIL; } + /** \brief Free all the packet buffers created by a specific module. @@ -212,7 +221,7 @@ void openqueue_removeAllCreatedBy(uint8_t creator) { openqueue_reset_big_entry(&(openqueue_vars.big_queue[i])); } } - + openqueue_update_stats(); ENABLE_INTERRUPTS(); } @@ -481,9 +490,56 @@ OpenQueueEntry_t* openqueue_macGetUnicastPakcet(open_addr_t* toNeighbor){ } +openqueue_stats_t openqueue_get_stats(void) +{ + return openqueue_stats; +} //=========================== private ========================================= +/** +\brief Get the size of the busy packet buffer + +This is used at the moment for statistical measurements purposes to see the +impact of different configurations on the average buffer size. + +\returns an uint with the number of waiting packets in the buffer +*/ +uint8_t openqueue_getBusyPacketBufferSize() { + uint8_t i; + uint8_t busy_buffer_size = 0; + + INTERRUPT_DECLARATION(); + DISABLE_INTERRUPTS(); + // walk through queue and find free entry + for (i = 0; i < QUEUELENGTH; i++) { + if (openqueue_vars.queue[i].owner != COMPONENT_NULL) { + busy_buffer_size++; + } + } + ENABLE_INTERRUPTS(); + return busy_buffer_size; +} + + +void openqueue_update_stats(void){ + // update the stats + uint8_t buffSize = openqueue_getBusyPacketBufferSize(); + if (buffSize>openqueue_stats.maxBuffSize){ + openqueue_stats.maxBuffSize = buffSize; + } + + if (buffSize< openqueue_stats.minBuffSize){ + openqueue_stats.minBuffSize=buffSize; + } + +} +void openqueue_reset_stats(void){ + uint8_t size = openqueue_getBusyPacketBufferSize(); + openqueue_stats.maxBuffSize=size; + openqueue_stats.minBuffSize=size; +} + void openqueue_reset_entry(OpenQueueEntry_t *entry) { //admin entry->creator = COMPONENT_NULL; diff --git a/openstack/cross-layers/openqueue.h b/openstack/cross-layers/openqueue.h index a37f8c5688..71cd9be6f4 100644 --- a/openstack/cross-layers/openqueue.h +++ b/openstack/cross-layers/openqueue.h @@ -30,6 +30,11 @@ typedef struct { OpenQueueBigEntry_t big_queue[BIGQUEUELENGTH]; } openqueue_vars_t; +typedef struct +{ + uint8_t maxBuffSize; // max packets in the buffer + uint8_t minBuffSize; // min packets in the buffer +} openqueue_stats_t; //=========================== prototypes ====================================== // admin @@ -41,6 +46,9 @@ OpenQueueEntry_t* openqueue_getFreeBigPacketBuffer(uint8_t creator); owerror_t openqueue_freePacketBuffer(OpenQueueEntry_t* pkt); void openqueue_removeAllCreatedBy(uint8_t creator); bool openqueue_isHighPriorityEntryEnough(void); +openqueue_stats_t openqueue_get_stats(void); +void openqueue_reset_stats(void); + // called by ICMPv6 void openqueue_updateNextHopPayload(open_addr_t* newNextHop); // called by res diff --git a/projects/common/01bsp_radio_jammer/01bsp_radio_jammer.c b/projects/common/01bsp_radio_jammer/01bsp_radio_jammer.c index 2418715f34..e321f088d9 100644 --- a/projects/common/01bsp_radio_jammer/01bsp_radio_jammer.c +++ b/projects/common/01bsp_radio_jammer/01bsp_radio_jammer.c @@ -15,7 +15,7 @@ The packet contains LENGTH_PACKET bytes. The send bytes are random. #include "board.h" #include "radio.h" #include "leds.h" -#include "bsp_timer.h" +//#include "bsp_timer.h" //=========================== defines ========================================= diff --git a/projects/common/01bsp_radio_tx/01bsp_radio_tx.c b/projects/common/01bsp_radio_tx/01bsp_radio_tx.c index 243032d5fb..964f162d80 100644 --- a/projects/common/01bsp_radio_tx/01bsp_radio_tx.c +++ b/projects/common/01bsp_radio_tx/01bsp_radio_tx.c @@ -133,4 +133,4 @@ void cb_endFrame(PORT_TIMER_WIDTH timestamp) { // led leds_sync_off(); -} +} \ No newline at end of file diff --git a/projects/common/03oos_macpong/03oos_macpong.c b/projects/common/03oos_macpong/03oos_macpong.c index a9da815044..ade35cedcb 100644 --- a/projects/common/03oos_macpong/03oos_macpong.c +++ b/projects/common/03oos_macpong/03oos_macpong.c @@ -200,4 +200,3 @@ void opencoap_init(void) { return; } //===== L7 void openapps_init(void) { return; } - diff --git a/projects/openmote-b-24ghz/03oos_macpong/03oos_macpong.ewp b/projects/openmote-b-24ghz/03oos_macpong/03oos_macpong.ewp index 8210554df4..00ad42c162 100644 --- a/projects/openmote-b-24ghz/03oos_macpong/03oos_macpong.ewp +++ b/projects/openmote-b-24ghz/03oos_macpong/03oos_macpong.ewp @@ -11,7 +11,7 @@ General 3 - 28 + 31 1 1 + + + ICCARM 2 - 34 + 35 1 1 + @@ -701,7 +718,7 @@ ILINK 0 - 20 + 23 1 1 + + + + + + @@ -1052,7 +1093,7 @@ General 3 - 28 + 31 1 0 + + + ICCARM 2 - 34 + 35 1 0 + @@ -1711,7 +1769,7 @@ ILINK 0 - 20 + 23 1 0 + + + + + + diff --git a/projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewp b/projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewp index 746e1669de..ee66e84e33 100644 --- a/projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewp +++ b/projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewp @@ -11,7 +11,7 @@ General 3 - 28 + 31 1 1 + + + ICCARM 2 - 34 + 35 1 1 + @@ -701,7 +718,7 @@ ILINK 0 - 20 + 23 1 1 + + + + + + @@ -1052,7 +1093,7 @@ General 3 - 28 + 31 1 0 + + + ICCARM 2 - 34 + 35 1 0 + @@ -1711,7 +1769,7 @@ ILINK 0 - 20 + 23 1 0 + + + + + + @@ -2394,6 +2476,12 @@ $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio.h + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + max44009 diff --git a/projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewt b/projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewt new file mode 100644 index 0000000000..55a4d87fa9 --- /dev/null +++ b/projects/openmote-b-subghz/03oos_macpong/03oos_macpong.ewt @@ -0,0 +1,2891 @@ + + + 3 + + Debug + + ARM + + 1 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + application + + $PROJ_DIR$\..\..\common\03oos_macpong\03oos_macpong.c + + + $PROJ_DIR$\..\..\common\03oos_macpong\03oos_macpong.h + + + + bsp + + boards + + openmote-b-subghz + + headers + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_ana_regs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_cctest.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_flash_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_i2cm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_i2cs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_ints.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_memmap.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_nvic.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_rfcore_ffsm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_rfcore_sfr.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_rfcore_xreg.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_smwdthrosc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_soc_adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_types.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_uart.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_udmachctl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\headers\hw_usb.h + + + + source + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\adc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\aes.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\bl_commands.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\ccm.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\ccm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\cpu.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\cpu.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\debug.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\debug.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\ecc_curveinfo.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\flash.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\flash.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\gpio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\gptimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\i2c_lib.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\i2c_lib.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\interrupt.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\interrupt.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\ioc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\pka.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\rom.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\sha256.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\sha256.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\sleepmode.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\sleepmode.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\ssi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\sys_ctrl.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\systick.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\systick.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\uarthal.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\uarthal.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\udma.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\watchdog.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\source\watchdog.h + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\adc_sensor.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\adc_sensor.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\board.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\board_info.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\cc2538rf.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\cryptoengine.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\debugpins.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\eui64.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\i2c.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\leds.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\sctimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\sensors.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\spi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\startup_gcc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\startup_iar.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\uart.c + + + + $PROJ_DIR$\..\..\..\bsp\boards\board.h + + + $PROJ_DIR$\..\..\..\bsp\boards\bsp_timer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\debugpins.h + + + $PROJ_DIR$\..\..\..\bsp\boards\eui64.h + + + $PROJ_DIR$\..\..\..\bsp\boards\i2c.h + + + $PROJ_DIR$\..\..\..\bsp\boards\leds.h + + + $PROJ_DIR$\..\..\..\bsp\boards\radio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\radiotimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sctimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sensors.h + + + $PROJ_DIR$\..\..\..\bsp\boards\spi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\toolchain_defs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\uart.h + + + + chips + + adxl346 + + $PROJ_DIR$\..\..\..\bsp\chips\adxl346\adxl346.c + + + $PROJ_DIR$\..\..\..\bsp\chips\adxl346\adxl346.h + + + + at86rf215 + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + + + + max44009 + + $PROJ_DIR$\..\..\..\bsp\chips\max44009\max44009.c + + + $PROJ_DIR$\..\..\..\bsp\chips\max44009\max44009.h + + + + sht21 + + $PROJ_DIR$\..\..\..\bsp\chips\sht21\sht21.c + + + $PROJ_DIR$\..\..\..\bsp\chips\sht21\sht21.h + + + + si70x + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.c + + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.h + + + + + + drivers + + common + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.c + + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.h + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.c + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.h + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.c + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.h + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.c + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.h + + + + + inc + + $PROJ_DIR$\..\..\..\inc\opendefs.h + + + + kernel + + $PROJ_DIR$\..\..\..\kernel\openos\scheduler.c + + + $PROJ_DIR$\..\..\..\kernel\scheduler.h + + + + openstack + + 02a-MAClow + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.h + + + + 02b-MAChigh + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\processIE.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.h + + + + cross-layers + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.h + + + + $PROJ_DIR$\..\..\..\openstack\openstack.c + + + $PROJ_DIR$\..\..\..\openstack\openstack.h + + + diff --git a/projects/openmote-b/01bsp_openradio_rx/01bsp_openradio_rx.c b/projects/openmote-b/01bsp_openradio_rx/01bsp_openradio_rx.c new file mode 100644 index 0000000000..807fabf49f --- /dev/null +++ b/projects/openmote-b/01bsp_openradio_rx/01bsp_openradio_rx.c @@ -0,0 +1,284 @@ +/** +\brief This program shows the use of the "radio" bsp module. + +Since the bsp modules for different platforms have the same declaration, you +can use this project with any platform. + +This application places the mote in receive mode, and prints, over the serial +port, all information about the received packet. The frame printed over the +serial port for each received packet is formatted as follows: +- [1B] the length of the packet, an unsigned integer +- [1B] the first byte of the packet, an unsigned integer +- [1B] the receive signal strength of tehe packet, an signed integer +- [1B] the link quality indicator, an unsigned integer +- [1B] whether the receive packet passed CRC (1) or not (0) +- [3B] closing flags, each of value 0xff + +You can run the 01bsp_radio_rx.py script to listen to your mote and parse those +serial frames. The application can connect directly to the mote's serial port, +or to its TCP port when running on the IoT-LAB platform. + +Example when running locally: +---------------------------- + + ___ _ _ _ ___ _ _ +| . | ___ ___ ._ _ | | | |/ __>| \ | +| | || . \/ ._>| ' || | | |\__ \| | +`___'| _/\___.|_|_||__/_/ <___/|_\_| + |_| openwsn.org + +running IoT-lAB? (Y|N): N +name of serial port (e.g. COM10): COM25 +len=127 num=176 rssi=-43 lqi=107 crc=1 +len=127 num=177 rssi=-43 lqi=107 crc=1 +len=127 num=178 rssi=-43 lqi=106 crc=1 +len=127 num=179 rssi=-43 lqi=107 crc=1 +len=127 num=180 rssi=-43 lqi=108 crc=1 +len=127 num=181 rssi=-43 lqi=107 crc=1 +len=127 num=182 rssi=-43 lqi=107 crc=1 +len=127 num=183 rssi=-43 lqi=107 crc=1 + + +Example when running on the IoT-LAB platform: +-------------------------------------------- + + ___ _ _ _ ___ _ _ +| . | ___ ___ ._ _ | | | |/ __>| \ | +| | || . \/ ._>| ' || | | |\__ \| | +`___'| _/\___.|_|_||__/_/ <___/|_\_| + |_| openwsn.org + +running IoT-lAB? (Y|N): Y +motename? (e.g. wsn430-35): wsn430-35 +len=17 num=84 rssi=-80 lqi=107 crc=1 +len=17 num=84 rssi=-81 lqi=107 crc=1 +len=17 num=84 rssi=-80 lqi=107 crc=1 +len=17 num=84 rssi=-81 lqi=105 crc=1 +len=17 num=84 rssi=-80 lqi=108 crc=1 +len=17 num=84 rssi=-81 lqi=108 crc=1 + + +\author Xavi Vilajosana xvilajosana@eecs.berkeley.edu>, June 2012. +\author Thomas Watteyne , August 2014. +*/ + +#include "stdint.h" +#include "string.h" +#include "board.h" +#include "radio.h" +#include "leds.h" +#include "debugpins.h" +#include "uart.h" +//#include "sctimer.h" + +//=========================== defines ========================================= + +#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes +#define CHANNEL 11 // 24ghz: 11 = 2.405GHz, subghz: 11 = 865.325 in FSK operating mode #1 +#define LENGTH_SERIAL_FRAME 9 // length of the serial frame + +//=========================== variables ======================================= + +typedef struct { + uint8_t num_radioTimerCompare; + uint8_t num_startFrame; + uint8_t num_endFrame; +} app_dbg_t; + +app_dbg_t app_dbg; + +typedef struct { + // rx packet + volatile uint8_t rxpk_done; + uint8_t rxpk_buf[LENGTH_PACKET]; + uint16_t rxpk_len; + uint8_t rxpk_num; + int8_t rxpk_rssi; + uint8_t rxpk_lqi; + bool rxpk_crc; + uint8_t rxpk_freq_offset; + // uart + uint8_t uart_txFrame[LENGTH_SERIAL_FRAME]; + uint8_t uart_lastTxByte; + volatile uint8_t uart_done; +} app_vars_t; + +app_vars_t app_vars; + +//=========================== prototypes ====================================== + +// radiotimer +void cb_radioTimerOverflows(void); +// radio +void cb_startFrame(PORT_TIMER_WIDTH timestamp); +void cb_endFrame(PORT_TIMER_WIDTH timestamp); +// uart +void cb_uartTxDone(void); +uint8_t cb_uartRxCb(void); + +//=========================== main ============================================ + +/** +\brief The program starts executing here. +*/ +int mote_main(void) { + + uint8_t i; + + // clear local variables + memset(&app_vars,0,sizeof(app_vars_t)); + + // initialize board + board_init(); + + + + // setup UART + uart_setCallbacks(cb_uartTxDone,cb_uartRxCb); + + // prepare radio + radio_setConfig (RADIOSETTING_OQPSK_RATE3); + radio_rfOn(); + // freq type only effects on scum port + radio_setFrequency(CHANNEL, FREQ_RX); + // add callback functions radio + radio_setStartFrameCb(cb_startFrame); + radio_setEndFrameCb(cb_endFrame); + // switch in RX + radio_rxEnable(); + radio_rxNow(); + debugpins_radio_clr(); + while (1) { + + // sleep while waiting for at least one of the rxpk_done to be set + + app_vars.rxpk_done = 0; + while (app_vars.rxpk_done==0) { + board_sleep(); + } + + // if I get here, I just received a packet + + //===== send notification over serial port + + // led + leds_error_on(); + + // format frame to send over serial port + i = 0; + app_vars.uart_txFrame[i++] = app_vars.rxpk_len; // packet length + app_vars.uart_txFrame[i++] = app_vars.rxpk_num; // packet number + app_vars.uart_txFrame[i++] = app_vars.rxpk_rssi; // RSSI + app_vars.uart_txFrame[i++] = app_vars.rxpk_lqi; // LQI + app_vars.uart_txFrame[i++] = app_vars.rxpk_crc; // CRC + app_vars.uart_txFrame[i++] = app_vars.rxpk_freq_offset; // freq_offset + app_vars.uart_txFrame[i++] = 0xff; // closing flag + app_vars.uart_txFrame[i++] = 0xff; // closing flag + app_vars.uart_txFrame[i++] = 0xff; // closing flag + + app_vars.uart_done = 0; + app_vars.uart_lastTxByte = 0; + + // send app_vars.uart_txFrame over UART + uart_clearTxInterrupts(); + uart_clearRxInterrupts(); + uart_enableInterrupts(); + uart_writeByte(app_vars.uart_txFrame[app_vars.uart_lastTxByte]); + while (app_vars.uart_done==0); // busy wait to finish + uart_disableInterrupts(); + + // led + leds_error_off(); + } +} + +//=========================== callbacks ======================================= + +//===== radio + +void cb_startFrame(PORT_TIMER_WIDTH timestamp) { + debugpins_radio_toggle(); + debugpins_fsm_set(); + leds_sync_on(); + // update debug stats + app_dbg.num_startFrame++; +} + +void cb_endFrame(PORT_TIMER_WIDTH timestamp) { + debugpins_radio_toggle(); + debugpins_fsm_clr(); + uint8_t i; + bool expectedFrame; + + // update debug stats + app_dbg.num_endFrame++; + + memset(&app_vars.rxpk_buf[0],0,LENGTH_PACKET); + + app_vars.rxpk_freq_offset = radio_getFrequencyOffset(); + + // get packet from radio + radio_getReceivedFrame( + app_vars.rxpk_buf, + &app_vars.rxpk_len, + sizeof(app_vars.rxpk_buf), + &app_vars.rxpk_rssi, + &app_vars.rxpk_lqi, + &app_vars.rxpk_crc + ); + + // check the frame is sent by radio_tx project + expectedFrame = TRUE; + + if (app_vars.rxpk_len>LENGTH_PACKET){ + expectedFrame = FALSE; + } else { + for(i=1;i<10;i++){ + if(app_vars.rxpk_buf[i]!=i){ + expectedFrame = FALSE; + break; + } + } + } + + // read the packet number + app_vars.rxpk_num = app_vars.rxpk_buf[0]; + + // toggle led if the frame is expected + if (expectedFrame){ + // indicate I just received a packet from bsp_radio_tx mote + app_vars.rxpk_done = 1; + + leds_debug_toggle(); + } + + // keep listening (needed for at86rf215 radio) + radio_rxEnable(); + radio_rxNow(); + + // led + leds_sync_off(); +} + +//===== uart + +void cb_uartTxDone(void) { + + uart_clearTxInterrupts(); + + // prepare to send the next byte + app_vars.uart_lastTxByte++; + + if (app_vars.uart_lastTxByte| \ |"] +banner += ["| | || . \/ ._>| ' || | | |\__ \| |"] +banner += ["`___'| _/\___.|_|_||__/_/ <___/|_\_|"] +banner += [" |_| openwsn.org"] +banner += [""] +banner = '\n'.join(banner) +print banner + +XOFF = 0x13 +XON = 0x11 +XONXOFF_ESCAPE = 0x12 +XONXOFF_MASK = 0x10 + +MAX_NUM_PACKET = 256 + +def mote_connect(motename=None , serialport= None, baudrate='115200'): + try: + if (motename): + mote = socket.socket(socket.AF_INET,socket.SOCK_STREAM) + mote.connect((motename,20000)) + else: + mote = serial.Serial(serialport, baudrate) + return mote + except Exception as err: + print "{0}".format(err) + raw_input('Press Enter to close.') + sys.exit(1) + + +#============================ configuration and connection =================================== + +iotlab_serialport = False +motename = 'wsn430-35' +serialport = 'COM10' +mote = None + +t = raw_input('Are you running on IoT-LAB nodes ? (Y|N): ') +if (not t.strip() or t.strip() in ['1','yes','y','Y']): + t = raw_input('Enter mote name ? (e.g. {0}): '.format(motename)) + if t.strip(): + motename = t.strip() + archi = motename.split('-') + assert len(archi) == 2 + assert archi[0] in ['wsn430', 'a8', 'm3'] + if (archi[0] != 'a8'): + iotlab_serialport = True + mote = mote_connect(motename=motename) + else: + mote = mote_connect(serialport='/dev/ttyA8_M3', baudrate='500000') + +else: + t = raw_input('Enter serial port name (e.g. {0}): '.format(serialport)) + if t.strip(): + serialport = t.strip() + mote = mote_connect(serialport=serialport) + +#============================ read ============================================ + +rawFrame = [] +rawFrame_decoded = [] +previousFrame = 0 +frameCounter = 0 +xonxoffEscaping = False + +while True: + + if iotlab_serialport: + bytes = mote.recv(1024) + rawFrame += [ord(b) for b in bytes] + else: + byte = mote.read(1) + rawFrame += [ord(byte)] + + if rawFrame[-3:]==[0xff]*3 and len(rawFrame)>=9: + + for byte in rawFrame: + if byte==XONXOFF_ESCAPE: + xonxoffEscaping = True + else: + if xonxoffEscaping==True: + rawFrame_decoded += [byte^XONXOFF_MASK] + xonxoffEscaping=False + elif byte!=XON and byte!=XOFF: + rawFrame_decoded += [byte] + + (rxpk_len,rxpk_num,rxpk_rssi,rxpk_lqi,rxpk_crc, rxpk_freq_offset) = \ + struct.unpack('>BBbBBb', ''.join([chr(b) for b in rawFrame_decoded[-9:-3]])) + + # debug info + output = 'len={0:<3} num={1:<3} rssi={2:<4} lqi={3:<3} crc={4} freq_offset={5:<4}'.format( + rxpk_len, + rxpk_num, + rxpk_rssi, + rxpk_lqi, + rxpk_crc, + rxpk_freq_offset + ) + + print output + + with open('log.txt','a') as f: + f.write(output+'\n') + + if rxpk_len>127: + print "ERROR: frame too long.\a" + else: + if previousFrame>rxpk_num: + output = "frameCounter={0:<3}, PDR={1}%".format(frameCounter, frameCounter*100/MAX_NUM_PACKET) + print output + frameCounter = 0 + with open('log.txt','a') as f: + f.write(output+'\n') + + frameCounter += 1 + previousFrame = rxpk_num + + rawFrame = [] + rawFrame_decoded = [] diff --git a/projects/openmote-b/01bsp_openradio_tx/01bsp_openradio_tx.c b/projects/openmote-b/01bsp_openradio_tx/01bsp_openradio_tx.c new file mode 100644 index 0000000000..9e68177ab5 --- /dev/null +++ b/projects/openmote-b/01bsp_openradio_tx/01bsp_openradio_tx.c @@ -0,0 +1,177 @@ +/** +\brief This program shows the use of the "open radio" bsp module. + +Since the bsp modules for different platforms have the same declaration, you +can use this project with any platform. + +The board running this program will send a packet on channel CHANNEL every +TIMER_PERIOD ticks. The packet contains LENGTH_PACKET bytes. The first byte +is the packet number, which increments for each transmitted packet. The +remainder of the packet contains an incrementing bytes. + +\author Thomas Watteyne , August 2014. +\updated Mina Rady +*/ + +#include "stdint.h" +#include "string.h" +#include "board.h" +#include "board.h" +#include "radio.h" +#include "leds.h" +#include "sctimer.h" + +//=========================== defines ========================================= + +#define LENGTH_PACKET 125+LENGTH_CRC // maximum length is 127 bytes +#define CHANNEL 11 // 24ghz: 11 = 2.405GHz, subghz: 11 = 865.325 in FSK operating mode #1 +#define TIMER_PERIOD (32768>>4) // (32768>>1) = 500ms @ 32kHz + +//=========================== variables ======================================= + +typedef struct { + uint8_t num_scTimerCompare; + uint8_t num_startFrame; + uint8_t num_endFrame; +} app_dbg_t; + +app_dbg_t app_dbg; + +typedef struct { + uint8_t txpk_txNow; + uint8_t txpk_buf[LENGTH_PACKET]; + uint8_t txpk_len; + uint8_t txpk_num; +} app_vars_t; + +app_vars_t app_vars; + +//=========================== prototypes ====================================== + +void cb_scTimerCompare(void); +void cb_startFrame(PORT_TIMER_WIDTH timestamp); +void cb_endFrame(PORT_TIMER_WIDTH timestamp); + +//=========================== main ============================================ + +/** +\brief The program starts executing here. +*/ +int mote_main(void) { + uint8_t i; + // bool to switch betweeb radios + + uint8_t radio_switch = 0; + // clear local variables + memset(&app_vars,0,sizeof(app_vars_t)); + + // initialize board + board_init(); + + // add radio callback functions + sctimer_set_callback(cb_scTimerCompare); + + radio_setConfig (RADIOSETTING_FSK_OPTION1_FEC); + radio_setStartFrameCb(cb_startFrame); + radio_setEndFrameCb(cb_endFrame); + + radio_setConfig (RADIOSETTING_24GHZ); + radio_setStartFrameCb(cb_startFrame); + radio_setEndFrameCb(cb_startFrame); + + + // start periodic overflow + sctimer_setCompare(sctimer_readCounter()+ TIMER_PERIOD); + sctimer_enable(); + while(1) { + + // wait for timer to elapse + app_vars.txpk_txNow = 0; + while (app_vars.txpk_txNow==0) { + board_sleep(); + } + + switch (radio_switch%7){ + case 0: + // freq type only effects on scum port + // looping on radio settings from slowest to fastest. + radio_setFrequency(CHANNEL, FREQ_TX); + radio_setConfig (RADIOSETTING_FSK_OPTION1_FEC); + break; + case 1: + radio_setFrequency(CHANNEL, FREQ_TX); + radio_setConfig (RADIOSETTING_OQPSK_RATE3); + break; + case 2: + radio_setFrequency(CHANNEL, FREQ_TX); + radio_setConfig (RADIOSETTING_OFDM_OPTION_1_MCS0); + break; + case 3: + radio_setFrequency(CHANNEL, FREQ_TX); + radio_setConfig (RADIOSETTING_OFDM_OPTION_1_MCS1); + break; + case 4: + radio_setFrequency(CHANNEL, FREQ_TX); + radio_setConfig (RADIOSETTING_OFDM_OPTION_1_MCS2); + break; + case 5: + radio_setFrequency(CHANNEL, FREQ_TX); + radio_setConfig (RADIOSETTING_OFDM_OPTION_1_MCS3); + break; + case 6: + radio_setFrequency(CHANNEL, FREQ_TX); + radio_setConfig (RADIOSETTING_24GHZ); + break; + } + + //Toggle the switch + radio_switch ++; + // led + leds_error_toggle(); + + // prepare packet + app_vars.txpk_num++; + app_vars.txpk_len = sizeof(app_vars.txpk_buf); + app_vars.txpk_buf[0] = app_vars.txpk_num; + for (i=1;i + + 3 + + Debug + + ARM + + 1 + + General + 3 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 35 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 10 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 23 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 35 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 10 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 23 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + bsp + + boards + + openmote-b + + headers + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ana_regs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_cctest.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_flash_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ints.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_memmap.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_nvic.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_ffsm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_sfr.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_xreg.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_smwdthrosc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_soc_adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_types.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_uart.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udmachctl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_usb.h + + + + source + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\bl_commands.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ecc_curveinfo.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\rom.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.h + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board_info.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\bsp_timer.c + + Debug + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cc2538rf.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cryptoengine.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\debugpins.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\eui64.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\i2c.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\leds.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\radiotimer.c + + Debug + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sctimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sensors.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\spi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_iar.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\uart.c + + + + $PROJ_DIR$\..\..\..\bsp\boards\board.h + + + $PROJ_DIR$\..\..\..\bsp\boards\bsp_timer.h + + Debug + + + + $PROJ_DIR$\..\..\..\bsp\boards\crypto_engine.h + + + $PROJ_DIR$\..\..\..\bsp\boards\debugpins.h + + + $PROJ_DIR$\..\..\..\bsp\boards\eui64.h + + + $PROJ_DIR$\..\..\..\bsp\boards\i2c.h + + + $PROJ_DIR$\..\..\..\bsp\boards\leds.h + + + $PROJ_DIR$\..\..\..\bsp\boards\radiotimer.h + + Debug + + + + $PROJ_DIR$\..\..\..\bsp\boards\sctimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sensors.h + + + $PROJ_DIR$\..\..\..\bsp\boards\spi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\toolchain_defs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\uart.h + + + + chips + + at86rf215 + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + + + + si70x + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.c + + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.h + + + + + + inc + + $PROJ_DIR$\..\..\..\inc\opendefs.h + + + + projects + + common + + 01bsp_radio_jammer + + $PROJ_DIR$\..\..\common\01bsp_radio_jammer\01bsp_radio_jammer.c + + + + + diff --git a/projects/openmote-b/01bsp_radio_jammer/01bsp_radio_jammer.ewt b/projects/openmote-b/01bsp_radio_jammer/01bsp_radio_jammer.ewt new file mode 100644 index 0000000000..b0d27d68cd --- /dev/null +++ b/projects/openmote-b/01bsp_radio_jammer/01bsp_radio_jammer.ewt @@ -0,0 +1,2732 @@ + + + 3 + + Debug + + ARM + + 1 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + bsp + + boards + + openmote-b + + headers + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ana_regs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_cctest.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_flash_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ints.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_memmap.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_nvic.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_ffsm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_sfr.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_xreg.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_smwdthrosc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_soc_adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_types.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_uart.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udmachctl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_usb.h + + + + source + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\bl_commands.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ecc_curveinfo.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\rom.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.h + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board_info.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\bsp_timer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cc2538rf.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cryptoengine.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\debugpins.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\eui64.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\i2c.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\leds.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\radiotimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sctimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sensors.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b-subghz\spi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_iar.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\uart.c + + + + $PROJ_DIR$\..\..\..\bsp\boards\board.h + + + $PROJ_DIR$\..\..\..\bsp\boards\bsp_timer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\crypto_engine.h + + + $PROJ_DIR$\..\..\..\bsp\boards\debugpins.h + + + $PROJ_DIR$\..\..\..\bsp\boards\eui64.h + + + $PROJ_DIR$\..\..\..\bsp\boards\i2c.h + + + $PROJ_DIR$\..\..\..\bsp\boards\leds.h + + + $PROJ_DIR$\..\..\..\bsp\boards\radiotimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sctimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sensors.h + + + $PROJ_DIR$\..\..\..\bsp\boards\spi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\toolchain_defs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\uart.h + + + + chips + + at86rf215 + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + + + + si70x + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.c + + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.h + + + + + + inc + + $PROJ_DIR$\..\..\..\inc\opendefs.h + + + + projects + + common + + 01bsp_radio_jammer + + $PROJ_DIR$\..\..\common\01bsp_radio_jammer\01bsp_radio_jammer.c + + + + + diff --git a/projects/openmote-b/01bsp_radio_tx/01bsp_radio_tx.ewp b/projects/openmote-b/01bsp_radio_tx/01bsp_radio_tx.ewp new file mode 100644 index 0000000000..e81c8c2a46 --- /dev/null +++ b/projects/openmote-b/01bsp_radio_tx/01bsp_radio_tx.ewp @@ -0,0 +1,2637 @@ + + + 3 + + Debug + + ARM + + 1 + + General + 3 + + 31 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 35 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 10 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 1 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 23 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 1 + + + + + + + BILINK + 0 + + + + + Release + + ARM + + 0 + + General + 3 + + 31 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ICCARM + 2 + + 35 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AARM + 2 + + 10 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OBJCOPY + 0 + + 1 + 1 + 0 + + + + + + + + + CUSTOM + 3 + + + + 0 + + + + BICOMP + 0 + + + + BUILDACTION + 1 + + + + + + + ILINK + 0 + + 23 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IARCHIVE + 0 + + 0 + 1 + 0 + + + + + + + BILINK + 0 + + + + + application + + $PROJ_DIR$\..\..\common\01bsp_radio_tx\01bsp_radio_tx.c + + + + bsp + + boards + + openmote-b + + headers + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ana_regs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_cctest.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_flash_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ints.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_memmap.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_nvic.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_ffsm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_sfr.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_xreg.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_smwdthrosc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_soc_adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_types.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_uart.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udmachctl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_usb.h + + + + source + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\bl_commands.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ecc_curveinfo.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\rom.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.h + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board_info.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cc2538rf.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cryptoengine.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\debugpins.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\eui64.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\i2c.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\leds.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\radio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sctimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sensors.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\spi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_iar.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\uart.c + + + + $PROJ_DIR$\..\..\..\bsp\boards\board.h + + + $PROJ_DIR$\..\..\..\bsp\boards\cryptoengine.h + + + $PROJ_DIR$\..\..\..\bsp\boards\debugpins.h + + + $PROJ_DIR$\..\..\..\bsp\boards\eui64.h + + + $PROJ_DIR$\..\..\..\bsp\boards\i2c.h + + + $PROJ_DIR$\..\..\..\bsp\boards\leds.h + + + $PROJ_DIR$\..\..\..\bsp\boards\radio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sctimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sensors.h + + + $PROJ_DIR$\..\..\..\bsp\boards\spi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\toolchain_defs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\uart.h + + + + chips + + at86rf215 + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + + + + cc2538rf + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.c + + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.h + + + + s70x + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.c + + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.h + + + + sht21 + + $PROJ_DIR$\..\..\..\bsp\chips\sht21\sht21.c + + + $PROJ_DIR$\..\..\..\bsp\chips\sht21\sht21.h + + + + + + drivers + + common + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.c + + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.h + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.c + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.h + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.c + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.h + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.c + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.h + + + + + inc + + $PROJ_DIR$\..\..\..\inc\opendefs.h + + + + kernel + + $PROJ_DIR$\..\..\..\kernel\openos\scheduler.c + + + $PROJ_DIR$\..\..\..\kernel\scheduler.h + + + + openstack + + 02a-MAClow + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.h + + + + 02b-MAChigh + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\processIE.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.h + + + + cross-layers + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.h + + + + $PROJ_DIR$\..\..\..\openstack\openstack.c + + + $PROJ_DIR$\..\..\..\openstack\openstack.h + + + diff --git a/projects/openmote-b/03oos_macpong/03oos_macpong.ewp b/projects/openmote-b/03oos_macpong/03oos_macpong.ewp index 5fcd035c22..95c5452fdb 100644 --- a/projects/openmote-b/03oos_macpong/03oos_macpong.ewp +++ b/projects/openmote-b/03oos_macpong/03oos_macpong.ewp @@ -11,7 +11,7 @@ General 3 - 28 + 31 1 1 + + + ICCARM 2 - 34 + 35 1 1 + @@ -612,7 +632,7 @@ @@ -1051,7 +1095,7 @@ General 3 - 28 + 31 1 0 + + + ICCARM 2 - 34 + 35 1 0 + @@ -1710,7 +1771,7 @@ ILINK 0 - 20 + 23 1 0 + + + + + + @@ -2316,10 +2401,7 @@ $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sensors.c - $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_gcc.c - - Debug - + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\spi.c $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_iar.c @@ -2332,7 +2414,7 @@ $PROJ_DIR$\..\..\..\bsp\boards\board.h - $PROJ_DIR$\..\..\..\bsp\boards\bsp_timer.h + $PROJ_DIR$\..\..\..\bsp\boards\cryptoengine.h $PROJ_DIR$\..\..\..\bsp\boards\debugpins.h @@ -2349,9 +2431,6 @@ $PROJ_DIR$\..\..\..\bsp\boards\radio.h - - $PROJ_DIR$\..\..\..\bsp\boards\radiotimer.h - $PROJ_DIR$\..\..\..\bsp\boards\sctimer.h @@ -2371,21 +2450,36 @@ chips - adxl346 + at86rf215 - $PROJ_DIR$\..\..\..\bsp\chips\adxl346\adxl346.c + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c - $PROJ_DIR$\..\..\..\bsp\chips\adxl346\adxl346.h + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h - max44009 + cc2538rf - $PROJ_DIR$\..\..\..\bsp\chips\max44009\max44009.c + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.c - $PROJ_DIR$\..\..\..\bsp\chips\max44009\max44009.h + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.h + + + + s70x + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.c + + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.h @@ -2481,6 +2575,12 @@ 02b-MAChigh + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.h + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.c @@ -2496,12 +2596,6 @@ $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.h - - $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.c - - - $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.h - $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.c diff --git a/projects/openmote-b/03oos_macpong/03oos_macpong.ewt b/projects/openmote-b/03oos_macpong/03oos_macpong.ewt new file mode 100644 index 0000000000..ba57a28b68 --- /dev/null +++ b/projects/openmote-b/03oos_macpong/03oos_macpong.ewt @@ -0,0 +1,2873 @@ + + + 3 + + Debug + + ARM + + 1 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + application + + $PROJ_DIR$\..\..\common\03oos_macpong\03oos_macpong.c + + + $PROJ_DIR$\..\..\common\03oos_macpong\03oos_macpong.h + + + + bsp + + boards + + openmote-b + + headers + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ana_regs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_cctest.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_flash_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ints.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_memmap.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_nvic.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_ffsm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_sfr.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_xreg.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_smwdthrosc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_soc_adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_types.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_uart.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udmachctl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_usb.h + + + + source + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\bl_commands.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ecc_curveinfo.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\rom.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.h + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board_info.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cc2538rf.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cryptoengine.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\debugpins.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\eui64.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\i2c.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\leds.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\radio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sctimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sensors.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\spi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_iar.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\uart.c + + + + $PROJ_DIR$\..\..\..\bsp\boards\board.h + + + $PROJ_DIR$\..\..\..\bsp\boards\cryptoengine.h + + + $PROJ_DIR$\..\..\..\bsp\boards\debugpins.h + + + $PROJ_DIR$\..\..\..\bsp\boards\eui64.h + + + $PROJ_DIR$\..\..\..\bsp\boards\i2c.h + + + $PROJ_DIR$\..\..\..\bsp\boards\leds.h + + + $PROJ_DIR$\..\..\..\bsp\boards\radio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sctimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sensors.h + + + $PROJ_DIR$\..\..\..\bsp\boards\spi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\toolchain_defs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\uart.h + + + + chips + + at86rf215 + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + + + + cc2538rf + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.c + + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.h + + + + s70x + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.c + + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.h + + + + sht21 + + $PROJ_DIR$\..\..\..\bsp\chips\sht21\sht21.c + + + $PROJ_DIR$\..\..\..\bsp\chips\sht21\sht21.h + + + + + + drivers + + common + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.c + + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.h + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.c + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.h + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.c + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.h + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.c + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.h + + + + + inc + + $PROJ_DIR$\..\..\..\inc\opendefs.h + + + + kernel + + $PROJ_DIR$\..\..\..\kernel\openos\scheduler.c + + + $PROJ_DIR$\..\..\..\kernel\scheduler.h + + + + openstack + + 02a-MAClow + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.h + + + + 02b-MAChigh + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\processIE.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.h + + + + cross-layers + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.h + + + + $PROJ_DIR$\..\..\..\openstack\openstack.c + + + $PROJ_DIR$\..\..\..\openstack\openstack.h + + + diff --git a/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp b/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp index fe6a0586a6..17f51a93c7 100644 --- a/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp +++ b/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp @@ -11,7 +11,7 @@ General 3 - 28 + 31 1 1 + + + ICCARM 2 - 34 + 35 1 1 + @@ -705,7 +724,7 @@ ILINK 0 - 20 + 23 1 1 + + + + + + @@ -1056,7 +1099,7 @@ General 3 - 28 + 31 1 0 + + + ICCARM 2 - 34 + 35 1 0 + @@ -1715,7 +1775,7 @@ ILINK 0 - 20 + 23 1 0 + + + + + + @@ -2320,6 +2404,9 @@ $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sensors.c + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\spi.c + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_iar.c @@ -2363,6 +2450,30 @@ chips + + at86rf215 + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + + + + cc2538rf + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.c + + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.h + + si70x @@ -2672,6 +2783,12 @@ 03a-IPHC + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\frag.c + + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\frag.h + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\iphc.c diff --git a/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewt b/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewt new file mode 100644 index 0000000000..87c234dc2b --- /dev/null +++ b/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewt @@ -0,0 +1,3098 @@ + + + 3 + + Debug + + ARM + + 1 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + Release + + ARM + + 0 + + C-STAT + 261 + + 261 + + 0 + + 1 + 600 + 1 + 2 + 0 + 1 + 100 + + + 1.5.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RuntimeChecking + 0 + + 2 + 1 + 0 + + + + + + + + + + + + + + + + + + + + + + application + + $PROJ_DIR$\..\..\common\03oos_openwsn\03oos_openwsn.c + + + $PROJ_DIR$\..\..\common\03oos_openwsn\03oos_openwsn.h + + + + bsp + + boards + + openmote-b + + headers + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ana_regs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_cctest.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_flash_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_i2cs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ints.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_memmap.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_nvic.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_ffsm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_sfr.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_rfcore_xreg.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_smwdthrosc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_soc_adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_types.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_uart.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_udmachctl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\headers\hw_usb.h + + + + source + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\adc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\aes.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\bl_commands.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ccm.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\cpu.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\debug.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ecc_curveinfo.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\flash.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gpio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\gptimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\i2c_lib.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\interrupt.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ioc.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\pka.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\rom.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sha256.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sleepmode.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\ssi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\sys_ctrl.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\systick.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\uarthal.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\udma.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\source\watchdog.h + + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\adc_sensor.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\board_info.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cc2538rf.h + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\cryptoengine.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\debugpins.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\eui64.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\i2c.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\leds.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\radio.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sctimer.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\sensors.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\spi.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\startup_iar.c + + + $PROJ_DIR$\..\..\..\bsp\boards\openmote-b\uart.c + + + + $PROJ_DIR$\..\..\..\bsp\boards\board.h + + + $PROJ_DIR$\..\..\..\bsp\boards\cryptoengine.h + + + $PROJ_DIR$\..\..\..\bsp\boards\debugpins.h + + + $PROJ_DIR$\..\..\..\bsp\boards\eui64.h + + + $PROJ_DIR$\..\..\..\bsp\boards\i2c.h + + + $PROJ_DIR$\..\..\..\bsp\boards\leds.h + + + $PROJ_DIR$\..\..\..\bsp\boards\radio.h + + + $PROJ_DIR$\..\..\..\bsp\boards\sctimer.h + + + $PROJ_DIR$\..\..\..\bsp\boards\spi.h + + + $PROJ_DIR$\..\..\..\bsp\boards\toolchain_defs.h + + + $PROJ_DIR$\..\..\..\bsp\boards\uart.h + + + + chips + + at86rf215 + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\at86rf215.h + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.c + + + $PROJ_DIR$\..\..\..\bsp\chips\at86rf215\radio_at86rf215.h + + + + cc2538rf + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.c + + + $PROJ_DIR$\..\..\..\bsp\chips\cc2538rf\radio_cc2538rf.h + + + + si70x + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.c + + + $PROJ_DIR$\..\..\..\bsp\chips\si70x\si70x.h + + + + + + drivers + + common + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.c + + + $PROJ_DIR$\..\..\..\drivers\common\openhdlc.h + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.c + + + $PROJ_DIR$\..\..\..\drivers\common\opensensors.h + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.c + + + $PROJ_DIR$\..\..\..\drivers\common\openserial.h + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.c + + + $PROJ_DIR$\..\..\..\drivers\common\opentimers.h + + + + + inc + + $PROJ_DIR$\..\..\..\inc\opendefs.h + + + + kernel + + $PROJ_DIR$\..\..\..\kernel\openos\scheduler.c + + + $PROJ_DIR$\..\..\..\kernel\scheduler.h + + + + openapps + + c6t + + $PROJ_DIR$\..\..\..\openapps\c6t\c6t.c + + + $PROJ_DIR$\..\..\..\openapps\c6t\c6t.h + + + + cexample + + $PROJ_DIR$\..\..\..\openapps\cexample\cexample.c + + + $PROJ_DIR$\..\..\..\openapps\cexample\cexample.h + + + + cinfo + + $PROJ_DIR$\..\..\..\openapps\cinfo\cinfo.c + + + $PROJ_DIR$\..\..\..\openapps\cinfo\cinfo.h + + + + cjoin + + $PROJ_DIR$\..\..\..\openapps\cjoin\cjoin.c + + + $PROJ_DIR$\..\..\..\openapps\cjoin\cjoin.h + + + $PROJ_DIR$\..\..\..\openapps\cjoin\cojp_cbor.c + + + $PROJ_DIR$\..\..\..\openapps\cjoin\cojp_cbor.h + + + + cleds + + $PROJ_DIR$\..\..\..\openapps\cleds\cleds.c + + + $PROJ_DIR$\..\..\..\openapps\cleds\cleds.h + + + + csensors + + $PROJ_DIR$\..\..\..\openapps\csensors\csensors.c + + + $PROJ_DIR$\..\..\..\openapps\csensors\csensors.h + + + + cstorm + + $PROJ_DIR$\..\..\..\openapps\cstorm\cstorm.c + + + $PROJ_DIR$\..\..\..\openapps\cstorm\cstorm.h + + + + cwellknow + + $PROJ_DIR$\..\..\..\openapps\cwellknown\cwellknown.c + + + $PROJ_DIR$\..\..\..\openapps\cwellknown\cwellknown.h + + + + opencoap + + $PROJ_DIR$\..\..\..\openapps\opencoap\cborencoder.c + + + $PROJ_DIR$\..\..\..\openapps\opencoap\cborencoder.h + + + $PROJ_DIR$\..\..\..\openapps\opencoap\hkdf.c + + + $PROJ_DIR$\..\..\..\openapps\opencoap\hmac.c + + + $PROJ_DIR$\..\..\..\openapps\opencoap\opencoap.c + + + $PROJ_DIR$\..\..\..\openapps\opencoap\opencoap.h + + + $PROJ_DIR$\..\..\..\openapps\opencoap\openoscoap.c + + + $PROJ_DIR$\..\..\..\openapps\opencoap\openoscoap.h + + + $PROJ_DIR$\..\..\..\openapps\opencoap\sha-private.h + + + $PROJ_DIR$\..\..\..\openapps\opencoap\sha.h + + + $PROJ_DIR$\..\..\..\openapps\opencoap\sha224-256.c + + + $PROJ_DIR$\..\..\..\openapps\opencoap\usha.c + + + + rrt + + $PROJ_DIR$\..\..\..\openapps\rrt\rrt.c + + + $PROJ_DIR$\..\..\..\openapps\rrt\rrt.h + + + + uecho + + $PROJ_DIR$\..\..\..\openapps\uecho\uecho.c + + + $PROJ_DIR$\..\..\..\openapps\uecho\uecho.h + + + + uexpiration + + $PROJ_DIR$\..\..\..\openapps\uexpiration\uexpiration.c + + + $PROJ_DIR$\..\..\..\openapps\uexpiration\uexpiration.h + + + + uexpiration_monitor + + $PROJ_DIR$\..\..\..\openapps\uexpiration_monitor\uexpiration_monitor.c + + + $PROJ_DIR$\..\..\..\openapps\uexpiration_monitor\uexpiration_monitor.h + + + + uinject + + $PROJ_DIR$\..\..\..\openapps\uinject\uinject.c + + + $PROJ_DIR$\..\..\..\openapps\uinject\uinject.h + + + + userialbridge + + $PROJ_DIR$\..\..\..\openapps\userialbridge\userialbridge.c + + + $PROJ_DIR$\..\..\..\openapps\userialbridge\userialbridge.h + + + + $PROJ_DIR$\..\..\..\openapps\openapps.c + + + $PROJ_DIR$\..\..\..\openapps\openapps.h + + + + openstack + + 02a-MAClow + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\adaptive_sync.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154_security.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\ieee802154_security_driver.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\IEEE802154E.h + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.c + + + $PROJ_DIR$\..\..\..\openstack\02a-MAClow\topology.h + + + + 02b-MAChigh + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\msf.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\neighbors.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\schedule.h + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.c + + + $PROJ_DIR$\..\..\..\openstack\02b-MAChigh\sixtop.h + + + + 03a-IPHC + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\frag.c + + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\frag.h + + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\iphc.c + + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\iphc.h + + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\openbridge.c + + + $PROJ_DIR$\..\..\..\openstack\03a-IPHC\openbridge.h + + + + 03b-IPv6 + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\forwarding.c + + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\forwarding.h + + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\icmpv6.c + + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\icmpv6.h + + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\icmpv6echo.c + + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\icmpv6echo.h + + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\icmpv6rpl.c + + + $PROJ_DIR$\..\..\..\openstack\03b-IPv6\icmpv6rpl.h + + + + 04-TRAN + + $PROJ_DIR$\..\..\..\openstack\04-TRAN\openudp.c + + + $PROJ_DIR$\..\..\..\openstack\04-TRAN\openudp.h + + + + cross-layers + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\idmanager.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openqueue.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\openrandom.h + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.c + + + $PROJ_DIR$\..\..\..\openstack\cross-layers\packetfunctions.h + + + + $PROJ_DIR$\..\..\..\openstack\openstack.c + + + $PROJ_DIR$\..\..\..\openstack\openstack.h + + + diff --git a/projects/openmote-b/openmote_b.eww b/projects/openmote-b/openmote_b.eww index 62dc3f76a7..3ddf5a6714 100644 --- a/projects/openmote-b/openmote_b.eww +++ b/projects/openmote-b/openmote_b.eww @@ -1,46 +1,50 @@ - - + - - $WS_DIR$\01bsp_sctimer\01bsp_sctimer.ewp - - - $WS_DIR$\02drv_opentimers\02drv_opentimers.ewp - - - $WS_DIR$\03oos_macpong\03oos_macpong.ewp - - - $WS_DIR$\03oos_openwsn\03oos_openwsn.ewp - - - $WS_DIR$\03oos_sniffer\03oos_sniffer.ewp - - - - all_debug - - 01bsp_sctimer - Debug - - - 02drv_opentimers - Debug - - - 03oos_macpong - Debug - - - 03oos_openwsn - Debug - - - 03oos_sniffer - Debug - - - + + $WS_DIR$\01bsp_radio_jammer\01bsp_radio_jammer.ewp + + + $WS_DIR$\01bsp_sctimer\01bsp_sctimer.ewp + + + $WS_DIR$\02drv_opentimers\02drv_opentimers.ewp + + + $WS_DIR$\03oos_macpong\03oos_macpong.ewp + + + $WS_DIR$\03oos_openwsn\03oos_openwsn.ewp + + + $WS_DIR$\03oos_sniffer\03oos_sniffer.ewp + + + + all_debug + + 01bsp_radio_jammer + Debug + + + 01bsp_sctimer + Debug + + + 02drv_opentimers + Debug + + + 03oos_macpong + Debug + + + 03oos_openwsn + Debug + + + 03oos_sniffer + Debug + + + - -