myTim.h 571 B

12345678910111213141516171819202122
  1. #ifndef __MYTIM_H
  2. #define __MYTIM_H
  3. #include "stm32f10x.h"
  4. typedef void (*TIM_CALLBACK)(void);
  5. /**
  6. * tim3定时器初始化
  7. * @period_us:定时器定时周期,以微秒为单位
  8. * @cb:定时器回调函数,定时器计时溢出时调用该函数,
  9. 相当于向外抛出中断,方便主函数调用
  10. */
  11. void myTim3_init(uint32_t period_us, TIM_CALLBACK cb);
  12. /**
  13. * tim1定时器初始化
  14. * @period_us:定时器定时周期,以微秒为单位
  15. * @cb:定时器回调函数,定时器计时溢出时调用该函数,
  16. 相当于向外抛出中断,方便主函数调用
  17. */
  18. void myTim1_init(uint32_t period_us, TIM_CALLBACK cb);
  19. #endif