timonemycat
New member
Hey PRJC,
I'm using teensy 3.2 to create a joystick, and have a need to remove all unused axes and buttons/switches from what appears when connected through USB. I've been following along with what Kenton was doing on his blog (https://hamaluik.com/posts/making-a-custom-teensy3-hid-joystick/), but I loose him somewhere in that process, and would like to try just modifying the bare minimums.
I started off doing exactly the same things he did, and couldn't get my code to compile. I started backtracking to just things that I'd need, and am at the stage where I'd like to be able to figure out where the structure of the usb descriptor file packet is made. I'm just trying to change the descriptor file for the joystick so that there are 3 axes, and 4 buttons total. The files I'm modifying are usb_desc.h and usb_desc.c.
static uint8_t joystick_report_desc[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x04, // USAGE (Joystick)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x04, // USAGE (Joystick)
0xa1, 0x00, // COLLECTION (Physical)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x32, // USAGE (Z)
0x75, 0x06, // REPORT_SIZE (6)
0x95, 0x03, // REPORT_COUNT (3)
0x45, 0x7f, // PHYSICAL_MAXIMUM (127)
0x35, 0x81, // PHYSICAL_MINIMUM (-127)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x04, // USAGE_MAXIMUM (Button 4)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x04, // REPORT_COUNT (4)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION
0xc0 // END_COLLECTION
};
I know that this isn't the only area that needs to change, and I was wondering if anybody has any further resources on this?
Thanks a bunch!
I'm using teensy 3.2 to create a joystick, and have a need to remove all unused axes and buttons/switches from what appears when connected through USB. I've been following along with what Kenton was doing on his blog (https://hamaluik.com/posts/making-a-custom-teensy3-hid-joystick/), but I loose him somewhere in that process, and would like to try just modifying the bare minimums.
I started off doing exactly the same things he did, and couldn't get my code to compile. I started backtracking to just things that I'd need, and am at the stage where I'd like to be able to figure out where the structure of the usb descriptor file packet is made. I'm just trying to change the descriptor file for the joystick so that there are 3 axes, and 4 buttons total. The files I'm modifying are usb_desc.h and usb_desc.c.
static uint8_t joystick_report_desc[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x04, // USAGE (Joystick)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x04, // USAGE (Joystick)
0xa1, 0x00, // COLLECTION (Physical)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x09, 0x32, // USAGE (Z)
0x75, 0x06, // REPORT_SIZE (6)
0x95, 0x03, // REPORT_COUNT (3)
0x45, 0x7f, // PHYSICAL_MAXIMUM (127)
0x35, 0x81, // PHYSICAL_MINIMUM (-127)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x04, // USAGE_MAXIMUM (Button 4)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x04, // REPORT_COUNT (4)
0x81, 0x02, // INPUT (Data,Var,Abs)
0xc0, // END_COLLECTION
0xc0 // END_COLLECTION
};
I know that this isn't the only area that needs to change, and I was wondering if anybody has any further resources on this?
Thanks a bunch!