Subversion Repositories group.electronics

Rev

Rev 98 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 * atcpad.h
 *
 * Created: 7/06/2013 10:30:25 PM
 *  Author: pfowler
 */ 


#ifndef ATCPAD_H_
#define ATCPAD_H_

// Standard Functions
void setup(void);
void loop();
void millis_tick(void);

// USB Functions
void usbSendHidReport(uchar * data, uchar len);

// Idle rate for USB, not really implemented
static uchar    idleRate;

// Clock Variables
// CLOCK STUFF
// Clk/1 TCCR0B = (1<< CS00);
//20.0Mhz, 1ms = 78ovf
//16.5Mhz, 1ms = 64ovf
//12.0Mhz, 1ms = 46ovf
const uint8_t sys_ovf_tick = 78;
volatile uint8_t tmr0_ovf = 0;
volatile uint32_t systime = 0;

// Keyboard report
 struct {
        uint8_t report_id;
        uint8_t modifier;
        uint8_t keycode;
} reportKeyboard;

// Joystick report
struct {
        uint8_t report_id;
        union {
                uint8_t data1[2];
                struct {
                        uint8_t rx:8;
                        uint8_t ry:8;
                };
        };

        union {
                uint16_t data2;
                struct {
                        uint16_t buttons:12;
                        uint16_t rot1a:1;
                        uint16_t rot1b:1;
                        uint16_t rot2a:1;
                        uint16_t rot2b:1;
                };
        };
} reportJoystick;


#endif /* ATCPAD_H_ */