你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

【经验分享】STM32 窗口看门狗相关类型和函数

[复制链接]
STMCU小助手 发布时间:2022-4-1 15:18
01. WWDG概述
stm32f4xx_wwdg.h和 stm32f4xx_wwdg.c文件中。

02. 相关类型
WWDG_Prescaler

  1. /** @defgroup WWDG_Prescaler
  2.   * @{
  3.   */

  4. #define WWDG_Prescaler_1    ((uint32_t)0x00000000)
  5. #define WWDG_Prescaler_2    ((uint32_t)0x00000080)
  6. #define WWDG_Prescaler_4    ((uint32_t)0x00000100)
  7. #define WWDG_Prescaler_8    ((uint32_t)0x00000180)
  8. #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \
  9.                                       ((PRESCALER) == WWDG_Prescaler_2) || \
  10.                                       ((PRESCALER) == WWDG_Prescaler_4) || \
  11.                                       ((PRESCALER) == WWDG_Prescaler_8))
  12. #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F)
  13. #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F))
复制代码

中断处理函数

  1.   WWDG_IRQn                   = 0,      /*!< Window WatchDog Interrupt*/
复制代码

03. 相关函数
  1. /*  Function used to set the WWDG configuration to the default reset state ****/  
  2. void WWDG_DeInit(void);

  3. /* Prescaler, Refresh window and Counter configuration functions **************/
  4. void WWDG_SetPrescaler(uint32_t WWDG_Prescaler);
  5. void WWDG_SetWindowValue(uint8_t WindowValue);
  6. void WWDG_EnableIT(void);
  7. void WWDG_SetCounter(uint8_t Counter);

  8. /* WWDG activation function ***************************************************/
  9. void WWDG_Enable(uint8_t Counter);

  10. /* Interrupts and flags management functions **********************************/
  11. FlagStatus WWDG_GetFlagStatus(void);
  12. void WWDG_ClearFlag(void);
复制代码

04. 结构体封装
  1. /**
  2.   * @brief Window WATCHDOG
  3.   */

  4. typedef struct
  5. {
  6.   __IO uint32_t CR;   /*!< WWDG Control register,       Address offset: 0x00 */
  7.   __IO uint32_t CFR;  /*!< WWDG Configuration register, Address offset: 0x04 */
  8.   __IO uint32_t SR;   /*!< WWDG Status register,        Address offset: 0x08 */
  9. } WWDG_TypeDef;
复制代码


收藏 评论0 发布时间:2022-4-1 15:18

举报

0个回答

所属标签

相似分享

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版