41 #ifndef __USBDEVICE_LPC11UXX_H__
42 #define __USBDEVICE_LPC11UXX_H__
44 #include "../../../../../../Common/Common.h"
45 #include "../../../USBController.h"
46 #include "../../../StdDescriptors.h"
47 #include "../../../USBInterrupt.h"
48 #include "../../../Endpoint.h"
50 #if defined(USB_DEVICE_ROM_DRIVER)
51 #include "../USBRom/usbd_rom_api.h"
54 #if defined(__cplusplus)
58 #if !defined(__INCLUDE_FROM_USB_DRIVER)
59 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
62 #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
63 #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
66 #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || \
69 #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
72 #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
74 #if (!defined(NO_INTERNAL_SERIAL) && \
75 (defined(USB_SERIES_7_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_4_AVR) || \
76 (defined(USB_SERIES_2_AVR) && (!defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))) || \
77 defined(__DOXYGEN__)))
79 #define USE_INTERNAL_SERIAL 0xDC
81 #define INTERNAL_SERIAL_LENGTH_BITS 80
83 #define INTERNAL_SERIAL_START_ADDRESS 0x0E
85 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
87 #define INTERNAL_SERIAL_LENGTH_BITS 0
88 #define INTERNAL_SERIAL_START_ADDRESS 0
101 #if !defined(NO_SOF_EVENTS)
117 #if !defined(__DOXYGEN__)
118 #if defined(USB_DEVICE_OPT_LOWSPEED)
122 static inline
void USB_Device_SetLowSpeed(
void)
130 static inline
void USB_Device_SetFullSpeed(
void)
138 static inline void USB_Device_SetDeviceAddress(
const uint8_t Address)
ATTR_ALWAYS_INLINE;
140 static inline void USB_Device_SetDeviceAddress(
const uint8_t Address)
148 static inline
bool USB_Device_IsAddressSet(
void)
153 #if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
156 static inline void USB_Device_GetSerialString(uint16_t *
const UnicodeString)
164 uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
166 if (SerialCharNum & 0x01) {
173 UnicodeString[SerialCharNum] =
cpu_to_le16((SerialByte >= 10) ?
174 ((
'A' - 10) + SerialByte) : (
'0' + SerialByte));
184 #if defined(__cplusplus)