11 #ifndef __MG32F157_TRNG_H 12 #define __MG32F157_TRNG_H 41 #define TRNG_IT_SEIS ((uint16_t)0x4008) 42 #define TRNG_IT_CEIS ((uint16_t)0x2008) 43 #define TRNG_IT_DRDY ((uint16_t)0x0108) 45 #define IS_TRNG_CLEAR_IT(IT) (((IT) == TRNG_IT_SEIS) || ((IT) == TRNG_IT_CEIS) ||\ 46 ((IT) == (TRNG_IT_CEIS | TRNG_IT_SEIS))) 48 #define IS_TRNG_GET_IT(IT) (((IT) == TRNG_IT_SEIS) || ((IT) == TRNG_IT_CEIS) || \ 49 ((IT) == TRNG_IT_DRDY)) 58 #define TRNG_FLAG_SECS ((uint8_t)0x04) 59 #define TRNG_FLAG_CECS ((uint8_t)0x02) 60 #define TRNG_FLAG_DRDY ((uint8_t)0x01) 62 #define IS_TRNG_GET_FLAG(FLAG) (((FLAG) == TRNG_FLAG_SECS) || ((FLAG) == TRNG_FLAG_CECS) || \ 63 ((FLAG) == TRNG_FLAG_DRDY)) 65 #define IS_TRNG_CLEAR_FLAG(FLAG) (((FLAG) == TRNG_FLAG_SECS) || ((FLAG) == TRNG_FLAG_CECS) || \ 66 ((FLAG) == (TRNG_FLAG_SECS | TRNG_FLAG_CECS))) 79 void TRNG_Cmd(FunctionalState NewState);
void TRNG_DeInit(void)
Deinitializes the TRNG peripheral registers to their default reset values.
Definition: mg32f157_trng.c:51
void TRNG_ClearFlag(uint8_t TRNG_FLAG)
Clears the TRNG's pending flags.
Definition: mg32f157_trng.c:157
ITStatus TRNG_GetITStatus(uint16_t TRNG_IT)
Checks whether the specified TRNG interrupt has occurred or not.
Definition: mg32f157_trng.c:197
void TRNG_ITCmd(FunctionalState NewState)
Enable or Disable the TRNG interrupt.
Definition: mg32f157_trng.c:171
void TRNG_ClearITPendingBit(uint16_t TRNG_IT)
Clears the TRNG's pending interrupt pending bits.
Definition: mg32f157_trng.c:235
uint32_t TRNG_GetData(void)
Returns true random number value.
Definition: mg32f157_trng.c:110
void TRNG_Cmd(FunctionalState NewState)
Enables or disables the TRNG peripheral generate true random number.
Definition: mg32f157_trng.c:89
FlagStatus TRNG_GetFlagStatus(uint8_t TRNG_FLAG)
Checks whether the specified TRNG flag is set or not.
Definition: mg32f157_trng.c:124
void TRNG_Clock_CheckCmd(FunctionalState NewState)
Enables or disables the TRNG clock error detection.
Definition: mg32f157_trng.c:66