Subversion Repositories Code-Repo

Rev

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

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