MSP库函数学习笔记-WDT_A

WDT定时器使能相关

extern void WDT_A_initIntervalTimer(uint_fast8_t clockSelect,uint_fast8_t clockDivider);
//关闭看门狗定时器

extern void WDT_A_startTimer(void);
//开启看门狗定时器

extern void WDT_A_clearTimer(void);
//清除看门狗计数器值

WDT模式设置

WDT定时器分为看门狗定时器和间隔定时器

 看门狗定时器当密码写入错误或者时间间隔过期后会触发系统重置

间隔定时器每个时间间隔结束后会进入中断

extern void WDT_A_initWatchdogTimer(uint_fast8_t clockSelect,uint_fast8_t clockDivider);
//初始化看门狗定时器

//! \param clockSelect is the clock source that the watchdog timer will use.
//!        Valid values are
//!        - \b WDT_A_CLOCKSOURCE_SMCLK [Default]
//!        - \b WDT_A_CLOCKSOURCE_ACLK
//!        - \b WDT_A_CLOCKSOURCE_VLOCLK
//!        - \b WDT_A_CLOCKSOURCE_BCLK
//! \param clockIterations is the number of clock iterations for a watchdog
//!         timeout.
//!        Valid values are
//!        - \b WDT_A_CLOCKITERATIONS_2G [Default]
//!        - \b WDT_A_CLOCKITERATIONS_128M
//!        - \b WDT_A_CLOCKITERATIONS_8192K
//!        - \b WDT_A_CLOCKITERATIONS_512K
//!        - \b WDT_A_CLOCKITERATIONS_32K
//!        - \b WDT_A_CLOCKITERATIONS_8192
//!        - \b WDT_A_CLOCKITERATIONS_512
//!        - \b WDT_A_CLOCKITERATIONS_64


extern void WDT_A_initIntervalTimer(uint_fast8_t clockSelect,uint_fast8_t clockDivider);
//间隔定时器模式初始化

//! \param clockSelect is the clock source that the watchdog timer will use.
//!        Valid values are
//!        - \b WDT_A_CLOCKSOURCE_SMCLK [Default]
//!        - \b WDT_A_CLOCKSOURCE_ACLK
//!        - \b WDT_A_CLOCKSOURCE_VLOCLK
//!        - \b WDT_A_CLOCKSOURCE_BCLK
//! \param clockIterations is the number of clock iterations for a watchdog
//!         interval.
//!        Valid values are
//!        - \b WDT_A_CLOCKITERATIONS_2G [Default]
//!        - \b WDT_A_CLOCKITERATIONS_128M
//!        - \b WDT_A_CLOCKITERATIONS_8192K
//!        - \b WDT_A_CLOCKITERATIONS_512K
//!        - \b WDT_A_CLOCKITERATIONS_32K
//!        - \b WDT_A_CLOCKITERATIONS_8192
//!        - \b WDT_A_CLOCKITERATIONS_512
//!        - \b WDT_A_CLOCKITERATIONS_64

中断处理函数 

extern void WDT_A_registerInterrupt(void (*intHandler)(void));
//注册中断处理函数

extern void WDT_A_unregisterInterrupt(void);
//注销中断处理函数

选择看门狗重置类型 

extern void WDT_A_setPasswordViolationReset(uint_fast8_t resetType);
//设置看门狗密码错误时的重置类型

//! \param resetType The type of reset to set
//!
//! The \e resetType parameter must be only one of the following values:
//!     - \b WDT_A_HARD_RESET
//!     - \b WDT_A_SOFT_RESET

extern void WDT_A_setTimeoutReset(uint_fast8_t resetType);
//设置看门狗超时时发生的RESET类型

//! \param resetType The type of reset to set
//!
//! The \e resetType parameter must be only one of the following values:
//!     - \b WDT_A_HARD_RESET
//!     - \b WDT_A_SOFT_RESET
//!
//! \return None.
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值