repo2/firmware_eclairexl/usb/hidparser.h
269 | markw | #ifndef HIDPARSER_H
|
|
#define HIDPARSER_H
|
|||
270 | markw | #include <common/integer.h>
|
|
269 | markw | #define CONFIG_TYPE_NONE 0
|
|
#define CONFIG_TYPE_MOUSE 1
|
|||
#define CONFIG_TYPE_KEYBOARD 2
|
|||
#define CONFIG_TYPE_JOYSTICK 3
|
|||
// currently only joysticks are supported
|
|||
typedef struct {
|
|||
uint8_t type: 2; // CONFIG_TYPE_...
|
|||
uint8_t report_id;
|
|||
uint8_t report_size;
|
|||
union {
|
|||
struct {
|
|||
struct {
|
|||
uint8_t byte_offset;
|
|||
uint8_t size; // 8 or 16 bits supported
|
|||
struct {
|
|||
275 | markw | /* uint8_t minl;
|
|
uint8_t minh;
|
|||
uint8_t maxl;
|
|||
uint8_t maxh;*/
|
|||
269 | markw | uint16_t min;
|
|
uint16_t max;
|
|||
} logical;
|
|||
} axis[2]; // x and y axis
|
|||
struct {
|
|||
uint8_t byte_offset;
|
|||
uint8_t bitmask;
|
|||
275 | markw | } button[24]; // 24 buttons
|
|
269 | markw | } joystick;
|
|
};
|
|||
} hid_config_t;
|
|||
bool parse_report_descriptor(uint8_t *rep, uint16_t rep_size, hid_config_t *conf);
|
|||
#endif // HIDPARSER_H
|