hal_trng_lld.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file hal_trng_lld.h
  15. * @brief PLATFORM TRNG subsystem low level driver header.
  16. *
  17. * @addtogroup TRNG
  18. * @{
  19. */
  20. #ifndef HAL_TRNG_LLD_H
  21. #define HAL_TRNG_LLD_H
  22. #if (HAL_USE_TRNG == TRUE) || defined(__DOXYGEN__)
  23. /*===========================================================================*/
  24. /* Driver constants. */
  25. /*===========================================================================*/
  26. /*===========================================================================*/
  27. /* Driver pre-compile time settings. */
  28. /*===========================================================================*/
  29. /**
  30. * @name PLATFORM configuration options
  31. * @{
  32. */
  33. /**
  34. * @brief TRNGD1 driver enable switch.
  35. * @details If set to @p TRUE the support for TRNGD1 is included.
  36. * @note The default is @p FALSE.
  37. */
  38. #if !defined(PLATFORM_TRNG_USE_TRNG1) || defined(__DOXYGEN__)
  39. #define PLATFORM_TRNG_USE_TRNG1 FALSE
  40. #endif
  41. /** @} */
  42. /*===========================================================================*/
  43. /* Derived constants and error checks. */
  44. /*===========================================================================*/
  45. /*===========================================================================*/
  46. /* Driver data structures and types. */
  47. /*===========================================================================*/
  48. /*===========================================================================*/
  49. /* Driver macros. */
  50. /*===========================================================================*/
  51. /**
  52. * @brief Low level fields of the TRNG driver structure.
  53. */
  54. #define trng_lld_driver_fields \
  55. /* Dummy field, it is not needed.*/ \
  56. uint32_t dummy
  57. /**
  58. * @brief Low level fields of the TRNG configuration structure.
  59. */
  60. #define trng_lld_config_fields \
  61. /* Dummy configuration, it is not needed.*/ \
  62. uint32_t dummy
  63. /*===========================================================================*/
  64. /* External declarations. */
  65. /*===========================================================================*/
  66. #if (PLATFORM_TRNG_USE_TRNG1 == TRUE) && !defined(__DOXYGEN__)
  67. extern TRNGDriver TRNGD1;
  68. #endif
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72. void trng_lld_init(void);
  73. void trng_lld_start(TRNGDriver *trngp);
  74. void trng_lld_stop(TRNGDriver *trngp);
  75. bool trng_lld_generate(TRNGDriver *trngp, size_t size, uint8_t *out);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif /* HAL_USE_TRNG == TRUE */
  80. #endif /* HAL_TRNG_LLD_H */
  81. /** @} */