stm8l15x_rst.h 3.1 KB

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