36#include "nordic_common.h"
38#include "sdk_config.h"
39#include "nrfx_gpiote.h"
43#include "contiki-net.h"
46#include "lib/sensors.h"
51#include "usb/usb-serial.h"
62#define LOG_MODULE "NRF52DK"
63#define LOG_LEVEL LOG_LEVEL_MAIN
66#define NORDIC_SEMI_VENDOR_OUI 0xF4CE36
71 uint8_t device_address[8];
72 uint32_t device_address_low;
79 device_address[0] = (NORDIC_SEMI_VENDOR_OUI) >> 16 & 0xFF;
80 device_address[1] = (NORDIC_SEMI_VENDOR_OUI) >> 8 & 0xFF;
81 device_address[2] = NORDIC_SEMI_VENDOR_OUI & 0xFF;
82 device_address[3] = NRF_FICR->DEVICEADDR[1] & 0xFF;
84 device_address_low = NRF_FICR->DEVICEADDR[0];
85 memcpy(&device_address[4], &device_address_low, 4);
104 NRF_RNG->TASKS_START = 1;
105 for(
size_t i = 0; i <
sizeof(seed.u8); i++) {
106 NRF_RNG->EVENTS_VALRDY = 0;
107 while(!NRF_RNG->EVENTS_VALRDY);
108 seed.
u8[i] = NRF_RNG->VALUE;
110 NRF_RNG->TASKS_STOP = 1;
118#ifdef PLATFORM_HAS_BUTTON
126 uart0_set_input(serial_line_input_byte);
130#if NRF52840_NATIVE_USB
138#if NRF52840_USB_DFU_TRIGGER
An OFB-AES-128-based CSPRNG.
void usb_serial_set_input(int(*input)(unsigned char c))
Set an input hook for bytes received over USB.
void usb_serial_init()
Initialise the Serial-over-USB process.
void platform_init_stage_three()
Final stage of platform driver initialisation.
void platform_init_stage_one(void)
Basic (Stage 1) platform driver initialisation.
void platform_idle()
The platform's idle/sleep function.
void platform_init_stage_two()
Stage 2 of platform driver initialisation.
void lpm_drop()
Drop the cortex to sleep / deep sleep and shut down peripherals.
void csprng_feed(struct csprng_seed *new_seed)
Mixes a new seed with the current one.
void leds_init(void)
Initialise the LED HAL.
void populate_link_address(void)
Populates the link address using factory information.
void gpio_hal_init()
Initialise the GPIO HAL.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
void dfu_trigger_usb_init(void)
Initialise the DFU trigger library.
void process_start(struct process *p, process_data_t data)
Start a process.
Header file for the LED HAL.
Header file for the logging system.
void uart0_init(unsigned long ubr)
Initalize the RS232 port.
Generic serial I/O process header filer.
This is the structure of a seed.
uint8_t u8[(AES_128_KEY_LENGTH+AES_128_BLOCK_SIZE)]
for convenience
Header file for the nRF52840 Dongle DFU trigger library.