#ifndef __USB_OTG_H__ #define __USB_OTG_H__ #include "usb.h" #include "usb_regs.h" class USB_OTG : public USB { protected: USB_OTG_CORE_REGS usbRegs; bool address_changed; virtual int interfaces() const = 0; virtual bool descriptor( const Uint16 wValue, const Uint16 wIndex, unsigned char **buf, int *size) = 0; virtual bool setup( const int &configuration) = 0; void disable_global_interrupt(); void enable_global_interrupt(); void enable_common_interrupt(); void set_current_mode(const bool &is_device); void set_device_speed(const Uint8 &devspd); void flush_fifo(__IO USB_OTG_GRSTCTL_TypeDef &greset); void flush_tx_fifo(const Uint8 &txfnum); void flush_rx_fifo(); void reset_core(); void enable_device_interrupt(); Uint8 get_address() const; Uint8 set_address(const Uint8 &new_address); public: USB_OTG(); virtual ~USB_OTG(); }; #endif /*__USB_OTG_H__ */