41 #ifndef __USBDEVICE_LPC17XX_H__
42 #define __USBDEVICE_LPC17XX_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(__cplusplus)
54 #if !defined(__INCLUDE_FROM_USB_DRIVER)
55 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
58 #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
59 #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
62 #if defined(__DOXYGEN__)
63 #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
66 #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
68 #if (!defined(NO_INTERNAL_SERIAL) && \
69 (defined(__DOXYGEN__)) )
70 #define USE_INTERNAL_SERIAL 0xDC
72 #define INTERNAL_SERIAL_LENGTH_BITS 80
74 #define INTERNAL_SERIAL_START_ADDRESS 0x0E
76 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
78 #define INTERNAL_SERIAL_LENGTH_BITS 0
79 #define INTERNAL_SERIAL_START_ADDRESS 0
97 #if !defined(NO_SOF_EVENTS)
110 #if !defined(__DOXYGEN__)
111 #if defined(USB_DEVICE_OPT_LOWSPEED)
114 static inline
void USB_Device_SetLowSpeed(
void)
119 static inline
void USB_Device_SetFullSpeed(
void)
124 static inline void USB_Device_SetDeviceAddress(
const uint8_t Address)
ATTR_ALWAYS_INLINE;
126 static inline void USB_Device_SetDeviceAddress(
const uint8_t Address)
134 static inline
bool USB_Device_IsAddressSet(
void)
139 #if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
142 static inline void USB_Device_GetSerialString(uint16_t *
const UnicodeString)
150 uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
152 if (SerialCharNum & 0x01) {
159 UnicodeString[SerialCharNum] =
cpu_to_le16((SerialByte >= 10) ?
160 ((
'A' - 10) + SerialByte) : (
'0' + SerialByte));
170 #if defined(__cplusplus)