36 #include "dev/ds2411/ds2411.h" 40 #include "dev/uart1.h" 41 #include "dev/watchdog.h" 43 #include "lib/random.h" 48 #if NETSTACK_CONF_WITH_IPV6 56 #if DCOSYNCH_CONF_ENABLED 57 static struct timer mgt_timer;
59 extern int msp430_dco_required;
61 #define UIP_OVER_MESH_CHANNEL 8 63 #ifdef EXPERIMENT_SETUP 64 #include "experiment-setup.h" 67 void init_platform(
void);
71 #define LOG_MODULE "Sky" 72 #define LOG_LEVEL LOG_LEVEL_MAIN 76 force_float_inclusion()
79 extern int __floatsisf;
83 return __fixsfsi + __floatsisf + __mulsf3 + __subsf3;
92 force_inclusion(
int d1,
int d2)
94 snprintf(NULL, 0,
"%d", d1 % d2);
103 memset(&addr, 0,
sizeof(linkaddr_t));
104 #if NETSTACK_CONF_WITH_IPV6 105 memcpy(addr.u8, ds2411_id,
sizeof(addr.u8));
108 for(i = 0; i <
sizeof(linkaddr_t); ++i) {
109 addr.u8[i] = ds2411_id[7 - i];
138 ds2411_id[2] &= 0xfe;
172 memset(longaddr, 0,
sizeof(longaddr));
175 cc2420_set_pan_addr(IEEE802154_PANID, shortaddr, longaddr);
177 LOG_INFO(
"CC2420 CCA threshold %i\n", CC2420_CONF_CCA_THRESH);
179 #if !NETSTACK_CONF_WITH_IPV6 186 #if TIMESYNCH_CONF_ENABLED 194 #if DCOSYNCH_CONF_ENABLED 210 #if DCOSYNCH_CONF_ENABLED 216 #if CC2420_CONF_SFD_TIMESTAMPS 217 cc2420_arch_sfd_init();
223 ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
226 if (msp430_dco_required) {
227 _BIS_SR(GIE | CPUOFF);
229 _BIS_SR(GIE | SCG0 | SCG1 | CPUOFF);
237 ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
CC2420 driver header file
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
Header file for the energy estimation mechanism
void platform_init_stage_two()
Stage 2 of platform driver initialisation.
void platform_idle()
The platform's idle/sleep function.
void leds_init(void)
Initialise the LED HAL.
void timer_reset(struct timer *t)
Reset the timer with the same interval.
Header for the Coffee file system.
Node-id (simple 16-bit identifiers) handling.
void uart1_init(unsigned long ubr)
Initalize the RS232 port.
void leds_on(unsigned char leds)
Turn on multiple LEDs.
void leds_off(unsigned char leds)
Turn off multiple LEDs.
Header file for IPv6-related data structures.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
int serial_line_input_byte(unsigned char c)
Get one byte of input from the serial driver.
#define CLOCK_SECOND
A second, measured in system clock time.
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
int timer_expired(struct timer *t)
Check if a timer has expired.
Main API declarations for TSCH.
802.15.4 frame creation and parsing functions
void linkaddr_copy(linkaddr_t *dest, const linkaddr_t *src)
Copy a link-layer address.
void platform_init_stage_three()
Final stage of platform driver initialisation.
int process_nevents(void)
Number of events waiting to be processed.
void random_init(unsigned short seed)
Seed the cc2538 random number generator.
Generic serial I/O process header filer.
Include file for the Contiki low-layer network stack (NETSTACK)
void watchdog_periodic(void)
Writes the WDT clear sequence.
Header file for the logging system
Header file for the LED HAL.
void platform_init_stage_one(void)
Basic (Stage 1) platform driver initialisation.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
void watchdog_stop(void)
Stops the WDT such that it won't timeout and cause MCU reset.