nRF5 SDK v17.1.0
Macros
USB Device library configuration

Macros

#define APP_USBD_ENABLED
 Enabling USBD library. More...
 
#define APP_USBD_VID
 Vendor ID. More...
 
#define APP_USBD_PID
 Product ID. More...
 
#define APP_USBD_DEVICE_VER_MAJOR
 Major device version. More...
 
#define APP_USBD_DEVICE_VER_MINOR
 Minor device version. More...
 
#define APP_USBD_DEVICE_VER_SUB
 Sub-minor device version. More...
 
#define APP_USBD_CONFIG_SELF_POWERED
 Self-powered device, as opposed to bus-powered. More...
 
#define APP_USBD_CONFIG_MAX_POWER
 MaxPower field in configuration descriptor in milliamps. More...
 
#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS
 Process power events. More...
 
#define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE
 Enable event queue. More...
 
#define APP_USBD_CONFIG_EVENT_QUEUE_SIZE
 The size of the event queue. More...
 
#define APP_USBD_CONFIG_SOF_HANDLING_MODE
 Change SOF events handling mode. More...
 
#define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE
 Provide a function that generates timestamps for logs based on the current SOF. More...
 
#define APP_USBD_CONFIG_DESC_STRING_SIZE
 Maximum size of the NULL-terminated string of the string descriptor. More...
 
#define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED
 Enable UTF8 conversion. More...
 
#define APP_USBD_STRINGS_LANGIDS
 Supported languages identifiers. More...
 
#define APP_USBD_STRING_ID_MANUFACTURER
 Define manufacturer string ID. More...
 
#define APP_USBD_STRINGS_MANUFACTURER_EXTERN
 Define whether APP_USBD_STRINGS_MANUFACTURER is created by macro or declared as a global variable. More...
 
#define APP_USBD_STRINGS_MANUFACTURER
 String descriptor for the manufacturer name. More...
 
#define APP_USBD_STRING_ID_PRODUCT
 Define product string ID. More...
 
#define APP_USBD_STRINGS_PRODUCT_EXTERN
 Define whether APP_USBD_STRINGS_PRODUCT is created by macro or declared as a global variable. More...
 
#define APP_USBD_STRINGS_PRODUCT
 String descriptor for the product name. More...
 
#define APP_USBD_STRING_ID_SERIAL
 Define serial number string ID. More...
 
#define APP_USBD_STRING_SERIAL_EXTERN
 Define whether APP_USBD_STRING_SERIAL is created by macro or declared as a global variable. More...
 
#define APP_USBD_STRING_SERIAL
 String descriptor for the serial number. More...
 
#define APP_USBD_STRING_ID_CONFIGURATION
 Define configuration string ID. More...
 
#define APP_USBD_STRING_CONFIGURATION_EXTERN
 Define whether APP_USBD_STRINGS_CONFIGURATION is created by macro or declared as global variable. More...
 
#define APP_USBD_STRINGS_CONFIGURATION
 String descriptor for the device configuration. More...
 
#define APP_USBD_STRINGS_USER
 Default values for user strings. More...
 

Detailed Description

Macro Definition Documentation

#define APP_USBD_CONFIG_DESC_STRING_SIZE

Maximum size of the NULL-terminated string of the string descriptor.

31 characters can be stored in the internal USB buffer used for transfers. Any value higher than 31 creates an additional buffer just for descriptor strings.

Minimum value: 31 Maximum value: 254

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED

Enable UTF8 conversion.

Enable UTF8-encoded characters. In normal processing, only ASCII characters are available.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE

Enable event queue.

This is the default configuration when all the events are placed into internal queue. Disable it when an external queue is used like app_scheduler or if you wish to process all events inside interrupts. Processing all events from the interrupt level adds requirement not to call any functions that modifies the USBD library state from the context higher than USB interrupt context. Functions that modify USBD state are functions for sleep, wakeup, start, stop, enable, and disable.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_EVENT_QUEUE_SIZE

The size of the event queue.

The size of the queue for the events that would be processed in the main loop.

Minimum value: 16 Maximum value: 64

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_MAX_POWER

MaxPower field in configuration descriptor in milliamps.

Minimum value: 0 Maximum value: 500

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS

Process power events.

Enable processing power events in USB event handler.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_SELF_POWERED

Self-powered device, as opposed to bus-powered.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_SOF_HANDLING_MODE

Change SOF events handling mode.

Normal queue - SOF events are pushed normally into the event queue. Compress queue - SOF events are counted and binded with other events or executed when the queue is empty. This prevents the queue from filling up with SOF events. Interrupt - SOF events are processed in interrupt.

Following options are available:

  • 0 - Normal queue
  • 1 - Compress queue
  • 2 - Interrupt
Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE

Provide a function that generates timestamps for logs based on the current SOF.

