hal_wdg.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.h
  15. * @brief WDG Driver macros and structures.
  16. *
  17. * @addtogroup WDG
  18. * @{
  19. */
  20. #ifndef HAL_WDG_H
  21. #define HAL_WDG_H
  22. #if (HAL_USE_WDG == TRUE) || defined(__DOXYGEN__)
  23. /*===========================================================================*/
  24. /* Driver constants. */
  25. /*===========================================================================*/
  26. /*===========================================================================*/
  27. /* Driver pre-compile time settings. */
  28. /*===========================================================================*/
  29. /*===========================================================================*/
  30. /* Derived constants and error checks. */
  31. /*===========================================================================*/
  32. /*===========================================================================*/
  33. /* Driver data structures and types. */
  34. /*===========================================================================*/
  35. /**
  36. * @brief Driver state machine possible states.
  37. */
  38. typedef enum {
  39. WDG_UNINIT = 0, /**< Not initialized. */
  40. WDG_STOP = 1, /**< Stopped. */
  41. WDG_READY = 2 /**< Ready. */
  42. } wdgstate_t;
  43. #include "hal_wdg_lld.h"
  44. /*===========================================================================*/
  45. /* Driver macros. */
  46. /*===========================================================================*/
  47. /**
  48. * @brief Resets WDG's counter.
  49. *
  50. * @param[in] wdgp pointer to the @p WDGDriver object
  51. *
  52. * @iclass
  53. */
  54. #define wdgResetI(wdgp) wdg_lld_reset(wdgp)
  55. /*===========================================================================*/
  56. /* External declarations. */
  57. /*===========================================================================*/
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61. void wdgInit(void);
  62. void wdgStart(WDGDriver *wdgp, const WDGConfig * config);
  63. void wdgStop(WDGDriver *wdgp);
  64. void wdgReset(WDGDriver *wdgp);
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* HAL_USE_WDG == TRUE */
  69. #endif /* HAL_WDG_H */
  70. /** @} */