示例#1
0
文件: ecb.c 项目: sunkaizhu/zephyr
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);
	}
}
示例#2
0
文件: cntr.c 项目: wosayttn/aos
u32_t cntr_stop(void)
{
	LL_ASSERT(_refcount);

	if (--_refcount) {
		return 1;
	}

	NRF_RTC->TASKS_STOP = 1;

	return 0;
}
示例#3
0
文件: rand.c 项目: bboozzoo/zephyr
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;
}
示例#4
0
os::Machine& os::machine() noexcept {
  LL_ASSERT(__machine != nullptr);
  return *__machine;
}