Hi
I've been trying to add RawHID capability to Teensy 3.0's Serial+Keyboard+Mouse+Joystick mode. I hope to add it in such a way that the RawHID replaces the Mouse and Joystick interfaces. I did take a look at http://forum.pjrc.com/threads/18658-Teensyduino-V1-12-and-custom-USB-types and http://forum.pjrc.com/threads/23803-Teensy-3-0-RAW-HID-Keyboard and followed the steps provided in the first thread. Unfortunately when I set the USB type as Serial+Keyboard+Mouse+Joystick and try to compile code which has RawHID functions I get "'RawHID' was not declared in this scope" as an error message. Also when I try to compile a program which does not have RawHID the following error is shown:
I'm posting the changed portions of usb_desc.h and usb_inst.cpp here:
usb_inst.cpp
I'm using arduino(1.05) on Ubuntu 13.04.
I've been trying to add RawHID capability to Teensy 3.0's Serial+Keyboard+Mouse+Joystick mode. I hope to add it in such a way that the RawHID replaces the Mouse and Joystick interfaces. I did take a look at http://forum.pjrc.com/threads/18658-Teensyduino-V1-12-and-custom-USB-types and http://forum.pjrc.com/threads/23803-Teensy-3-0-RAW-HID-Keyboard and followed the steps provided in the first thread. Unfortunately when I set the USB type as Serial+Keyboard+Mouse+Joystick and try to compile code which has RawHID functions I get "'RawHID' was not declared in this scope" as an error message. Also when I try to compile a program which does not have RawHID the following error is shown:
Code:
arduino-1.0.5/hardware/teensy/cores/teensy3/usb_inst.cpp:18:1: error: 'usb_rawhid_class' does not name a type
I'm posting the changed portions of usb_desc.h and usb_inst.cpp here:
Code:
#elif defined(USB_SERIAL_HID)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x0487
#define RAWHID_USAGE_PAGE 0xFFAB // recommended: 0xFF00 to 0xFFFF
#define RAWHID_USAGE 0x0200 // recommended: 0x0100 to 0xFFFF
#define DEVICE_CLASS 0xEF
#define DEVICE_SUBCLASS 0x02
#define DEVICE_PROTOCOL 0x01
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'S','e','r','i','a','l','/','K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','J','o','y','s','t','i','c','k'}
#define PRODUCT_NAME_LEN 30
#define EP0_SIZE 64
#define NUM_ENDPOINTS 6
#define NUM_USB_BUFFERS 30
#define NUM_INTERFACE 5
#define CDC_IAD_DESCRIPTOR 1
#define CDC_STATUS_INTERFACE 0
#define CDC_DATA_INTERFACE 1 // Serial
#define CDC_ACM_ENDPOINT 2
#define CDC_RX_ENDPOINT 3
#define CDC_TX_ENDPOINT 4
#define CDC_ACM_SIZE 16
#define CDC_RX_SIZE 64
#define CDC_TX_SIZE 64
#define KEYBOARD_INTERFACE 2 // Keyboard
#define KEYBOARD_ENDPOINT 1
#define KEYBOARD_SIZE 8
#define KEYBOARD_INTERVAL 1
#define RAWHID_INTERFACE 0 // RawHID
#define RAWHID_TX_ENDPOINT 5
#define RAWHID_TX_SIZE 64
#define RAWHID_TX_INTERVAL 1
#define RAWHID_RX_ENDPOINT 6
#define RAWHID_RX_SIZE 64
#define RAWHID_RX_INTERVAL 1
#define KEYBOARD_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9)
#define RAWHID_DESC_OFFSET (9 + 9)
#define CONFIG_DESC_SIZE (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9+9+7 + 9+9+7)
#define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT2_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT4_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT5_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_ONLY
usb_inst.cpp
Code:
#ifdef USB_SERIAL_HID
usb_serial_class Serial;
usb_keyboard_class Keyboard;
usb_rawhid_class RawHID;
#endif
I'm using arduino(1.05) on Ubuntu 13.04.