47 lines
1.6 KiB
C
Executable File
47 lines
1.6 KiB
C
Executable File
#include <stdint.h>
|
|
|
|
typedef struct {
|
|
uint32_t reserve0 : 2; // 0 Reserve
|
|
uint32_t rngen : 1; // 2 True random number generator enable
|
|
uint32_t ie : 1; // 3 Interrupt Enable
|
|
uint32_t reserve1 : 1; // 4 Reserve
|
|
uint32_t ced : 1; // 5 Clock error detection
|
|
uint32_t reserve2 : 1; // 6 Reserve
|
|
uint32_t ardis : 1; // 7 Auto reset disable
|
|
uint32_t rng_config3: 4; // 8 RNG configuration 3
|
|
uint32_t nistc : 1; // 12 Non NIST compliant
|
|
uint32_t rng_config2: 3; // 13 RNG configuration 2
|
|
uint32_t clkdiv : 4; // 16 Clock divider factor
|
|
uint32_t rng_config1: 6; // 20 RNG configuration 1
|
|
uint32_t reserve3 : 4; // 26 Reserve
|
|
uint32_t condrst : 1; // 30 Conditioning soft reset
|
|
uint32_t configlock: 1; // 31 RNG Config Lock
|
|
} reg_rng_cr_t;
|
|
|
|
typedef struct {
|
|
uint32_t drdy : 1; // 0 Data ready
|
|
uint32_t cecs : 1; // 1 Clock error current status
|
|
uint32_t secs : 1; // 2 Seed error current status
|
|
uint32_t reserve0 : 2; // 3 Reserve
|
|
uint32_t ceis : 1; // 5 Clock error interrupt status
|
|
uint32_t seis : 1; // 6 Seed error interrupt status
|
|
uint32_t reserve1 : 25; // 7 Reserve
|
|
} reg_rng_sr_t;
|
|
|
|
typedef struct {
|
|
uint32_t rndata : 32; // 0 Random data
|
|
} reg_rng_dr_t;
|
|
|
|
typedef struct {
|
|
uint32_t htcfg : 32; // 0 health test configuration
|
|
} reg_rng_htcr_t;
|
|
|
|
typedef struct {
|
|
volatile reg_rng_cr_t cr;
|
|
volatile reg_rng_sr_t sr;
|
|
volatile reg_rng_dr_t dr;
|
|
volatile uint32_t reserve0[1];
|
|
volatile reg_rng_htcr_t htcr;
|
|
} reg_rng_t;
|
|
|