49#include "int-master.h"
52#include "linkaddr-arch.h"
56#include "nrfx_config.h"
62#define LOG_MODULE "NRF"
63#define LOG_LEVEL LOG_LEVEL_MAIN
65#if NRF_HARDFAULT_HANDLER_EXTENDED
66void hardfault_print_saved_crash(
void);
69__attribute__((weak))
void
70platform_init_board(
void)
74__attribute__((weak))
void
75platform_init_board_stage_two(
void)
83 platform_init_board();
90#if defined(NRF_RNG) && CSPRNG_ENABLED
93 NRF_RNG->TASKS_START = 1;
94 for(
size_t i = 0; i <
sizeof(seed); i++) {
95 NRF_RNG->EVENTS_VALRDY = 0;
96 while(!NRF_RNG->EVENTS_VALRDY);
97 ((uint8_t *)&seed)[i] = NRF_RNG->VALUE;
99 NRF_RNG->TASKS_STOP = 1;
107 platform_init_board_stage_two();
113#if NRF_HAS_UARTE && !defined(NRF_TRUSTZONE_NONSECURE)
115#if NRF_HARDFAULT_HANDLER_EXTENDED
116 hardfault_print_saved_crash();
120#if NRF_HAS_USB && defined(NRF_NATIVE_USB) && NRF_NATIVE_USB == 1
127#if PLATFORM_DBG_CONF_USB
An OFB-AES-128-based CSPRNG.
Header file for the GPIO HAL.
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.
void reset_debug(void)
Logs the reset reason.
void uarte_init(void)
Initializa the UARTE driver.
void uarte_set_input(int(*input)(unsigned char c))
Sets the input handler called in the event handler.
void usb_set_input(int(*input)(unsigned char c))
Sets the input handler called in the event handler.
void usb_init(void)
Initialize the USB driver.
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.
Reset reason implementation for the nRF.
Generic serial I/O process header filer.
This is the structure of a seed.
UARTE header file for the nRF.