Subversion Repositories Code-Repo

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
200 Kevin 1
#ifndef BTN_H
2
#define	BTN_H
3
 
4
// BTN1 = CN8, BTN2 = CN9, BTN3 = CN19
5
// BTN1 = RG6, BTN2 = RG7, BTN3 = RD13
6
// Note: Write to PORTx is effectively the same as write to LATx
7
#define BTN1_TRIS TRISGbits.TRISG6
8
#define BTN1_PORT PORTGbits.RG6
9
#define BTN2_TRIS TRISGbits.TRISG7
10
#define BTN2_PORT PORTGbits.RG7
11
#define BTN3_TRIS TRISDbits.TRISD13
12
#define BTN3_PORT PORTDbits.RD13
13
 
14
#define BTN_DEBOUNCE_MS 1
15
 
201 Kevin 16
typedef struct {
17
    void (*callback_function_1)(void);
18
    void (*callback_function_2)(void);
19
    void (*callback_function_3)(void);
20
} BTN_DATA;
200 Kevin 21
 
201 Kevin 22
void BTN_Init(BTN_DATA *data, void (*callback_1)(void), void (*callback_2)(void), void (*callback_3)(void));
23
 
200 Kevin 24
#endif	/* BTN_H */
25