timeout.h 422 B

12345678910111213141516171819
  1. #ifndef _TIMEOUT_H_
  2. #define _TIMEOUT_H_
  3. #include "../User/gd32f10x_it.h"
  4. typedef struct
  5. {
  6. uint8_t flag;
  7. uint8_t endMode; // 1:start 2: endNormal
  8. uint32_t counter;
  9. uint32_t timeout;
  10. }__attribute__((packed)) timeout_t;
  11. extern void timeout_setValue(timeout_t *tt,uint32_t val);
  12. extern void timeout_start(timeout_t *tt);
  13. extern void timeout_stop(timeout_t *tt);
  14. extern uint8_t timeout_isOut(timeout_t *tt);
  15. #endif