Hi community,
i would like to edit the required files to add a keyboard only and a mouse only mode for my Teensy 3.1 in my Arduino IDE.
So i would add something like this to usb_desc.h:
This part is what i do not understand at all:
And something like this to boards.txt:
usb_inst.cpp
I assume this won't be all i need to do and some of this might be incorrect because i am just a hobby developer with little skill but maybe someone might be able to help me out.
My goal is to speed up the driver installtion process on Windows (and i also might learn something from this which is nice).
Thanks in advance
Pascal
i would like to edit the required files to add a keyboard only and a mouse only mode for my Teensy 3.1 in my Arduino IDE.
So i would add something like this to usb_desc.h:
Code:
#elif defined(USB_KEYBOARD)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x0482
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'K','e','y','b','o','a','r','d'}
#define PRODUCT_NAME_LEN 8
#define EP0_SIZE 64
#define NUM_ENDPOINTS 2
#define NUM_USB_BUFFERS 24
#define NUM_INTERFACE 4
#define SEREMU_INTERFACE 1 // Serial emulation
#define SEREMU_TX_ENDPOINT 1
#define SEREMU_TX_SIZE 64
#define SEREMU_TX_INTERVAL 1
#define SEREMU_RX_ENDPOINT 2
#define SEREMU_RX_SIZE 32
#define SEREMU_RX_INTERVAL 2
#define KEYBOARD_INTERFACE 0 // Keyboard
#define KEYBOARD_ENDPOINT 3
#define KEYBOARD_SIZE 8
#define KEYBOARD_INTERVAL 1
#define KEYBOARD_DESC_OFFSET (9 + 9)
#define SEREMU_DESC_OFFSET (9 + 9+9+7 + 9+9+7 + 9)
#define CONFIG_DESC_SIZE (9 + 9+9+7 + 9+9+7 + 9+9+7+7 + 9+9+7)
Code:
#define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_ONLY
And something like this to boards.txt:
Code:
teensy31.menu.usb.keyboard.name=Keyboard + Mouse + Joystick
teensy31.menu.usb.hid.keyboard.define0=-DUSB_KEYBOARD
usb_inst.cpp
Code:
#ifdef USB_HID
usb_keyboard_class Keyboard;
usb_seremu_class Serial;
#endif
I assume this won't be all i need to do and some of this might be incorrect because i am just a hobby developer with little skill but maybe someone might be able to help me out.
My goal is to speed up the driver installtion process on Windows (and i also might learn something from this which is nice).
Thanks in advance
Pascal
Last edited: