Macros
| Macros | |
| #define | STATIC_USBX_BUF (x, y) | 
| Macro for creating WORD (4 byte) aligned static uint8_t array with size which is a multiple of WORD size. | |
| #define | USBX_BUF (x, y) SL_ALIGN (4) uint8_t x[((y) + 3) & ~3] SL_ATTRIBUTE_ALIGN (4) | 
| Macro for creating WORD (4 byte) aligned uint8_t array with size which is a multiple of WORD size. | |
| #define | USBX_STRING_DESC (_name, ...) | 
| Macro for creating USB-Compliant UTF-16LE UNICODE string descriptor. | |
Macro Definition Documentation
| #define STATIC_USBX_BUF | ( | 
            x,
            | |
| 
            y
            | |||
| ) | 
           em_common.h:188
          
         
           em_common.h:180
          
         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.
        Definition at line
        
         221
        
        of file
        
         em_usbxpress.h
        
        .
       
| #define USBX_BUF | ( | 
            x,
            | |
| 
            y
            | |||
| ) | SL_ALIGN (4) uint8_t x[((y) + 3) & ~3] SL_ATTRIBUTE_ALIGN (4) | 
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.
        Definition at line
        
         207
        
        of file
        
         em_usbxpress.h
        
        .
       
| #define USBX_STRING_DESC | ( | 
            _name,
            | |
| 
            ...
            | |||
| ) | 
           em_common.h:177
          
         
           em_common.h:188
          
         
           em_common.h:170
          
         
           em_common.h:180
          
         
           em_common.h:163
          
         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.
        Definition at line
        
         176
        
        of file
        
         em_usbxpress.h
        
        .