hc32f460_swdt.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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_swdt.h
  11. **
  12. ** A detailed description is available at
  13. ** @link SwdtGroup Special Watchdog Counter description @endlink
  14. **
  15. ** - 2018-10-16 CDT First version for Device Driver Library of SWDT.
  16. **
  17. ******************************************************************************/
  18. #ifndef __HC32F460_SWDT_H__
  19. #define __HC32F460_SWDT_H__
  20. /*******************************************************************************
  21. * Include files
  22. ******************************************************************************/
  23. #include "hc32_common.h"
  24. #include "ddl_config.h"
  25. #if (DDL_SWDT_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 SwdtGroup Special Watchdog Counter(SWDT)
  34. **
  35. ******************************************************************************/
  36. //@{
  37. /*******************************************************************************
  38. * Global type definitions ('typedef')
  39. ******************************************************************************/
  40. /**
  41. *******************************************************************************
  42. ** \brief SWDT flag type enumeration
  43. ******************************************************************************/
  44. typedef enum en_swdt_flag_type
  45. {
  46. SwdtFlagCountUnderflow = 0u, ///< Count underflow flag
  47. SwdtFlagRefreshError = 1u, ///< Refresh error flag
  48. } en_swdt_flag_type_t;
  49. /*******************************************************************************
  50. * Global pre-processor symbols/macros ('#define')
  51. ******************************************************************************/
  52. /*******************************************************************************
  53. * Global variable definitions ('extern')
  54. ******************************************************************************/
  55. /*******************************************************************************
  56. Global function prototypes (definition in C source)
  57. ******************************************************************************/
  58. /* Base functions */
  59. en_result_t SWDT_RefreshCounter(void);
  60. uint16_t SWDT_GetCountValue(void);
  61. /* Flags functions */
  62. en_flag_status_t SWDT_GetFlag(en_swdt_flag_type_t enFlag);
  63. en_result_t SWDT_ClearFlag(en_swdt_flag_type_t enFlag);
  64. //@} // SwdtGroup
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* DDL_SWDT_ENABLE */
  69. #endif /* __HC32F460_SWDT_H__ */
  70. /*******************************************************************************
  71. * EOF (not truncated)
  72. ******************************************************************************/