ch32v30x_rng.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : ch32v30x_rng.h
  3. * Author : WCH
  4. * Version : V1.0.0
  5. * Date : 2021/06/06
  6. * Description : This file contains all the functions prototypes for the
  7. * RNG firmware library.
  8. *********************************************************************************
  9. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  10. * Attention: This software (modified or not) and binary are used for
  11. * microcontroller manufactured by Nanjing Qinheng Microelectronics.
  12. *******************************************************************************/
  13. #ifndef __CH32V30x_RNG_H
  14. #define __CH32V30x_RNG_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include "ch32v30x.h"
  19. /* RNG_flags_definition*/
  20. #define RNG_FLAG_DRDY ((uint8_t)0x0001) /* Data ready */
  21. #define RNG_FLAG_CECS ((uint8_t)0x0002) /* Clock error current status */
  22. #define RNG_FLAG_SECS ((uint8_t)0x0004) /* Seed error current status */
  23. /* RNG_interrupts_definition */
  24. #define RNG_IT_CEI ((uint8_t)0x20) /* Clock error interrupt */
  25. #define RNG_IT_SEI ((uint8_t)0x40) /* Seed error interrupt */
  26. void RNG_Cmd(FunctionalState NewState);
  27. uint32_t RNG_GetRandomNumber(void);
  28. void RNG_ITConfig(FunctionalState NewState);
  29. FlagStatus RNG_GetFlagStatus(uint8_t RNG_FLAG);
  30. void RNG_ClearFlag(uint8_t RNG_FLAG);
  31. ITStatus RNG_GetITStatus(uint8_t RNG_IT);
  32. void RNG_ClearITPendingBit(uint8_t RNG_IT);
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif