FSM/FSM_OOP/usr/keyFSM.h

34 lines
391 B
C
Raw Normal View History

2024-01-23 20:05:30 +08:00
#ifndef __KEY_FSM_H_
#define __KEY_FSM_H_
typedef enum _keyIn{
Up,
pDown,
}KeyIn;
typedef enum _keyOutSignal{
Idle,
Down,
Hold,
Down_2times,
Down_3times,
}KeyOutSignal;
2024-01-23 20:05:30 +08:00
typedef struct _keyFSMData
{
int countDelay;
int countMultiDown;
KeyIn in;
KeyOutSignal out;
2024-01-23 20:05:30 +08:00
}KeyFSMData;
typedef struct _KeyFSM KeyFSM;
KeyFSM *createKeyFSM();
#endif