rng: add irq enable/disable helper.
This commit is contained in:
parent
e2ac1a6358
commit
64baacfbbf
@ -75,6 +75,8 @@ BEGIN_DECLS
|
|||||||
|
|
||||||
void rng_enable(void);
|
void rng_enable(void);
|
||||||
void rng_disable(void);
|
void rng_disable(void);
|
||||||
|
void rng_interrupt_enable(void);
|
||||||
|
void rng_interrupt_disable(void);
|
||||||
bool rng_get_random(uint32_t *rand_nr);
|
bool rng_get_random(uint32_t *rand_nr);
|
||||||
uint32_t rng_get_random_blocking(void);
|
uint32_t rng_get_random_blocking(void);
|
||||||
|
|
||||||
|
@ -44,6 +44,20 @@ void rng_enable(void)
|
|||||||
RNG_CR |= RNG_CR_RNGEN;
|
RNG_CR |= RNG_CR_RNGEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Enable the Random Number Generator error interrupt.
|
||||||
|
*/
|
||||||
|
void rng_interrupt_enable(void)
|
||||||
|
{
|
||||||
|
RNG_CR |= RNG_CR_IE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Disable the Random Number Generator error interrupt.
|
||||||
|
*/
|
||||||
|
void rng_interrupt_disable(void)
|
||||||
|
{
|
||||||
|
RNG_CR &= ~RNG_CR_IE;
|
||||||
|
}
|
||||||
|
|
||||||
/** Randomizes a number (non-blocking).
|
/** Randomizes a number (non-blocking).
|
||||||
* Can fail if a clock error or seed error is detected. Consult the Reference
|
* Can fail if a clock error or seed error is detected. Consult the Reference
|
||||||
* Manual, but "try again", potentially after resetting the peripheral
|
* Manual, but "try again", potentially after resetting the peripheral
|
||||||
|
Loading…
x
Reference in New Issue
Block a user