#Include "stm8s - RST.H"
#Include "stm8s - RST.H"
#Include "stm8s - RST.H"
2 ******************************************************************************
3 * @file stm8s_rst.c
4 * @author MCD Application Team
5 * @version V2.3.0
6 * @date 16-June-2017
7 * @brief This file contains all the functions for the RST peripheral.
8 ******************************************************************************
9 * @attention
10 *
11 * <h2><center>© 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
28 /* Includes ------------------------------------------------------------------*/
29
30 #include "stm8s_rst.h"
31
32 /** @addtogroup STM8S_StdPeriph_Driver
33 * @{
34 */
35 /* Private typedef -----------------------------------------------------------*/
36 /* Private define ------------------------------------------------------------*/
37 /* Private macro -------------------------------------------------------------*/
38 /* Private variables ---------------------------------------------------------*/
39 /* Private function prototypes -----------------------------------------------*/
40 /* Private Constants ---------------------------------------------------------*/
41 /* Public functions ----------------------------------------------------------*/
42 /**
43 * @addtogroup RST_Public_Functions
44 * @{
45 */
46
47
48 /**
49 * @brief Checks whether the specified RST flag is set or not.
50 * @param RST_Flag : specify the reset flag to check.
51 * This parameter can be a value of @ref RST_Flag_TypeDef.
52 * @retval FlagStatus: status of the given RST flag.
53 */
54 FlagStatus RST_GetFlagStatus(RST_Flag_TypeDef RST_Flag)
55 {
56 /* Check the parameters */
57 assert_param(IS_RST_FLAG_OK(RST_Flag));
58
59 /* Get flag status */
60 return((FlagStatus)(((uint8_t)(RST->SR & RST_Flag) == (uint8_t)0x00) ? RESET : SET
));
61 }
62
63 /**
64 * @brief Clears the specified RST flag.
65 * @param RST_Flag : specify the reset flag to clear.
66 * This parameter can be a value of @ref RST_Flag_TypeDef.
67 * @retval None
68 */
69 void RST_ClearFlag(RST_Flag_TypeDef RST_Flag)
70 {
71 /* Check the parameters */
72 assert_param(IS_RST_FLAG_OK(RST_Flag));
73
74 RST->SR = (uint8_t)RST_Flag;
75 }
76
77 /**
78 * @}
79 */
80
81 /**
82 * @}
83 */
84
85
86 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
87