aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/General/buttons.h
blob: adf975979fc44761f1d6a02bcd0ed19b6c73e78d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef BUTTONS_H
#define BUTTONS_H

typedef enum
{
    colorOFF = 0,
    BLUE,
    BLINK,
    fastBILNK,
    BREATHING
} PBcolor;

typedef enum
{
    OFFPB = 0,
    COUNTPB ,
    SHORTPB ,
    LONGPB  ,
    REPLONGPB //repeat long PB
}PBstat;

typedef enum
{
    sttOFF = 0,
    sttON,
    sttDISABLE,
    sttENABLE,
    sttIDLE,
    sttJOGGING,
    sttRDY,
    sttPRELOAD,
    sttLOADING,
    sttLOADSUCSESS,
    sttLOADFAIL
} PBmachinState;

typedef struct Button
{
    char    bttn_name[10];  //option
    int     bttn_status;    // 0=release 1=press
    PBstat  Action;         // enum : offPB,shortPB,longPB,countPB,replongPB
    PBcolor color;          // enum : off, blue, blink, bithing
    PBmachinState state;    // enum : sttOFF, sttON, sttDISABLE, sttENABLE, sttIDLE, sttJOGGING
    uint32_t count;
}button;

extern button power , jog, load;

uint32_t Buttons_Init(void);
uint32_t Button_load_Init(void);
uint32_t Button_JOG_Init(void);

#endif