stm32f10x_iwdg.h
上传用户:yj_qqy
上传日期:2017-01-28
资源大小:2911k
文件大小:3k
源码类别:

uCOS

开发平台:

C/C++

  1. /******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
  2. * File Name          : stm32f10x_iwdg.h
  3. * Author             : MCD Application Team
  4. * Version            : V2.0.2
  5. * Date               : 07/11/2008
  6. * Description        : This file contains all the functions prototypes for the
  7. *                      IWDG firmware library.
  8. ********************************************************************************
  9. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  10. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
  11. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  12. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
  13. * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
  14. * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  15. *******************************************************************************/
  16. /* Define to prevent recursive inclusion -------------------------------------*/
  17. #ifndef __STM32F10x_IWDG_H
  18. #define __STM32F10x_IWDG_H
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "stm32f10x_map.h"
  21. /* Exported types ------------------------------------------------------------*/
  22. /* Exported constants --------------------------------------------------------*/
  23. /* Write access to IWDG_PR and IWDG_RLR registers */
  24. #define IWDG_WriteAccess_Enable     ((u16)0x5555)
  25. #define IWDG_WriteAccess_Disable    ((u16)0x0000)
  26. #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || 
  27.                                       ((ACCESS) == IWDG_WriteAccess_Disable))
  28. /* IWDG prescaler */
  29. #define IWDG_Prescaler_4            ((u8)0x00)
  30. #define IWDG_Prescaler_8            ((u8)0x01)
  31. #define IWDG_Prescaler_16           ((u8)0x02)
  32. #define IWDG_Prescaler_32           ((u8)0x03)
  33. #define IWDG_Prescaler_64           ((u8)0x04)
  34. #define IWDG_Prescaler_128          ((u8)0x05)
  35. #define IWDG_Prescaler_256          ((u8)0x06)
  36. #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4)  || 
  37.                                       ((PRESCALER) == IWDG_Prescaler_8)  || 
  38.                                       ((PRESCALER) == IWDG_Prescaler_16) || 
  39.                                       ((PRESCALER) == IWDG_Prescaler_32) || 
  40.                                       ((PRESCALER) == IWDG_Prescaler_64) || 
  41.                                       ((PRESCALER) == IWDG_Prescaler_128)|| 
  42.                                       ((PRESCALER) == IWDG_Prescaler_256))
  43. /* IWDG Flag */
  44. #define IWDG_FLAG_PVU               ((u16)0x0001)
  45. #define IWDG_FLAG_RVU               ((u16)0x0002)
  46. #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU))
  47. #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF)
  48. /* Exported macro ------------------------------------------------------------*/
  49. /* Exported functions ------------------------------------------------------- */
  50. void IWDG_WriteAccessCmd(u16 IWDG_WriteAccess);
  51. void IWDG_SetPrescaler(u8 IWDG_Prescaler);
  52. void IWDG_SetReload(u16 Reload);
  53. void IWDG_ReloadCounter(void);
  54. void IWDG_Enable(void);
  55. FlagStatus IWDG_GetFlagStatus(u16 IWDG_FLAG);
  56. #endif /* __STM32F10x_IWDG_H */
  57. /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/