The function app_usbd_sof_timestamp_get is implemented if the logger is enabled. Use it when initializing the logger. SOF processing is always enabled when this configuration parameter is active. Note: This option is configured outside of APP_USBD_CONFIG_LOG_ENABLED. This means that it works even if the logging in this very module is disabled.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_DEVICE_VER_MAJOR

Major device version.

Major device version, will be converted automatically to BCD notation. Use just decimal values.

Minimum value: 0 Maximum value: 99

Note
This is an NRF_CONFIG macro.
#define APP_USBD_DEVICE_VER_MINOR

Minor device version.

Minor device version, will be converted automatically to BCD notation. Use just decimal values.

Minimum value: 0 Maximum value: 9

Note
This is an NRF_CONFIG macro.
#define APP_USBD_DEVICE_VER_SUB

Sub-minor device version.

Sub-minor device version, will be converted automatically to BCD notation. Use just decimal values.

Minimum value: 0 Maximum value: 9

Note
This is an NRF_CONFIG macro.
#define APP_USBD_ENABLED

Enabling USBD library.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_PID

Product ID.

Note: This value is not editable in Configuration Wizard. Selected Product ID

Minimum value: 0x0000 Maximum value: 0xFFFF

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRING_CONFIGURATION_EXTERN

Define whether APP_USBD_STRINGS_CONFIGURATION is created by macro or declared as global variable.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRING_ID_CONFIGURATION

Define configuration string ID.

Setting ID to 0 disables the string.

Minimum value: 0 Maximum value: 255

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRING_ID_MANUFACTURER

Define manufacturer string ID.

Setting ID to 0 disables the string.

Minimum value: 0 Maximum value: 255

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRING_ID_PRODUCT

Define product string ID.

Setting ID to 0 disables the string.

Minimum value: 0 Maximum value: 255

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRING_ID_SERIAL

Define serial number string ID.

Setting ID to 0 disables the string.

Minimum value: 0 Maximum value: 255

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRING_SERIAL

String descriptor for the serial number.

Note: This value is not editable in Configuration Wizard. Serial number that is defined the same way like in APP_USBD_STRINGS_MANUFACTURER.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRING_SERIAL_EXTERN

Define whether APP_USBD_STRING_SERIAL is created by macro or declared as a global variable.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRINGS_CONFIGURATION

String descriptor for the device configuration.

Note: This value is not editable in Configuration Wizard. Configuration string that is defined the same way like in APP_USBD_STRINGS_MANUFACTURER.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRINGS_LANGIDS

Supported languages identifiers.

Note: This value is not editable in Configuration Wizard. Comma-separated list of supported languages.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRINGS_MANUFACTURER

String descriptor for the manufacturer name.

Note: This value is not editable in Configuration Wizard. Comma-separated list of manufacturer names for each defined language. Use APP_USBD_STRING_DESC macro to create string descriptor from a NULL-terminated string. Use APP_USBD_STRING_RAW8_DESC macro to create string descriptor from comma-separated uint8_t values. Use APP_USBD_STRING_RAW16_DESC macro to create string descriptor from comma-separated uint16_t values. Alternatively, configure the macro to point to any internal variable pointer that already contains the descriptor. Setting string to NULL disables that string. The order of manufacturer names must be the same like in APP_USBD_STRINGS_LANGIDS.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRINGS_MANUFACTURER_EXTERN

Define whether APP_USBD_STRINGS_MANUFACTURER is created by macro or declared as a global variable.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRINGS_PRODUCT

String descriptor for the product name.

Note: This value is not editable in Configuration Wizard. List of product names that is defined the same way like in APP_USBD_STRINGS_MANUFACTURER.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRINGS_PRODUCT_EXTERN

Define whether APP_USBD_STRINGS_PRODUCT is created by macro or declared as a global variable.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_STRINGS_USER

Default values for user strings.

Note: This value is not editable in Configuration Wizard. This value stores all application specific user strings with the default initialization. The setup is done by X-macros. Expected macro parameters:

X(mnemonic, [=str_idx], ...)
  • mnemonic: Mnemonic of the string descriptor that would be added to app_usbd_string_desc_idx_t enumerator.
  • str_idx : String index value, can be set or left empty. For example, WinUSB driver requires descriptor to be present on 0xEE index. Then use X(USBD_STRING_WINUSB, =0xEE, (APP_USBD_STRING_DESC(...)))
  • ... : List of string descriptors for each defined language.
Note
This is an NRF_CONFIG macro.
#define APP_USBD_VID

Vendor ID.

Note: This value is not editable in Configuration Wizard. Vendor ID ordered from USB IF: http://www.usb.org/developers/vendor/

Minimum value: 0x0000 Maximum value: 0xFFFF

Note
This is an NRF_CONFIG macro.

Documentation feedback | Developer Zone | Subscribe | Updated