| M480 BSP V3.05.001 The Board Support Package for M480 Series

trng.h
Go to the documentation of this file.
1 /**************************************************************************/
9 #ifndef __TRNG_H__
10 #define __TRNG_H__
11
12 #ifdef __cplusplus
13 extern "C"
14 {
15 #endif
16
30 /*----------------------------------------------------------------------------------------------*/
31 /* Macros */
32 /*----------------------------------------------------------------------------------------------*/
33
52 #define TRNG_SET_CLKP(clkpsc) do { TRNG->CTL = (TRNG->CTL&~TRNG_CTL_CLKP_Msk)|((clkpsc & 0xf)<<TRNG_CTL_CLKP_Pos); } while(0);
53
54 /* end of group M480_TRNG_EXPORTED_MACROS */
56
57
63 /*---------------------------------------------------------------------------------------------------------*/
64 /* Functions */
65 /*---------------------------------------------------------------------------------------------------------*/
66
67 void TRNG_Open(void);
68 int32_t TRNG_GenWord(uint32_t *u32RndNum);
69 int32_t TRNG_GenBignum(uint8_t u8BigNum[], int32_t i32Len);
70 int32_t TRNG_GenBignumHex(char cBigNumHex[], int32_t i32Len);
71
72 /* end of group TRNG_EXPORTED_FUNCTIONS */
74 /* end of group TRNG_Driver */
76 /* end of group Standard_Driver */
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif /* __TRNG_H__ */
84
85 /*** (C) COPYRIGHT 2019 Nuvoton Technology Corp. ***/
86
TRNG_Open
void TRNG_Open(void)
Initialize TRNG hardware.
Definition: trng.c:33
TRNG_GenWord
int32_t TRNG_GenWord(uint32_t *u32RndNum)
Generate a 32-bits random number word.
Definition: trng.c:55
TRNG_GenBignumHex
int32_t TRNG_GenBignumHex(char cBigNumHex[], int32_t i32Len)
Generate a big number in hex format.
Definition: trng.c:125
TRNG_GenBignum
int32_t TRNG_GenBignum(uint8_t u8BigNum[], int32_t i32Len)
Generate a big number in binary format.
Definition: trng.c:91