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 "../../HAL/HAL.h"
49 #include "../../Endpoint.h"
51 #if defined(__cplusplus)
55 #if !defined(__INCLUDE_FROM_USB_DRIVER)
56 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
59 #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
60 #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
63 #if defined(__DOXYGEN__)
67 #define USB_DEVICE_OPT_LOWSPEED (1 << 0)
72 #define USB_DEVICE_OPT_FULLSPEED (0 << 0)
74 #if (!defined(NO_INTERNAL_SERIAL) && \
75 (defined(__DOXYGEN__)) )
85 #define USE_INTERNAL_SERIAL 0xDC
89 #define INTERNAL_SERIAL_LENGTH_BITS 80
93 #define INTERNAL_SERIAL_START_ADDRESS 0x0E
95 #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
97 #define INTERNAL_SERIAL_LENGTH_BITS 0
98 #define INTERNAL_SERIAL_START_ADDRESS 0
120 #if !defined(NO_SOF_EVENTS)
140 #if !defined(__DOXYGEN__)
141 #if defined(USB_DEVICE_OPT_LOWSPEED)
144 static inline
void USB_Device_SetLowSpeed(
void)
149 static inline
void USB_Device_SetFullSpeed(
void)
165 static inline
bool USB_Device_IsAddressSet(
void)
170 #if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
173 static inline void USB_Device_GetSerialString(uint16_t *
const UnicodeString)
181 uint8_t SerialByte = boot_signature_byte_get(SigReadAddress);
183 if (SerialCharNum & 0x01) {
190 UnicodeString[SerialCharNum] =
cpu_to_le16((SerialByte >= 10) ?
191 ((
'A' - 10) + SerialByte) : (
'0' + SerialByte));
201 #if defined(__cplusplus)