38 #include "nordic_common.h" 41 #include "nrf_drv_config.h" 42 #include "nrf_drv_gpiote.h" 43 #ifdef SOFTDEVICE_PRESENT 44 #include "softdevice_handler.h" 49 #include "contiki-net.h" 51 #include "lib/sensors.h" 54 #include "dev/uart0.h" 59 #define LOG_MODULE "NRF52DK" 60 #define LOG_LEVEL LOG_LEVEL_MAIN 62 #if defined(SOFTDEVICE_PRESENT) && PLATFORM_INDICATE_BLE_STATE 63 PROCESS(ble_iface_observer,
"BLE interface observer");
71 static struct etimer led_timer;
86 }
else if(ev == PROCESS_EVENT_TIMER &&
etimer_expired(&led_timer)) {
103 #ifdef SOFTDEVICE_PRESENT 105 SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);
107 #ifdef PLATFORM_HAS_BUTTON 108 if (!nrf_drv_gpiote_is_init()) {
109 nrf_drv_gpiote_init();
129 #if SLIP_ARCH_CONF_ENABLE 130 #error Platform does not support SLIP 137 #ifdef SOFTDEVICE_PRESENT 146 #if defined(SOFTDEVICE_PRESENT) && NETSTACK_CONF_WITH_IPV6 156 #ifdef SOFTDEVICE_PRESENT #define PROCESS(name, strname)
Declare a process.
void etimer_stop(struct etimer *et)
Stop a pending event timer.
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
void platform_init_stage_two()
Stage 2 of platform driver initialisation.
#define PROCESS_BEGIN()
Define the beginning of a process.
void ble_stack_init(void)
Initialize and enable the BLE stack.
void platform_idle()
The platform's idle/sleep function.
#define PROCESS_END()
Define the end of a process.
void ble_advertising_init(const char *name)
Initialize BLE advertising data.
void leds_init(void)
Initialise the LED HAL.
process_event_t ble_event_interface_added
This event is broadcast when BLE connection is established.
void leds_on(unsigned char leds)
Turn on multiple LEDs.
void leds_off(unsigned char leds)
Turn off multiple LEDs.
A MAC protocol implementation that uses nRF52 IPSP implementation as a link layer.
void lpm_drop()
Drop the cortex to sleep / deep sleep and shut down peripherals.
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 uart0_init(unsigned long ubr)
Initalize the RS232 port.
void board_init(void)
Board specific iniatialisation.
void ble_get_mac(uint8_t addr[8])
Return device EUI64 MAC address.
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.
#define DEVICE_NAME
Device name used in BLE undirected advertisement.
void platform_init_stage_three()
Final stage of platform driver initialisation.
void leds_toggle(unsigned char leds)
Toggle multiple LEDs.
void random_init(unsigned short seed)
Seed the cc2538 random number generator.
Generic serial I/O process header filer.
PROCESS_THREAD(cc2538_rf_process, ev, data)
Implementation of the cc2538 RF driver process.
void etimer_reset(struct etimer *et)
Reset an event timer with the same interval as was previously set.
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 etimer_set(struct etimer *et, clock_time_t interval)
Set an event timer.
void process_start(struct process *p, process_data_t data)
Start a process.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.