no-OS
aducm3029_trng.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef ADUCM3029_TRNG_H
41 #define ADUCM3029_TRNG_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 #include <drivers/rng/adi_rng.h>
47 #include "no_os_trng.h"
48 
49 /******************************************************************************/
50 /********************** Macros and Constants Definitions **********************/
51 /******************************************************************************/
52 
53 /* LenReload: 0 - 4095 */
54 #define NO_OS_TRNG_CNT_VAL 4095
55 /* Prescaler: 0 - 10 */
56 #define NO_OS_TRNG_PRESCALER 2
57 /* Aducm device ID */
58 #define NO_OS_ADUCM_TRNG_DEVICE_ID 0
59 
60 /******************************************************************************/
61 /*************************** Types Declarations *******************************/
62 /******************************************************************************/
63 
64 /* Stucture holding the TRNG descriptor. */
66  /*
67  * Memory used by the DFP
68  * At least ADI_RNG_MEMORY_SIZE bytes of 4 bytes aligned memory are
69  * needed by the DFP driver. The formula is to align memory only.
70  */
71  uint32_t dev_mem[(ADI_RNG_MEMORY_SIZE + 3) / 4];
72  /* DFP Hanler */
73  ADI_RNG_HANDLE dev;
74 };
75 
79 extern const struct no_os_trng_platform_ops aducm_trng_ops;
80 
81 #endif // ADUCM3029_TRNG_H
no_os_alloc.h
aducm3029_trng_desc::dev_mem
uint32_t dev_mem[(ADI_RNG_MEMORY_SIZE+3)/4]
Definition: aducm3029_trng.h:71
aducm3029_trng_remove
int aducm3029_trng_remove(struct no_os_trng_desc *desc)
Free resources allocated in descriptor.
Definition: aducm3029_trng.c:119
aducm3029_trng_fill_buffer
int aducm3029_trng_fill_buffer(struct no_os_trng_desc *desc, uint8_t *buff, uint32_t len)
Fill buffer with random numbers.
Definition: aducm3029_trng.c:141
no_os_trng_platform_ops::init
int(* init)(struct no_os_trng_desc **, const struct no_os_trng_init_param *)
Definition: no_os_trng.h:92
aducm_trng_ops
const struct no_os_trng_platform_ops aducm_trng_ops
ADuCM3029 specific TRNG platform ops structure.
Definition: aducm3029_trng.c:173
aducm_trng_ops
const struct no_os_trng_platform_ops aducm_trng_ops
ADuCM3029 platform specific TRNG platform ops structure.
Definition: aducm3029_trng.c:173
NO_OS_TRNG_CNT_VAL
#define NO_OS_TRNG_CNT_VAL
Definition: aducm3029_trng.h:54
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
aducm3029_trng_init
int aducm3029_trng_init(struct no_os_trng_desc **desc, struct no_os_trng_init_param *param)
Initialize descriptor.
Definition: aducm3029_trng.c:90
no_os_trng_desc
TRNG Descriptor.
Definition: no_os_trng.h:65
no_os_error.h
Error codes definition.
no_os_trng.h
Header file of true random number generator.
aducm3029_trng.h
ADuCM302x specific header for TRNG driver.
no_os_trng_init_param
Init parameter for TRNG.
Definition: no_os_trng.h:76
NO_OS_UNUSED_PARAM
#define NO_OS_UNUSED_PARAM(x)
Definition: no_os_util.h:115
NO_OS_ADUCM_TRNG_DEVICE_ID
#define NO_OS_ADUCM_TRNG_DEVICE_ID
Definition: aducm3029_trng.h:58
NO_OS_TRNG_PRESCALER
#define NO_OS_TRNG_PRESCALER
Definition: aducm3029_trng.h:56
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
aducm3029_trng_desc
Definition: aducm3029_trng.h:65
no_os_trng_desc::extra
void * extra
Definition: no_os_trng.h:69
no_os_util.h
Header file of utility functions.
no_os_trng_platform_ops
Structure holding TRNG function pointers that point to the platform specific function.
Definition: no_os_trng.h:90
aducm3029_trng_desc::dev
ADI_RNG_HANDLE dev
Definition: aducm3029_trng.h:73