aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/General/buttons.h
blob: d0cea022c921cdd6a7c55132d472acd686ff7bbe (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
    /* enum */ PBstat Action;   //offPB,shortPB,longPB,countPB,replongPB
    /* enum */ PBcolor color;   //off, blue, blink, bithing
    /* enum */ PBmachinState state; //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