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"
49 #include "../../HAL/HAL.h"
51 #if defined(USB_DEVICE_ROM_DRIVER)
52 #include "../USBRom/usbd_rom_api.h"
55 #if defined(__cplusplus)
59 #if !defined(__INCLUDE_FROM_USB_DRIVER)
60 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
63 #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
64 #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
67 #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || \
70 #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
73 #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
75 #if (!defined(NO_INTERNAL_SERIAL) && \
76 (defined(USB_SERIES_7_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_4_AVR) || \
77 (defined(USB_SERIES_2_AVR) && (!defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))) || \
78 defined(__DOXYGEN__)))
80 #define USE_INTERNAL_SERIAL 0xDC
82 #define INTERNAL_SERIAL_LENGTH_BITS 80
84 #define INTERNAL_SERIAL_START_ADDRESS 0x0E
86 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
88 #define INTERNAL_SERIAL_LENGTH_BITS 0
89 #define INTERNAL_SERIAL_START_ADDRESS 0
102 #if !defined(NO_SOF_EVENTS)
118 #if !defined(__DOXYGEN__)
119 #if defined(USB_DEVICE_OPT_LOWSPEED)
123 static inline
void USB_Device_SetLowSpeed(
void)
131 static inline
void USB_Device_SetFullSpeed(
void)
149 static inline
bool USB_Device_IsAddressSet(
void)
154 #if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
157 static inline void USB_Device_GetSerialString(uint16_t *
const UnicodeString)
165 uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
167 if (SerialCharNum & 0x01) {
174 UnicodeString[SerialCharNum] =
cpu_to_le16((SerialByte >= 10) ?
175 ((
'A' - 10) + SerialByte) : (
'0' + SerialByte));
185 #if defined(__cplusplus)