nRF5 SDK v15.0.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
 Device version, major part. More...
 
#define APP_USBD_DEVICE_VER_MINOR
 Device version, minor part. More...
 
#define APP_USBD_CONFIG_SELF_POWERED
 Self 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 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_LOG_ENABLED
 Enable logging in the module. More...
 
#define APP_USBD_CONFIG_LOG_LEVEL
 Default Severity level. More...
 
#define APP_USBD_CONFIG_INFO_COLOR
 ANSI escape code prefix. More...
 
#define APP_USBD_CONFIG_DEBUG_COLOR
 ANSI escape code prefix. More...
 

Detailed Description

Macro Definition Documentation

#define APP_USBD_CONFIG_DEBUG_COLOR

ANSI escape code prefix.

Following options are available:

  • 0 - Default
  • 1 - Black
  • 2 - Red
  • 3 - Green
  • 4 - Yellow
  • 5 - Blue
  • 6 - Magenta
  • 7 - Cyan
  • 8 - White
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 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 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_INFO_COLOR

ANSI escape code prefix.

Following options are available:

  • 0 - Default
  • 1 - Black
  • 2 - Red
  • 3 - Green
  • 4 - Yellow
  • 5 - Blue
  • 6 - Magenta
  • 7 - Cyan
  • 8 - White
Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_LOG_ENABLED

Enable logging in the module.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_CONFIG_LOG_LEVEL

Default Severity level.

Following options are available:

  • 0 - Off
  • 1 - Error
  • 2 - Warning
  • 3 - Info
  • 4 - Debug
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.

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 event queue. Compress queue - SOF events are counted and binded with other events or executed when queue is empty. This prevents queue from filling 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 will be implemented if the logger is enabled. Use it when initializing the logger. SOF processing will be always enabled when this configuration parameter is active. Notice that this option is configured outside of APP_USBD_CONFIG_LOG_ENABLED. This means that it will work 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

Device version, major part.

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

Device version, minor part.

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_ENABLED

Enabling USBD library.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_USBD_PID

Product ID.

Selected Product ID

Minimum value: 0x0000 Maximum value: 0xFFFF

Note
This is an NRF_CONFIG macro.
#define APP_USBD_VID

Vendor ID.

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