|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- #ifndef usb_serial_h__
- #define usb_serial_h__
-
- #include <stdint.h>
-
- #ifdef __cplusplus
- extern "C"{
- #endif
-
-
-
-
-
- #define STR_MANUFACTURER L"Teensyduino"
- #define STR_PRODUCT L"Serial+Keyboard+Mouse+Joystick"
- #define STR_SERIAL L"Serial"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #define STR_SERIAL_NUMBER L"12345"
-
-
-
-
-
- #define VENDOR_ID 0x16C0
- #define PRODUCT_ID 0x0487
-
-
-
-
-
-
-
-
- #define TRANSMIT_FLUSH_TIMEOUT 3
-
-
-
-
-
-
-
- #define TRANSMIT_TIMEOUT 15
-
-
-
-
-
-
- #define ENDPOINT0_SIZE 64
-
- #define KEYBOARD_INTERFACE 2
- #define KEYBOARD_ENDPOINT 1
- #define KEYBOARD_SIZE 8
- #define KEYBOARD_BUFFER EP_DOUBLE_BUFFER
- #define KEYBOARD_INTERVAL 1
-
- #define CDC_ACM_ENDPOINT 2
- #define CDC_ACM_SIZE 16
- #define CDC_ACM_BUFFER EP_SINGLE_BUFFER
- #define CDC_RX_ENDPOINT 3
- #define CDC_RX_SIZE 64
- #define CDC_RX_BUFFER EP_DOUBLE_BUFFER
- #define CDC_TX_ENDPOINT 4
- #define CDC_TX_BUFFER EP_DOUBLE_BUFFER
- #define CDC_TX_SIZE 64
-
- #define MOUSE_INTERFACE 3
- #define MOUSE_ENDPOINT 5
- #define MOUSE_SIZE 8
- #define MOUSE_BUFFER EP_DOUBLE_BUFFER
- #define MOUSE_INTERVAL 2
-
- #define JOYSTICK_INTERFACE 4
- #define JOYSTICK_ENDPOINT 6
- #define JOYSTICK_SIZE 16
- #define JOYSTICK_BUFFER EP_DOUBLE_BUFFER
- #define JOYSTICK_INTERVAL 1
-
-
-
- void usb_init(void);
- void usb_shutdown(void);
-
-
- extern volatile uint8_t usb_configuration;
- extern volatile uint8_t usb_suspended;
-
-
-
- extern volatile uint8_t transmit_flush_timer;
- extern uint8_t transmit_previous_timeout;
-
-
-
-
- extern volatile uint8_t cdc_line_coding[7];
- extern volatile uint8_t cdc_line_rtsdtr;
-
- extern uint8_t keyboard_report_data[];
- extern uint8_t keyboard_idle_count;
- extern volatile uint8_t keyboard_leds;
- extern uint8_t mouse_buttons;
- extern uint8_t joystick_report_data[12];
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
|