wdg_drv.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 wdt.h
  12. *
  13. * @brief Header file for WDT functions
  14. *
  15. * @author MADS Team
  16. *
  17. ******************************************************************************/
  18. #ifndef __WDT_H__
  19. #define __WDT_H__
  20. //#include "ddl.h"
  21. /**
  22. ******************************************************************************
  23. ** \defgroup WdtGroup Watchdog Timer (WDT)
  24. **
  25. ******************************************************************************/
  26. //@{
  27. /******************************************************************************/
  28. /* Global pre-processor symbols/macros ('#define') */
  29. /******************************************************************************/
  30. /******************************************************************************
  31. * Global type definitions
  32. ******************************************************************************/
  33. /**
  34. ******************************************************************************
  35. ** \brief wdt溢出后复位或中断配置
  36. *****************************************************************************/
  37. typedef enum en_wdt_func
  38. {
  39. WdtResetEn = 0, ///<复位使能
  40. WdtIntEn = 1, ///<中断使能
  41. }en_wdt_func_t;
  42. /**
  43. ******************************************************************************
  44. ** \brief wdt当前运行时间配置数据类型定义
  45. *****************************************************************************/
  46. typedef enum en_wdt_time
  47. {
  48. WdtT1ms6 = 0u, ///<1.6ms
  49. WdtT3ms2 = 1u, ///<3.2ms
  50. WdtT6ms4 = 2u, ///<6.4ms
  51. WdtT13ms = 3u, ///<13ms
  52. WdtT26ms = 4u, ///<26ms
  53. WdtT51ms = 5u, ///<51ms
  54. WdtT102ms = 6u, ///<102ms
  55. WdtT205ms = 7u, ///<205ms
  56. WdtT500ms = 8u, ///<500ms
  57. WdtT820ms = 9u, ///<820ms
  58. WdtT1s64 = 10u, ///<1.64s
  59. WdtT3s28 = 11u, ///<3.28s
  60. WdtT6s55 = 12u, ///<6.55s
  61. WdtT13s1 = 13u, ///<13.1s
  62. WdtT26s2 = 14u, ///<26.2s
  63. WdtT52s4 = 15u, ///<52.4s
  64. }en_wdt_time_t;
  65. //wdt初始化
  66. extern void watchdog_init(en_wdt_func_t enFunc,en_wdt_time_t enTime);
  67. extern void feed_dog(void);
  68. //@} // WdtGroup
  69. #ifdef __cplusplus
  70. #endif
  71. #endif /* __WDT_H__ */