123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- #ifndef HAL_GPT_H
- #define HAL_GPT_H
- #if (HAL_USE_GPT == TRUE) || defined(__DOXYGEN__)
- typedef enum {
- GPT_UNINIT = 0,
- GPT_STOP = 1,
- GPT_READY = 2,
- GPT_CONTINUOUS = 3,
- GPT_ONESHOT = 4
- } gptstate_t;
- typedef struct GPTDriver GPTDriver;
- typedef void (*gptcallback_t)(GPTDriver *gptp);
- #include "hal_gpt_lld.h"
- #define gptChangeIntervalI(gptp, interval) { \
- gpt_lld_change_interval(gptp, interval); \
- }
- #define gptGetIntervalX(gptp) gpt_lld_get_interval(gptp)
- #define gptGetCounterX(gptp) gpt_lld_get_counter(gptp)
- #ifdef __cplusplus
- extern "C" {
- #endif
- void gptInit(void);
- void gptObjectInit(GPTDriver *gptp);
- void gptStart(GPTDriver *gptp, const GPTConfig *config);
- void gptStop(GPTDriver *gptp);
- void gptStartContinuous(GPTDriver *gptp, gptcnt_t interval);
- void gptStartContinuousI(GPTDriver *gptp, gptcnt_t interval);
- void gptChangeInterval(GPTDriver *gptp, gptcnt_t interval);
- void gptStartOneShot(GPTDriver *gptp, gptcnt_t interval);
- void gptStartOneShotI(GPTDriver *gptp, gptcnt_t interval);
- void gptStopTimer(GPTDriver *gptp);
- void gptStopTimerI(GPTDriver *gptp);
- void gptPolledDelay(GPTDriver *gptp, gptcnt_t interval);
- #ifdef __cplusplus
- }
- #endif
- #endif
- #endif
|