nRF52840 only: USBD string descriptor management.
More...
|
#define | APP_USBD_LANG(lang) ((app_usbd_langid_t) lang) |
| USB Language identifier initialization. More...
|
|
#define | APP_USBD_LANG_AND_SUBLANG(lang, sublang) ((app_usbd_langid_t) lang | (app_usbd_langid_t) sublang) |
| USB Language identifier with sublanguage initialization. More...
|
|
#define | APP_USBD_STRING_DESC(str) (const uint8_t *)(const char[]){str} |
| USB string initialization. More...
|
|
#define | APP_USBD_STRING_RAW8_DESC(...) |
| USB raw 8-bit string initialization. More...
|
|
#define | APP_USBD_STRING_RAW16_DESC(...) |
| USB raw 16-bit string initialization. More...
|
|
#define | APP_USBD_STRING_ID_MANUFACTURER_LEN 0 |
|
#define | APP_USBD_STRING_ID_PRODUCT_LEN 0 |
|
#define | APP_USBD_STRING_ID_SERIAL_LEN 0 |
|
#define | APP_USBD_STRING_ID_CONFIGURATION_LEN 0 |
|
#define | APP_USBD_STRINGS_NUM ((APP_USBD_STRINGS_USER 0) + 1 + APP_USBD_STRING_ID_MANUFACTURER_LEN + APP_USBD_STRING_ID_PRODUCT_LEN + APP_USBD_STRING_ID_SERIAL_LEN + APP_USBD_STRING_ID_CONFIGURATION_LEN) |
| Total number of USB strings.
|
|
nRF52840 only: USBD string descriptor management.
#define APP_USBD_LANG |
( |
|
lang | ) |
((app_usbd_langid_t) lang) |
USB Language identifier initialization.
- Parameters
-
[in] | lang | Language identifier. |
#define APP_USBD_LANG_AND_SUBLANG |
( |
|
lang, |
|
|
|
sublang |
|
) |
| ((app_usbd_langid_t) lang | (app_usbd_langid_t) sublang) |
USB Language identifier with sublanguage initialization.
- Parameters
-
[in] | lang | Language identifier. |
[in] | sublang | Sublanguage identifier. |
#define APP_USBD_STRING_DESC |
( |
|
str | ) |
(const uint8_t *)(const char[]){str} |
USB string initialization.
Macro that creates initialization values for the USB string. The string must be declared as a NULL-terminated string.
- Parameters
-
[in] | str | NULL-terminated string. |
- Returns
- String descriptor initialization data.
#define APP_USBD_STRING_RAW16_DESC |
( |
|
... | ) |
|
Value:(const uint8_t *) ((const uint16_t[]){ \
0x00, \
(0xff & (sizeof((uint16_t[]){__VA_ARGS__}) + 2)) | \
__VA_ARGS__ })
USB raw 16-bit string initialization.
Macro that creates header for raw values passed into descriptor. Values must be of the uint16_t type and separated by commas.
- Parameters
-
[in] | ... | comma-separated values. |
- Returns
- String descriptor initialization data.
#define APP_USBD_STRING_RAW8_DESC |
( |
|
... | ) |
|
Value:(const uint8_t[]){ \
0x00, 0x00, \
(0xff & (sizeof((uint8_t[]){__VA_ARGS__}) + 2)), \
__VA_ARGS__ }
USB raw 8-bit string initialization.
Macro that creates header for raw values passed into descriptor. Values must be of the uint8_t type and separated by commas.
- Parameters
-
[in] | ... | comma-separated values. |
- Returns
- String descriptor initialization data.
USB string descriptors IDs.
Enumerator |
---|
APP_USBD_STRING_ID_LANGIDS |
Supported language identifiers
|
uint16_t const* app_usbd_string_desc_get |
( |
uint8_t |
idx, |
|
|
uint16_t |
langid |
|
) |
| |
Get string descriptor.
- Parameters
-
[in] | idx | String descriptor index. |
[in] | langid | Selected language for the string. |
- Returns
- String descriptor, or NULL if it does not exist.
static size_t app_usbd_string_desc_length |
( |
uint16_t const * |
p_str | ) |
|
|
inlinestatic |
Get string length.
Function for getting string length from descriptor (descriptor returned by app_usbd_string_desc_get).
- Parameters
-
[in] | p_str | String descriptor pointer. |
- Returns
- Total descriptor length in bytes.