#ifndef _usb_desc_h_ | #ifndef _usb_desc_h_ | ||||
#define _usb_desc_h_ | #define _usb_desc_h_ | ||||
#if F_CPU >= 20000000 | |||||
// This header is NOT meant to be included when compiling | // This header is NOT meant to be included when compiling | ||||
// user sketches in Arduino. The low-level functions | // user sketches in Arduino. The low-level functions | ||||
// provided by usb_dev.c are meant to be called only by | // provided by usb_dev.c are meant to be called only by | ||||
#endif // NUM_ENDPOINTS | #endif // NUM_ENDPOINTS | ||||
#endif // USB_DESC_LIST_DEFINE | #endif // USB_DESC_LIST_DEFINE | ||||
#endif // F_CPU >= 20 MHz | |||||
#endif | #endif |
#include <string.h> // for memcpy() | #include <string.h> // for memcpy() | ||||
#ifdef FLIGHTSIM_INTERFACE // defined by usb_dev.h -> usb_desc.h | #ifdef FLIGHTSIM_INTERFACE // defined by usb_dev.h -> usb_desc.h | ||||
#if F_CPU >= 20000000 | |||||
FlightSimCommand * FlightSimCommand::first = NULL; | FlightSimCommand * FlightSimCommand::first = NULL; | ||||
FlightSimCommand * FlightSimCommand::last = NULL; | FlightSimCommand * FlightSimCommand::last = NULL; | ||||
} | } | ||||
} | } | ||||
#endif // F_CPU | |||||
#endif // FLIGHTSIM_INTERFACE | #endif // FLIGHTSIM_INTERFACE |
#include <string.h> // for memcpy() | #include <string.h> // for memcpy() | ||||
#ifdef JOYSTICK_INTERFACE // defined by usb_dev.h -> usb_desc.h | #ifdef JOYSTICK_INTERFACE // defined by usb_dev.h -> usb_desc.h | ||||
#if F_CPU >= 20000000 | |||||
uint32_t usb_joystick_data[3]; | uint32_t usb_joystick_data[3]; | ||||
#endif // F_CPU | |||||
#endif // JOYSTICK_INTERFACE | #endif // JOYSTICK_INTERFACE |
#include <string.h> // for memcpy() | #include <string.h> // for memcpy() | ||||
#ifdef KEYBOARD_INTERFACE // defined by usb_dev.h -> usb_desc.h | #ifdef KEYBOARD_INTERFACE // defined by usb_dev.h -> usb_desc.h | ||||
#if F_CPU >= 20000000 | |||||
// which modifier keys are currently pressed | // which modifier keys are currently pressed | ||||
// 1=left ctrl, 2=left shift, 4=left alt, 8=left gui | // 1=left ctrl, 2=left shift, 4=left alt, 8=left gui | ||||
} | } | ||||
#endif // F_CPU | |||||
#endif // KEYBOARD_INTERFACE | #endif // KEYBOARD_INTERFACE |
#include "HardwareSerial.h" | #include "HardwareSerial.h" | ||||
#ifdef MIDI_INTERFACE // defined by usb_dev.h -> usb_desc.h | #ifdef MIDI_INTERFACE // defined by usb_dev.h -> usb_desc.h | ||||
#if F_CPU >= 20000000 | |||||
uint8_t usb_midi_msg_channel; | uint8_t usb_midi_msg_channel; | ||||
uint8_t usb_midi_msg_type; | uint8_t usb_midi_msg_type; | ||||
} | } | ||||
#endif // F_CPU | |||||
#endif // MIDI_INTERFACE | #endif // MIDI_INTERFACE |
#include <string.h> // for memcpy() | #include <string.h> // for memcpy() | ||||
#ifdef MOUSE_INTERFACE // defined by usb_dev.h -> usb_desc.h | #ifdef MOUSE_INTERFACE // defined by usb_dev.h -> usb_desc.h | ||||
#if F_CPU >= 20000000 | |||||
// which buttons are currently pressed | // which buttons are currently pressed | ||||
uint8_t usb_mouse_buttons_state=0; | uint8_t usb_mouse_buttons_state=0; | ||||
} | } | ||||
#endif // F_CPU | |||||
#endif // MOUSE_INTERFACE | #endif // MOUSE_INTERFACE |
//#include "HardwareSerial.h" | //#include "HardwareSerial.h" | ||||
#ifdef RAWHID_INTERFACE // defined by usb_dev.h -> usb_desc.h | #ifdef RAWHID_INTERFACE // defined by usb_dev.h -> usb_desc.h | ||||
#if F_CPU >= 20000000 | |||||
int usb_rawhid_recv(void *buffer, uint32_t timeout) | int usb_rawhid_recv(void *buffer, uint32_t timeout) | ||||
{ | { | ||||
return RAWHID_TX_SIZE; | return RAWHID_TX_SIZE; | ||||
} | } | ||||
#endif // F_CPU | |||||
#endif // RAWHID_INTERFACE | #endif // RAWHID_INTERFACE |
// defined by usb_dev.h -> usb_desc.h | // defined by usb_dev.h -> usb_desc.h | ||||
#if defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE) | #if defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE) | ||||
#if F_CPU >= 20000000 | |||||
uint32_t usb_cdc_line_coding[2]; | uint32_t usb_cdc_line_coding[2]; | ||||
volatile uint8_t usb_cdc_line_rtsdtr=0; | volatile uint8_t usb_cdc_line_rtsdtr=0; | ||||
#endif // F_CPU | |||||
#endif // CDC_STATUS_INTERFACE && CDC_DATA_INTERFACE | #endif // CDC_STATUS_INTERFACE && CDC_DATA_INTERFACE |
#include "usb_desc.h" | #include "usb_desc.h" | ||||
#if defined(CDC_DATA_INTERFACE) | |||||
#if defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE) | |||||
#include <inttypes.h> | #include <inttypes.h> | ||||
#endif // F_CPU | #endif // F_CPU | ||||
#endif // CDC_DATA_INTERFACE | |||||
#endif // CDC_STATUS_INTERFACE && CDC_DATA_INTERFACE | |||||
#endif // USBserial_h_ | #endif // USBserial_h_ |