Random number generator of the nRF52, which fills a cache of bytes from its interrupt.
More...
|
| #define | PBL_RNG_NRF5_DEFINE(sym, _name, _base, _irq) |
| | Define the RNG, connecting its interrupt with priority CONFIG_RNG_NRF5_IRQ_PRIO.
|
| |
Random number generator of the nRF52, which fills a cache of bytes from its interrupt.
◆ pbl_rng_nrf5_state
| struct pbl_rng_nrf5_state |
| Data Fields |
|
uint8_t |
cache[PBL_RNG_NRF5_CACHE_SIZE] |
Bytes generated, not yet read. |
|
volatile uint8_t |
count |
Bytes in the cache. |
|
uint8_t |
in |
Where the next generated byte goes. |
|
uint8_t |
out |
Where the next byte is read from. |
◆ pbl_rng_nrf5
| Data Fields |
|
uintptr_t |
base |
Registers. |
|
uint32_t |
irq |
Interrupt line. |
|
struct pbl_rng |
rng |
Random number generator. |
|
struct pbl_rng_nrf5_state * |
state |
Runtime state. |
◆ PBL_RNG_NRF5_DEFINE
| #define PBL_RNG_NRF5_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_base, |
|
|
|
_irq |
|
) |
| |
Value:
.rng =
PBL_RNG_INIT(sym, _name,
nullptr, &pbl_rng_nrf5_ops), \
.state = &sym##_nrf5_state, \
.base = (_base), \
.irq = (_irq), \
}; \
RNG runtime state.
Definition nrf5.h:23
void pbl_rng_nrf5_irq_handler(const struct pbl_rng_nrf5 *nrf5)
RNG interrupt handler, connected by PBL_RNG_NRF5_DEFINE().
Random number generator.
Definition rng.h:40
#define PBL_RNG_INIT(sym, _name, _parent, _ops)
Initialize a struct pbl_rng.
Definition rng.h:70
#define PBL_RNG_STATE_DEFINE(sym)
Define the class state of a random number generator.
Definition rng.h:60
Define the RNG, connecting its interrupt with priority CONFIG_RNG_NRF5_IRQ_PRIO.
- Parameters
-
| sym | Symbol of the device. |
| _name | Name. |
| _base | Registers. |
| _irq | Interrupt line, a plain number. |
◆ pbl_rng_nrf5_irq_handler()
| void pbl_rng_nrf5_irq_handler |
( |
const struct pbl_rng_nrf5 * |
nrf5 | ) |
|