hal_wdg_lld.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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_wdg_lld.h
  15. * @brief WDG Driver subsystem low level driver header template.
  16. *
  17. * @addtogroup WDG
  18. * @{
  19. */
  20. #ifndef HAL_WDG_LLD_H
  21. #define HAL_WDG_LLD_H
  22. #if (HAL_USE_WDG == TRUE) || defined(__DOXYGEN__)
  23. /*===========================================================================*/
  24. /* Driver constants. */
  25. /*===========================================================================*/
  26. /*===========================================================================*/
  27. /* Driver pre-compile time settings. */
  28. /*===========================================================================*/
  29. /**
  30. * @name Configuration options
  31. * @{
  32. */
  33. /**
  34. * @brief WDG1 driver enable switch.
  35. * @note The default is @p FALSE.
  36. */
  37. #if !defined(PLATFORM_WDG_USE_WDG1) || defined(__DOXYGEN__)
  38. #define PLATFORM_WDG_USE_WDG1 FALSE
  39. #endif
  40. /** @} */
  41. /*===========================================================================*/
  42. /* Derived constants and error checks. */
  43. /*===========================================================================*/
  44. /*===========================================================================*/
  45. /* Driver data structures and types. */
  46. /*===========================================================================*/
  47. /**
  48. * @brief Type of a structure representing an WDG driver.
  49. */
  50. typedef struct WDGDriver WDGDriver;
  51. /**
  52. * @brief Driver configuration structure.
  53. * @note It could be empty on some architectures.
  54. */
  55. typedef struct {
  56. } WDGConfig;
  57. /**
  58. * @brief Structure representing an WDG driver.
  59. */
  60. struct WDGDriver {
  61. /**
  62. * @brief Driver state.
  63. */
  64. wdgstate_t state;
  65. /**
  66. * @brief Current configuration data.
  67. */
  68. const WDGConfig *config;
  69. /* End of the mandatory fields.*/
  70. };
  71. /*===========================================================================*/
  72. /* Driver macros. */
  73. /*===========================================================================*/
  74. /*===========================================================================*/
  75. /* External declarations. */
  76. /*===========================================================================*/
  77. #if (PLATFORM_WDG_USE_WDG1 == TRUE) && !defined(__DOXYGEN__)
  78. extern WDGDriver WDGD1;
  79. #endif
  80. #ifdef __cplusplus
  81. extern "C" {
  82. #endif
  83. void wdg_lld_init(void);
  84. void wdg_lld_start(WDGDriver *wdgp);
  85. void wdg_lld_stop(WDGDriver *wdgp);
  86. void wdg_lld_reset(WDGDriver *wdgp);
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif /* HAL_USE_WDG == TRUE */
  91. #endif /* HAL_WDG_LLD_H */
  92. /** @} */