42 #include "stm32cube_hal_init.h"
44 #include "contiki-net.h"
49 #include "dev/watchdog.h"
51 #include "lib/random.h"
56 #include "stm32l1xx.h"
57 #include "SPIRIT_Config.h"
58 #include "SPIRIT_Management.h"
60 #include "spirit1-arch.h"
62 #include "hw-config.h"
64 #include "dev/button-sensor.h"
65 #include "dev/radio-sensor.h"
67 #if NETSTACK_CONF_WITH_IPV6
71 #ifdef X_NUCLEO_IKS01A1
72 extern const struct sensors_sensor temperature_sensor;
73 extern const struct sensors_sensor humidity_sensor;
74 extern const struct sensors_sensor pressure_sensor;
75 extern const struct sensors_sensor magneto_sensor;
76 extern const struct sensors_sensor acceleration_sensor;
77 extern const struct sensors_sensor gyroscope_sensor;
91 extern unsigned char node_mac[8];
96 #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
98 #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE * f)
101 #if NETSTACK_CONF_WITH_IPV6
102 PROCINIT(&etimer_process, &tcpip_process);
104 PROCINIT(&etimer_process);
105 #warning "No TCP/IP process!"
108 #define BUSYWAIT_UNTIL(cond, max_time) \
112 while(!(cond) && RTIMER_CLOCK_LT(RTIMER_NOW(), t0 + (max_time))) ; \
115 static void set_rime_addr(
void);
116 void stm32cube_hal_init();
124 leds_toggle(LEDS_ALL);
125 for(k = 0; k < 0xffff / 8; k += 1) {
132 main(
int argc,
char *argv[])
134 stm32cube_hal_init();
154 spirit_radio_driver.
on();
158 #if NETSTACK_CONF_WITH_IPV6
172 autostart_start(autostart_processes);
189 memset(&addr, 0,
sizeof(linkaddr_t));
190 memcpy(addr.u8, node_mac,
sizeof(addr.u8));
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
SENSORS & button_sensor
Copyright (c) 2014, Analog Devices, Inc.
static uip_ds6_addr_t * addr
Pointer to a router list entry.
Header file for IPv6-related data structures.
void random_init(unsigned short seed)
Seed the cc2538 random number generator.
void clock_init(void)
Initialize the clock library.
int process_run(void)
Run the system once - call poll handlers and process one event.
Header file for the Rime stack
#define NULL
The null pointer.
802.15.4 frame creation and parsing functions
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
int(* on)(void)
Turn the radio on.
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
Construct an IPv6 address from eight 16-bit words.
Header file for the uIP TCP/IP stack.
void process_start(struct process *p, process_data_t data)
Start a process.
uip_ds6_addr_t * uip_ds6_addr_add(uip_ipaddr_t *ipaddr, unsigned long vlifetime, uint8_t type)
Add a unicast address to the interface.
Header file for module for automatically starting and exiting a list of processes.
void rtimer_init(void)
Initialize the real-time scheduler.
void watchdog_init(void)
Copyright (c) 2014, Analog Devices, Inc.
Generic serial I/O process header filer.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
void process_init(void)
Initialize the process module.
void ctimer_init(void)
Initialize the callback timer library.
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
Include file for the Contiki low-layer network stack (NETSTACK)
void uip_ds6_set_addr_iid(uip_ipaddr_t *ipaddr, uip_lladdr_t *lladdr)
set the last 64 bits of an IP address based on the MAC address