n32g45x_wwdg.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*****************************************************************************
  2. * Copyright (c) 2019, Nations Technologies Inc.
  3. *
  4. * All rights reserved.
  5. * ****************************************************************************
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions are met:
  9. *
  10. * - Redistributions of source code must retain the above copyright notice,
  11. * this list of conditions and the disclaimer below.
  12. *
  13. * Nations' name may not be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. *
  16. * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY NATIONS "AS IS" AND ANY EXPRESS OR
  17. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  19. * DISCLAIMED. IN NO EVENT SHALL NATIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
  20. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  21. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  22. * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  23. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  25. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. * ****************************************************************************/
  27. /**
  28. * @file n32g45x_wwdg.h
  29. * @author Nations
  30. * @version v1.0.0
  31. *
  32. * @copyright Copyright (c) 2019, Nations Technologies Inc. All rights reserved.
  33. */
  34. #ifndef __N32G45X_WWDG_H__
  35. #define __N32G45X_WWDG_H__
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. #include "n32g45x.h"
  40. /** @addtogroup N32G45X_StdPeriph_Driver
  41. * @{
  42. */
  43. /** @addtogroup WWDG
  44. * @{
  45. */
  46. /** @addtogroup WWDG_Exported_Types
  47. * @{
  48. */
  49. /**
  50. * @}
  51. */
  52. /** @addtogroup WWDG_Exported_Constants
  53. * @{
  54. */
  55. /** @addtogroup WWDG_Prescaler
  56. * @{
  57. */
  58. #define WWDG_PRESCALER_DIV1 ((uint32_t)0x00000000)
  59. #define WWDG_PRESCALER_DIV2 ((uint32_t)0x00000080)
  60. #define WWDG_PRESCALER_DIV4 ((uint32_t)0x00000100)
  61. #define WWDG_PRESCALER_DIV8 ((uint32_t)0x00000180)
  62. #define IS_WWDG_PRESCALER_DIV(PRESCALER) \
  63. (((PRESCALER) == WWDG_PRESCALER_DIV1) || ((PRESCALER) == WWDG_PRESCALER_DIV2) \
  64. || ((PRESCALER) == WWDG_PRESCALER_DIV4) || ((PRESCALER) == WWDG_PRESCALER_DIV8))
  65. #define IS_WWDG_WVALUE(VALUE) ((VALUE) <= 0x7F)
  66. #define IS_WWDG_CNT(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
  67. /**
  68. * @}
  69. */
  70. /**
  71. * @}
  72. */
  73. /** @addtogroup WWDG_Exported_Macros
  74. * @{
  75. */
  76. /**
  77. * @}
  78. */
  79. /** @addtogroup WWDG_Exported_Functions
  80. * @{
  81. */
  82. void WWDG_DeInit(void);
  83. void WWDG_SetPrescalerDiv(uint32_t WWDG_Prescaler);
  84. void WWDG_SetWValue(uint8_t WindowValue);
  85. void WWDG_EnableInt(void);
  86. void WWDG_SetCnt(uint8_t Counter);
  87. void WWDG_Enable(uint8_t Counter);
  88. FlagStatus WWDG_GetEWINTF(void);
  89. void WWDG_ClrEWINTF(void);
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93. #endif /* __N32G45X__WWDG_H */
  94. /**
  95. * @}
  96. */
  97. /**
  98. * @}
  99. */
  100. /**
  101. * @}
  102. */