Beispiel #1
0
void isr_ecb(void *param)
{
	ARG_UNUSED(param);

	if (NRF_ECB->EVENTS_ERRORECB) {
		struct ecb *ecb = (struct ecb *)NRF_ECB->ECBDATAPTR;

		ecb_cleanup();

		ecb->fp_ecb(1, 0, ecb->context);
	}

	else if (NRF_ECB->EVENTS_ENDECB) {
		struct ecb *ecb = (struct ecb *)NRF_ECB->ECBDATAPTR;

		ecb_cleanup();

		ecb->fp_ecb(0, &ecb->out_cipher_text_be[0],
			      ecb->context);
	}

	else {
		LL_ASSERT(0);
	}
}
Beispiel #2
0
u32_t cntr_stop(void)
{
	LL_ASSERT(_refcount);

	if (--_refcount) {
		return 1;
	}

	NRF_RTC->TASKS_STOP = 1;

	return 0;
}
Beispiel #3
0
void rand_init(u8_t *context, u8_t context_len)
{
	LL_ASSERT(context_len > sizeof(struct rand));

	rng = (struct rand *)context;
	rng->count = context_len - sizeof(struct rand) + 1;
	rng->first = rng->last = 0;

	NRF_RNG->CONFIG = RNG_CONFIG_DERCEN_Msk;
	NRF_RNG->EVENTS_VALRDY = 0;
	NRF_RNG->INTENSET = RNG_INTENSET_VALRDY_Msk;

	NRF_RNG->TASKS_START = 1;
}
Beispiel #4
0
os::Machine& os::machine() noexcept {
  LL_ASSERT(__machine != nullptr);
  return *__machine;
}