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 "../../HAL/HAL.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.
75 #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
77 #if (!defined(NO_INTERNAL_SERIAL) && defined(__DOXYGEN__))
87 #define USE_INTERNAL_SERIAL 0xDC
92 #define INTERNAL_SERIAL_LENGTH_BITS 80
97 #define INTERNAL_SERIAL_START_ADDRESS 0x0E
99 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
101 #define INTERNAL_SERIAL_LENGTH_BITS 0
102 #define INTERNAL_SERIAL_START_ADDRESS 0
140 return USB_REG(corenum)->FRINDEX_D;
143 #if !defined(NO_SOF_EVENTS)
172 #if !defined(__DOXYGEN__)
174 #if defined(USB_DEVICE_OPT_LOWSPEED)
177 static inline
void USB_Device_SetLowSpeed(
void)
184 static inline
void USB_Device_SetFullSpeed(
void)
210 static inline bool USB_Device_IsAddressSet(
void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
212 static inline
bool USB_Device_IsAddressSet(
void)
217 #if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
220 static inline void USB_Device_GetSerialString(uint16_t *
const UnicodeString)
228 uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
230 if (SerialCharNum & 0x01) {
237 UnicodeString[SerialCharNum] =
cpu_to_le16((SerialByte >= 10) ?
238 ((
'A' - 10) + SerialByte) : (
'0' + SerialByte));
249 #if defined(__cplusplus)