/* Randomizes a number (non-blocking). Can fail if a clock error or seed error is detected. Consult the Reference Manual, but "try again", potentially after resetting the peripheral  */
bool rng_get_random(uint32_t *rand_nr)
/* Randomizes a number (non-blocking). Can fail if a clock error or seed error is detected. Consult the Reference Manual, but "try again", potentially after resetting the peripheral  */
bool rng_get_random(uint32_t *rand_nr)
{
        if (RNG_SR & (RNG_SR_CECS | RNG_SR_SECS)) {
                return false;
        }
        if (!(RNG_SR & RNG_SR_DRDY)) {
                return false;
        }
        *rand_nr = RNG_DR;
        return true;
}