nRF5 SDK v13.0.0
Modules | Data Structures | Macros | Typedefs | Enumerations | Functions

nRF52840 only: Module with types, definitions, and API used by the USB MSC class. More...

Modules

 USB MSC descriptors
 nRF52840 only: Descriptors for the USB MSC class.
 
 USB MSC class configuration
 
 USB MSC internals
 nRF52840 only: Internals of the USB MSC class.
 
 USB MSC SCSI data structures
 nRF52840 only: USB MSC SCSI data structures.
 
 USB MSC types
 nRF52840 only: Types used in the USB MSC class.
 

Data Structures

struct  app_usbd_msc_t
 Mass storage class instance type. More...
 

Macros

#define APP_USBD_MSC_ENDPOINT_LIST(in_number, out_number)
 Helper macro for defining MSC endpoints. More...
 
#define APP_USBD_MSC_GLOBAL_DEF(instance_name,interface_number,user_ev_handler,endpoint_list,blockdev_list,workbuffer_size)
 Global definition of app_usbd_msc_t class. More...
 

Typedefs

typedef enum
app_usbd_msc_user_event_e 
app_usbd_msc_user_event_t
 Events passed to user event handler. More...
 

Enumerations

enum  app_usbd_msc_user_event_e { APP_USBD_MSC_USER_EVT_NONE }
 Events passed to user event handler. More...
 

Functions

static app_usbd_class_inst_t
const * 
app_usbd_msc_class_inst_get (app_usbd_msc_t const *p_msc)
 
static app_usbd_msc_t const * app_usbd_msc_class_get (app_usbd_class_inst_t const *p_inst)
 Helper function to get MSC from base class instance. More...
 
bool app_usbd_msc_sync (app_usbd_msc_t const *p_msc)
 Synchronization of all block devices pined to MSC. More...
 

Detailed Description

nRF52840 only: Module with types, definitions, and API used by the USB MSC class.

References:

Macro Definition Documentation

#define APP_USBD_MSC_ENDPOINT_LIST (   in_number,
  out_number 
)
Value:

Helper macro for defining MSC endpoints.

Parameters
in_numberInput endpoint number
out_numberOutput endpoint number
#define APP_USBD_MSC_GLOBAL_DEF (   instance_name,
  interface_number,
  user_ev_handler,
  endpoint_list,
  blockdev_list,
  workbuffer_size 
)
Value:
interface_number, \
user_ev_handler, \
endpoint_list, \
blockdev_list, \
workbuffer_size)

Global definition of app_usbd_msc_t class.

Parameters
instance_nameName of global instance
interface_numberUnique interface number
user_ev_handlerUser event handler (optional)
endpoint_listInput endpoint list (nrf_drv_usbd_ep_t)
blockdev_listBlock device list
workbuffer_sizeWork buffer size (need to fit into all block devices from block device list)
Note
This macro is just simplified version of APP_USBD_MSC_GLOBAL_DEF_INTERNAL

Typedef Documentation

Events passed to user event handler.

Note
Example prototype of user event handler:

void msc_user_ev_handler(app_usbd_class_inst_t const * p_inst, app_usbd_msc_user_event_t event);

Enumeration Type Documentation

Events passed to user event handler.

Note
Example prototype of user event handler:

void msc_user_ev_handler(app_usbd_class_inst_t const * p_inst, app_usbd_msc_user_event_t event);

Enumerator
APP_USBD_MSC_USER_EVT_NONE 

Dummy event to satisfy compilers.

Function Documentation

static app_usbd_msc_t const* app_usbd_msc_class_get ( app_usbd_class_inst_t const *  p_inst)
inlinestatic

Helper function to get MSC from base class instance.

Parameters
[in]p_instBase class instance
Returns
MSC class handle
static app_usbd_class_inst_t const* app_usbd_msc_class_inst_get ( app_usbd_msc_t const *  p_msc)
inlinestatic

@brief Helper function to get class instance from MSC

Parameters
[in]p_mscMSC instance (declared by APP_USBD_MSC_GLOBAL_DEF)
Returns
Base class instance
bool app_usbd_msc_sync ( app_usbd_msc_t const *  p_msc)

Synchronization of all block devices pined to MSC.

Parameters
[in]p_mscMSC instance (declared by APP_USBD_MSC_GLOBAL_DEF)
Return values
trueAll block devices flushed data
falseAt least one block device has not flushed data

Documentation feedback | Developer Zone | Subscribe | Updated