trng.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /******************************************************************************
  2. * Copyright (C) 2021, Xiaohua Semiconductor Co., Ltd. All rights reserved.
  3. *
  4. * This software component is licensed by XHSC under BSD 3-Clause license
  5. * (the "License"); You may not use this file except in compliance with the
  6. * License. You may obtain a copy of the License at:
  7. * opensource.org/licenses/BSD-3-Clause
  8. *
  9. ******************************************************************************/
  10. /******************************************************************************
  11. * @file trng.h
  12. *
  13. * @brief Header file for TRNG functions
  14. *
  15. * @author MADS Team
  16. *
  17. ******************************************************************************/
  18. #ifndef __TRNG_H__
  19. #define __TRNG_H__
  20. /*******************************************************************************
  21. * Include files
  22. ******************************************************************************/
  23. #include "ddl.h"
  24. #ifdef __cplusplus
  25. extern "C"
  26. {
  27. #endif
  28. /**
  29. ******************************************************************************
  30. ** \defgroup TrngGroup (TRNG)
  31. **
  32. ******************************************************************************/
  33. //@{
  34. /**
  35. *******************************************************************************
  36. ** function prototypes.
  37. ******************************************************************************/
  38. /*******************************************************************************
  39. * Global definitions
  40. ******************************************************************************/
  41. /******************************************************************************
  42. * Global variable declarations ('extern', definition in C source)
  43. ******************************************************************************/
  44. /******************************************************************************
  45. * Global function prototypes (definition in C source)
  46. ******************************************************************************/
  47. ///< 随机数初始化(上电第一次生成随机数)
  48. en_result_t Trng_Init(void);
  49. ///< 生成随机数(非上电第一次生成随机数)
  50. en_result_t Trng_Generate(void);
  51. ///< 获取64bits随机数(执行随机数初始化或生成随机数函数后可使用该函数获取随机数值)
  52. uint32_t Trng_GetData0(void);
  53. uint32_t Trng_GetData1(void);
  54. //@} // Trng Group
  55. #ifdef __cplusplus
  56. #endif
  57. #endif /* __TRNG_H__ */
  58. /*******************************************************************************
  59. * EOF (not truncated)
  60. ******************************************************************************/