Subversion Repositories group.electronics

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
117 pfowler 1
/*
2
 * atcpad.h
3
 *
4
 * Created: 7/06/2013 10:30:25 PM
5
 *  Author: pfowler
6
 */ 
7
 
8
 
9
#ifndef ATCPAD_H_
10
#define ATCPAD_H_
11
 
12
// Standard Functions
13
void setup(void);
14
void loop();
15
void millis_tick(void);
16
 
17
// USB Functions
18
void usbSendHidReport(uchar * data, uchar len);
19
 
20
// Idle rate for USB, not really implemented
21
static uchar    idleRate;
22
 
23
// Clock Variables
24
// CLOCK STUFF
25
// Clk/1 TCCR0B = (1<< CS00);
26
//20.0Mhz, 1ms = 78ovf
27
//16.5Mhz, 1ms = 64ovf
28
//12.0Mhz, 1ms = 46ovf
29
const uint8_t sys_ovf_tick = 78;
30
volatile uint8_t tmr0_ovf = 0;
31
volatile uint32_t systime = 0;
32
 
33
// Keyboard report
34
 struct {
35
	uint8_t report_id;
36
	uint8_t modifier;
37
	uint8_t keycode;
38
} reportKeyboard;
39
 
40
// Joystick report
41
struct {
42
	uint8_t report_id;
43
	union {
44
		uint8_t data1[2];
45
		struct {
46
			uint8_t rx:8;
47
			uint8_t ry:8;
48
		};
49
	};
50
 
51
	union {
52
		uint16_t data2;
53
		struct {
54
			uint16_t buttons:12;
55
			uint16_t rot1a:1;
56
			uint16_t rot1b:1;
57
			uint16_t rot2a:1;
58
			uint16_t rot2b:1;
59
		};
60
	};
61
} reportJoystick;
62
 
63
 
64
#endif /* ATCPAD_H_ */