Macros#
Macros.
Macros#
Macro for creating USB-Compliant UTF-16LE UNICODE string descriptor.
Macro for creating WORD (4 byte) aligned uint8_t array with size which is a multiple of WORD size.
Macro for creating WORD (4 byte) aligned static uint8_t array with size which is a multiple of WORD size.
Macro Definition Documentation#
USBX_STRING_DESC#
#define USBX_STRING_DESCValue:
Macro for creating USB-Compliant UTF-16LE UNICODE string descriptor.
Example: USBX_STRING_DESC(iManufacturer, 'S','i','l','i','c','o','n',' ' \ 'L','a','b','s'); Note
The size of the resulting struct will be two bytes larger than a USB string descriptor. This is to accommodate a terminating null char for the string. The value assigned to the 'len' member does not take this into account and is therefore correct USB-wise.
USBX_BUF#
#define USBX_BUFValue:
(x, y)
Macro for creating WORD (4 byte) aligned uint8_t array with size which is a multiple of WORD size.
Example: USBX_BUF(rxBuffer, 37); => uint8_t rxBuffer[40];
Note
Any data buffer which is written to or read by the USB hardware must be aligned on a WORD (4 byte) boundary. This macro provides an easy way to create USB data buffers which are guaranteed to be correctly aligned.
STATIC_USBX_BUF#
#define STATIC_USBX_BUFValue:
Macro for creating WORD (4 byte) aligned static uint8_t array with size which is a multiple of WORD size.
Example: STATIC_USBX_BUF(rxBuffer, 37); => uint8_t rxBuffer[40];
Note
Any data buffer which is written to or read by the USB hardware must be aligned on a WORD (4 byte) boundary. This macro provides an easy way to create static USB data buffers which are guaranteed to be correctly aligned.