63 #ifndef EM_USBXPRESS_H
64 #define EM_USBXPRESS_H
111 #define USBX_RESET 0x00000001
112 #define USBX_TX_COMPLETE 0x00000002
113 #define USBX_RX_COMPLETE 0x00000004
114 #define USBX_FIFO_PURGE 0x00000008
115 #define USBX_DEV_OPEN 0x00000010
116 #define USBX_DEV_CLOSE 0x00000020
117 #define USBX_DEV_CONFIGURED 0x00000040
118 #define USBX_DEV_SUSPEND 0x00000080
119 #define USBX_RX_OVERRUN 0x00000100
131 #define USBX_STATUS_OK USB_STATUS_OK
132 #define USBX_STATUS_EP_BUSY USB_STATUS_EP_BUSY
133 #define USBX_STATUS_ILLEGAL USB_STATUS_ILLEGAL
134 #define USBX_STATUS_EP_STALLED USB_STATUS_EP_STALLED
135 #define USBX_STATUS_DEVICE_UNCONFIGURED USB_STATUS_DEVICE_UNCONFIGURED
142 #if defined(__GNUC__)
143 #if defined(__CHAR16_TYPE__)
144 typedef __CHAR16_TYPE__ char16_t;
146 typedef unsigned short char16_t;
149 #elif defined(__ICCARM__)
152 #elif defined(__CC_ARM)
153 typedef unsigned short char16_t;
173 #define USBX_STRING_DESC(_name, ...) \
179 char16_t name[ 1 + sizeof((char16_t[]){__VA_ARGS__}) / 2]; \
180 } SL_ATTRIBUTE_PACKED _##_name; \
184 static const _##_name _name SL_ATTRIBUTE_ALIGN(4)= \
186 .len = sizeof(_##_name) - 2, \
188 .name = {__VA_ARGS__}, \
189 .name[((sizeof(_##_name) - 2) / 2) - 1] = '\0' \
204 #define USBX_BUF(x, y) \
205 SL_ALIGN(4) uint8_t x[((y)+3)&~3] SL_ATTRIBUTE_ALIGN(4)
218 #define STATIC_USBX_BUF(x, y) SL_ALIGN(4) \
219 static uint8_t x[((y)+3)&~3] SL_ATTRIBUTE_ALIGN(4)
451 #endif // EM_USBXPRESS_H
void USBX_apiCallbackDisable(void)
Inhibits user API call-backs and does NOT disable the USB interrupt.
#define SL_PACK_END()
Macro for handling packed structs. Use this macro after the struct definition. With GCC...
void USBX_init(USBX_Init_t *p)
User API USB initialization function.
void const * serialString
General purpose utilities.
#define SL_PACK_START(x)
Macro for handling packed structs. Use this macro before the struct definition. X denotes the max...
void const * manufacturerString
USBXpress initialization function parameter typedef.
uint_least16_t USBX_getLibraryVersion(void)
Returns the USBXpress library version.
int USBX_blockRead(uint8_t *block, uint32_t numBytes, uint32_t *countPtr)
User API function to get data from host.
int USBX_blockWrite(uint8_t *block, uint32_t numBytes, uint32_t *countPtr)
User API function to send data to host.
uint32_t USBX_getCallbackSource(void)
User API function to get the call-back source.
void(* USBX_apiCallback_t)(void)
void const * productString
#define SL_ATTRIBUTE_PACKED
GCC style macro for handling packed structs.
void USBX_apiCallbackEnable(USBX_apiCallback_t f)
Enables user API call-backs.
void USBX_disable(void)
Disables the USB interface.