41 #ifndef __USBDEVICE_LPC18XX_H__
42 #define __USBDEVICE_LPC18XX_H__
45 #include "../../../../../../Common/Common.h"
46 #include "../../../USBController.h"
47 #include "../../../StdDescriptors.h"
48 #include "../../../USBInterrupt.h"
49 #include "../../../Endpoint.h"
51 #if defined(USB_DEVICE_ROM_DRIVER)
52 #include "../USBRom/usbd_rom_api.h"
56 #if defined(__cplusplus)
61 #if !defined(__INCLUDE_FROM_USB_DRIVER)
62 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
65 #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
66 #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
73 #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || \
83 #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
89 #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
92 #if (!defined(NO_INTERNAL_SERIAL) && \
93 (defined(USB_SERIES_7_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_4_AVR) || \
94 (defined(USB_SERIES_2_AVR) && (!defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__))) || \
95 defined(__DOXYGEN__)))
105 #define USE_INTERNAL_SERIAL 0xDC
110 #define INTERNAL_SERIAL_LENGTH_BITS 80
115 #define INTERNAL_SERIAL_START_ADDRESS 0x0E
117 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
119 #define INTERNAL_SERIAL_LENGTH_BITS 0
120 #define INTERNAL_SERIAL_START_ADDRESS 0
156 #if !defined(NO_SOF_EVENTS)
181 #if !defined(__DOXYGEN__)
183 #if defined(USB_DEVICE_OPT_LOWSPEED)
186 static inline
void USB_Device_SetLowSpeed(
void)
193 static inline
void USB_Device_SetFullSpeed(
void)
200 static inline void USB_Device_SetDeviceAddress(
const uint8_t Address)
ATTR_ALWAYS_INLINE;
202 static inline void USB_Device_SetDeviceAddress(
const uint8_t Address)
210 static inline
bool USB_Device_IsAddressSet(
void)
215 #if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
218 static inline void USB_Device_GetSerialString(uint16_t *
const UnicodeString)
226 uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
228 if (SerialCharNum & 0x01) {
235 UnicodeString[SerialCharNum] =
cpu_to_le16((SerialByte >= 10) ?
236 ((
'A' - 10) + SerialByte) : (
'0' + SerialByte));
247 #if defined(__cplusplus)