stm8s_rst.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. ******************************************************************************
  3. * @file stm8s_rst.h
  4. * @author MCD Application Team
  5. * @version V2.3.0
  6. * @date 16-June-2017
  7. * @brief This file contains all functions prototype and macros for the RST peripheral.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  12. *
  13. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  14. * You may not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at:
  16. *
  17. * http://www.st.com/software_license_agreement_liberty_v2
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an "AS IS" BASIS,
  21. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. *
  25. ******************************************************************************
  26. */
  27. /* Define to prevent recursive inclusion -------------------------------------*/
  28. #ifndef __STM8S_RST_H
  29. #define __STM8S_RST_H
  30. /* Includes ------------------------------------------------------------------*/
  31. #include "stm8s.h"
  32. /** @addtogroup STM8S_StdPeriph_Driver
  33. * @{
  34. */
  35. /** @addtogroup RST_Exported_Types
  36. * @{
  37. */
  38. typedef enum {
  39. RST_FLAG_EMCF = (uint8_t)0x10, /*!< EMC reset flag */
  40. RST_FLAG_SWIMF = (uint8_t)0x08, /*!< SWIM reset flag */
  41. RST_FLAG_ILLOPF = (uint8_t)0x04, /*!< Illigal opcode reset flag */
  42. RST_FLAG_IWDGF = (uint8_t)0x02, /*!< Independent watchdog reset flag */
  43. RST_FLAG_WWDGF = (uint8_t)0x01 /*!< Window watchdog reset flag */
  44. }RST_Flag_TypeDef;
  45. /**
  46. * @}
  47. */
  48. /* Exported constants --------------------------------------------------------*/
  49. /* Exported macros -----------------------------------------------------------*/
  50. /** @addtogroup RST_Private_Macros
  51. * @{
  52. */
  53. /**
  54. * @brief Macro used by the assert function to check the different functions parameters.
  55. */
  56. /**
  57. * @brief Macro used by the assert function to check the different RST flags.
  58. */
  59. #define IS_RST_FLAG_OK(FLAG) (((FLAG) == RST_FLAG_EMCF) || \
  60. ((FLAG) == RST_FLAG_SWIMF) ||\
  61. ((FLAG) == RST_FLAG_ILLOPF) ||\
  62. ((FLAG) == RST_FLAG_IWDGF) ||\
  63. ((FLAG) == RST_FLAG_WWDGF))
  64. /**
  65. * @}
  66. */
  67. /** @addtogroup RST_Exported_functions
  68. * @{
  69. */
  70. FlagStatus RST_GetFlagStatus(RST_Flag_TypeDef RST_Flag);
  71. void RST_ClearFlag(RST_Flag_TypeDef RST_Flag);
  72. /**
  73. * @}
  74. */
  75. #endif /* __STM8S_RST_H */
  76. /**
  77. * @}
  78. */
  79. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/