STM8S/A Standard Peripherals Drivers: stm8s_rst.c Source File

STM8S/A

stm8s_rst.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm8s_rst.c
00004   * @author  MCD Application Team
00005   * @version V2.3.0
00006   * @date    16-June-2017
00007   * @brief   This file contains all the functions for the RST peripheral.
00008    ******************************************************************************
00009   * @attention
00010   *
00011   * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
00012   *
00013   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
00014   * You may not use this file except in compliance with the License.
00015   * You may obtain a copy of the License at:
00016   *
00017   *        http://www.st.com/software_license_agreement_liberty_v2
00018   *
00019   * Unless required by applicable law or agreed to in writing, software 
00020   * distributed under the License is distributed on an "AS IS" BASIS, 
00021   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00022   * See the License for the specific language governing permissions and
00023   * limitations under the License.
00024   *
00025   ******************************************************************************
00026   */
00027 
00028 /* Includes ------------------------------------------------------------------*/
00029 
00030 #include "stm8s_rst.h"
00031 
00032 /** @addtogroup STM8S_StdPeriph_Driver
00033   * @{
00034   */
00035 /* Private typedef -----------------------------------------------------------*/
00036 /* Private define ------------------------------------------------------------*/
00037 /* Private macro -------------------------------------------------------------*/
00038 /* Private variables ---------------------------------------------------------*/
00039 /* Private function prototypes -----------------------------------------------*/
00040 /* Private Constants ---------------------------------------------------------*/
00041 /* Public functions ----------------------------------------------------------*/
00042 /**
00043   * @addtogroup RST_Public_Functions
00044   * @{
00045   */
00046 
00047 
00048 /**
00049   * @brief   Checks whether the specified RST flag is set or not.
00050   * @param   RST_Flag : specify the reset flag to check.
00051   *          This parameter can be a value of @ref RST_Flag_TypeDef.
00052   * @retval  FlagStatus: status of the given RST flag.
00053   */
00054 FlagStatus RST_GetFlagStatus(RST_Flag_TypeDef RST_Flag)
00055 {
00056   /* Check the parameters */
00057   assert_param(IS_RST_FLAG_OK(RST_Flag));
00058   
00059   /* Get flag status */
00060   return((FlagStatus)(((uint8_t)(RST->SR & RST_Flag) == (uint8_t)0x00) ? RESET : SET));
00061 }
00062 
00063 /**
00064   * @brief  Clears the specified RST flag.
00065   * @param  RST_Flag : specify the reset flag to clear.
00066   *         This parameter can be a value of @ref RST_Flag_TypeDef.
00067   * @retval None
00068   */
00069 void RST_ClearFlag(RST_Flag_TypeDef RST_Flag)
00070 {
00071   /* Check the parameters */
00072   assert_param(IS_RST_FLAG_OK(RST_Flag));
00073   
00074   RST->SR = (uint8_t)RST_Flag;
00075 }
00076 
00077 /**
00078   * @}
00079   */
00080   
00081 /**
00082   * @}
00083   */
00084   
00085 
00086 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com