Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
277 Kevin 1
#ifndef CPS_H
2
#define	CPS_H
3
 
4
// Size of rolling average buffer
5
#define CPS_AVG_COUNT 16
6
 
7
// Number of capacitance button inputs
8
#define CPS_NUM_CHANNELS 2
9
 
10
// Value of capacitance change to register button press
11
#define CPS_PCT_ON 40
12
#define CPS_PCT_OFF 40
13
 
14
typedef struct {
15
    uint8_t channel;
16
    uint8_t channels[CPS_NUM_CHANNELS];
17
    uint8_t btn_pressed[CPS_NUM_CHANNELS];
18
    uint16_t btn_last_value[CPS_NUM_CHANNELS];
19
    uint16_t btn_avg_value[CPS_NUM_CHANNELS];
20
    uint8_t btn_pct_value[CPS_NUM_CHANNELS];
21
} CPS_DATA;
22
 
23
void CPS_Init(CPS_DATA *data);
24
void CPS_Timer_0_Interrupt_Handler(void);
25
void CPS_Reset(void);
26
 
27
void CPS_Enable(void);
28
void CPS_Disable(void);
29
 
30
#endif
31