hc32f460_rmu.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*****************************************************************************
  2. * Copyright (C) 2020, Huada Semiconductor Co., Ltd. All rights reserved.
  3. *
  4. * This software component is licensed by HDSC 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. /** \file hc32f460_rmu.h
  11. **
  12. ** A detailed description is available at
  13. ** @link RmuGroup RMU description @endlink
  14. **
  15. ** - 2018-10-28 CDT First version for Device Driver Library of RMU
  16. **
  17. ******************************************************************************/
  18. #ifndef __HC32F460_RMU_H__
  19. #define __HC32F460_RMU_H__
  20. /*******************************************************************************
  21. * Include files
  22. ******************************************************************************/
  23. #include "hc32_common.h"
  24. #include "ddl_config.h"
  25. #if (DDL_RMU_ENABLE == DDL_ON)
  26. /* C binding of definitions if building with C++ compiler */
  27. #ifdef __cplusplus
  28. extern "C"
  29. {
  30. #endif
  31. /**
  32. *******************************************************************************
  33. ** \defgroup RmuGroup Reset Management Unit(RMU)
  34. **
  35. ******************************************************************************/
  36. //@{
  37. /*******************************************************************************
  38. * Global type definitions ('typedef')
  39. ******************************************************************************/
  40. /**
  41. *******************************************************************************
  42. ** \brief system reset cause flag
  43. **
  44. ******************************************************************************/
  45. typedef struct stc_rmu_rstcause
  46. {
  47. en_flag_status_t enMultiRst; ///< Multiply reset cause
  48. en_flag_status_t enXtalErr; ///< Xtal error reset
  49. en_flag_status_t enClkFreqErr; ///< Clk freqence error reset
  50. en_flag_status_t enRamEcc; ///< Ram ECC reset
  51. en_flag_status_t enRamParityErr; ///< Ram parity error reset
  52. en_flag_status_t enMpuErr; ///< Mpu error reset
  53. en_flag_status_t enSoftware; ///< Software reset
  54. en_flag_status_t enPowerDown; ///< Power down reset
  55. en_flag_status_t enSwdt; ///< Special watchdog timer reset
  56. en_flag_status_t enWdt; ///< Watchdog timer reset
  57. en_flag_status_t enPvd2; ///< Program voltage Dectection 2 reset
  58. en_flag_status_t enPvd1; ///< Program voltage Dectection 1 reset
  59. en_flag_status_t enBrownOut; ///< Brown out reset
  60. en_flag_status_t enRstPin; ///< Reset pin reset
  61. en_flag_status_t enPowerOn; ///< Power on reset
  62. }stc_rmu_rstcause_t;
  63. /*******************************************************************************
  64. * Global pre-processor symbols/macros ('#define')
  65. ******************************************************************************/
  66. /*******************************************************************************
  67. * Global variable definitions ('extern')
  68. ******************************************************************************/
  69. /*******************************************************************************
  70. * Global function prototypes (definition in C source)
  71. ******************************************************************************/
  72. en_result_t RMU_GetResetCause(stc_rmu_rstcause_t *pstcData);
  73. en_result_t RMU_ClrResetFlag(void);
  74. //@} // RmuGroup
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78. #endif /* DDL_RMU_ENABLE */
  79. #endif /* __HC32F460_RMU_H__ */
  80. /*******************************************************************************
  81. * EOF (not truncated)
  82. ******************************************************************************/