49 #include PLATFORM_HEADER
60 #include "dev/watchdog.h"
62 #include "dev/button-sensor.h"
63 #include "dev/temperature-sensor.h"
64 #include "dev/acc-sensor.h"
66 #include "dev/uart1.h"
82 #define PRINTF(...) printf(__VA_ARGS__)
83 #define PRINT6ADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
84 #define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",lladdr.u8[0], lladdr.u8[1], lladdr.u8[2], lladdr.u8[3],lladdr.u8[4], lladdr.u8[5], lladdr.u8[6], lladdr.u8[7])
87 #define PRINT6ADDR(addr)
88 #define PRINTLLADDR(addr)
93 PROCINIT(&tcpip_process, &sensors_process);
95 PROCINIT(&sensors_process);
96 #warning "No TCP/IP process!"
103 #define DEFAULT_RADIO_CCA_THRESHOLD -77
119 for(c = 0; c < 8; c++) {
120 eui64.u8[c] = stm32w_eui64[7 - c];
134 printf(
"Rime started with address ");
135 for(i = 0; i <
sizeof(linkaddr_t) - 1; i++) {
158 PRINTF(
"\r\nStarting ");
159 PRINTF(CONTIKI_VERSION_STRING);
160 PRINTF(
" on %s\r\n", boardDescription->name);
161 boardPrintStringDescription();
171 #if WITH_SERIAL_LINE_INPUT
186 printf(
"%s %s, channel check rate %lu Hz\n",
187 NETSTACK_MAC.name, NETSTACK_RDC.name,
188 CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
189 NETSTACK_RDC.channel_check_interval()));
190 printf(
"802.15.4 PAN ID 0x%x, EUI-%d:",
193 printf(
", radio channel %u\n", RF_CHANNEL);
198 ENERGEST_ON(ENERGEST_TYPE_CPU);
207 ST_RadioSetEdCcaThreshold(DEFAULT_RADIO_CCA_THRESHOLD);
209 autostart_start(autostart_processes);
211 printf(
"Tentative link-local IPv6 address ");
215 lladdr = uip_ds6_get_link_local(-1);
216 for(i = 0; i < 7; ++i) {
217 printf(
"%02x%02x:", lladdr->ipaddr.u8[i * 2],
218 lladdr->ipaddr.u8[i * 2 + 1]);
220 printf(
"%02x%02x\n", lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
224 if(!UIP_CONF_IPV6_RPL) {
230 printf(
"Tentative global IPv6 address ");
231 for(i = 0; i < 7; ++i) {
233 ipaddr.u8[i * 2], ipaddr.u8[i * 2 + 1]);
236 ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
254 ENERGEST_OFF(ENERGEST_TYPE_CPU);
256 ENERGEST_ON(ENERGEST_TYPE_LPM);
261 ENERGEST_OFF(ENERGEST_TYPE_LPM);
262 ENERGEST_ON(ENERGEST_TYPE_CPU);
void uart1_init(unsigned long ubr)
Initalize the RS232 port.
int serial_line_input_byte(unsigned char c)
Get one byte of input from the serial driver.
#define IEEE802154_CONF_PANID
Default PAN ID: TI.
linkaddr_t linkaddr_node_addr
The Rime address of the node.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
void halSleepWithOptions(SleepModes sleepMode, uint32_t gpioWakeBitMask)
Puts the microcontroller to sleep in a specified mode, allows the GPIO wake sources to be determined ...
Contact magnetic sensor header file.
struct sensors_sensor temperature_sensor
NOTE: For the temperature measurement, the ADC extended range mode is needed; but this is inaccurate ...
Unicast address structure.
u8 * ST_RadioGetEui64(void)
This function get the EUI 64 of the node.
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
Header file for the uIP TCP/IP stack.
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
void rtimer_init(void)
Initialize the real-time scheduler.
Network interface and stateless autoconfiguration (RFC 4862)
STM32W radio driver header file
#define NULL
The null pointer.
void clock_init(void)
Initialize the clock library.
int main(void)
This is main...
void process_init(void)
Initialize the process module.
Header file for the Rime stack
Generic serial I/O process header filer.
void watchdog_periodic(void)
Writes the WDT clear sequence.
Header for A/D converter.
void ctimer_init(void)
Initialize the callback timer library.
Generic set of HAL includes for all platforms.
Return codes for API functions and module definitions.
void process_start(struct process *p, process_data_t data)
Start a process.
#define ADDR_TENTATIVE
Possible states for the an address (RFC 4862)
#define INTERRUPTS_ON()
Enable global interrupts without regard to the current or previous state.
int process_run(void)
Run the system once - call poll handlers and process one event.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
void halInit(void)
Initializes microcontroller-specific peripherals.
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
Construct an IPv6 address from eight 16-bit words.
Include file for the Contiki low-layer network stack (NETSTACK)
#define CLOCK_SECOND
A second, measured in system clock time.
Header file for the Rime address representation