38 #include "nordic_common.h"
39 #include "nrf_drv_config.h"
40 #include "nrf_drv_gpiote.h"
41 #ifdef SOFTDEVICE_PRESENT
42 #include "softdevice_handler.h"
48 #include "contiki-net.h"
50 #include "lib/sensors.h"
52 #include "dev/watchdog.h"
54 #include "dev/uart0.h"
59 #if NETSTACK_CONF_WITH_IPV6
65 #define PRINTF(...) printf(__VA_ARGS__)
71 #if defined(SOFTDEVICE_PRESENT) && PLATFORM_INDICATE_BLE_STATE
72 PROCESS(ble_iface_observer,
"BLE interface observer");
80 static struct etimer led_timer;
95 }
else if(ev == PROCESS_EVENT_TIMER &&
etimer_expired(&led_timer)) {
112 #ifdef SOFTDEVICE_PRESENT
114 SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM,
NULL);
116 #ifdef PLATFORM_HAS_BUTTON
117 if (!nrf_drv_gpiote_is_init()) {
118 nrf_drv_gpiote_init();
144 #if SLIP_ARCH_CONF_ENABLE
152 PRINTF(
"Starting " CONTIKI_VERSION_STRING
"\n");
159 ENERGEST_ON(ENERGEST_TYPE_CPU);
162 #ifdef SOFTDEVICE_PRESENT
166 #if NETSTACK_CONF_WITH_IPV6
180 autostart_start(autostart_processes);
184 #ifdef SOFTDEVICE_PRESENT
void uart0_init(unsigned long ubr)
Initalize the RS232 port.
process_event_t ble_event_interface_added
This event is broadcast when BLE connection is established.
A MAC protocol implementation that uses nRF52 IPSP implementation as a link layer.
Header file for IPv6-related data structures.
void lpm_drop()
Drop the cortex to sleep / deep sleep and shut down peripherals.
void etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
#define PROCESS_END()
Define the end of a process.
#define PROCESS(name, strname)
Declare a process.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
void random_init(unsigned short seed)
Seed the cc2538 random number generator.
#define DEVICE_NAME
Device name used in BLE undirected advertisement.
void clock_init(void)
Initialize the clock library.
void etimer_stop(struct etimer *et)
Stop a pending event timer.
void ble_advertising_init(const char *name)
Initialize BLE advertising data.
int process_run(void)
Run the system once - call poll handlers and process one event.
void slip_arch_init(unsigned long ubr)
Initalize the RS232 port and the SLIP driver.
void ble_get_mac(uint8_t addr[8])
Return device EUI64 MAC address.
#define NULL
The null pointer.
process_event_t ble_event_interface_deleted
This event is broadcast when BLE connection is destroyed.
void ble_advertising_start(void)
Start BLE advertising.
int etimer_expired(struct etimer *et)
Check if an event timer has expired.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
void watchdog_periodic(void)
Writes the WDT clear sequence.
#define CLOCK_SECOND
A second, measured in system clock time.
void ble_stack_init(void)
Initialize and enable the BLE stack.
void process_start(struct process *p, process_data_t data)
Start a process.
int main(void)
This is main...
void rtimer_init(void)
Initialize the real-time scheduler.
void watchdog_init(void)
Copyright (c) 2014, Analog Devices, Inc.
A set of debugging macros for the IP stack
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.
int serial_line_input_byte(unsigned char c)
Get one byte of input from the serial driver.
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
static void board_init(void)
Board specific initialization.
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
void etimer_reset(struct etimer *et)
Reset an event timer with the same interval as was previously set.
#define PROCESS_BEGIN()
Define the beginning of a process.