2007-03-24 22:59:30 -04:00
|
|
|
#ifndef _gamepad_h__
|
|
|
|
#define _gamepad_h__
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
// size of reports built by buildReport
|
2007-04-18 19:58:01 -04:00
|
|
|
char num_reports;
|
2007-03-24 22:59:30 -04:00
|
|
|
|
|
|
|
int reportDescriptorSize;
|
|
|
|
void *reportDescriptor; // must be in flash
|
|
|
|
|
|
|
|
int deviceDescriptorSize; // if 0, use default
|
|
|
|
void *deviceDescriptor; // must be in flash
|
|
|
|
|
|
|
|
void (*init)(void);
|
|
|
|
void (*update)(void);
|
2007-04-18 19:58:01 -04:00
|
|
|
|
|
|
|
char (*changed)(char id);
|
|
|
|
/**
|
|
|
|
* \param id Controller id (starting at 1 to match report IDs)
|
|
|
|
* \return The number of bytes written to buf.
|
|
|
|
* */
|
|
|
|
char (*buildReport)(unsigned char *buf, char id);
|
2007-03-24 22:59:30 -04:00
|
|
|
} Gamepad;
|
|
|
|
|
|
|
|
#endif // _gamepad_h__
|
|
|
|
|
|
|
|
|