Loading...
Searching...
No Matches
USBdev mockup device

USBdev mockup device for testing. More...

Detailed Description

USBdev mockup device for testing.

Author
Koen Zandberg koen@.nosp@m.berg.nosp@m.zand..nosp@m.net

Data Structures

struct  usbdev_mock_ep_t
 usbdev mock device endpoint More...
 
struct  usbdev_mock
 usbdev mock device More...
 

Macros

#define USBDEV_MOCK_NUM_EP   (1)
 Number of IN and OUT endpoints available in the mock usbdev device.
 

Typedefs

typedef struct usbdev_mock usbdev_mock_t
 usbdev mock device forward declaration
 
typedef void(* usbdev_mock_esr_cb_t) (usbdev_mock_t *dev)
 usbdev mock device callback for esr event checking
 
typedef void(* usbdev_mock_ep_esr_cb_t) (usbdev_mock_t *dev, usbdev_mock_ep_t *ep)
 usbdev mock device callback for endpoint event checking
 
typedef void(* usbdev_mock_ready_cb_t) (usbdev_mock_t *dev, usbdev_mock_ep_t *ep, size_t len)
 usbdev mock device callback for endpoint ready call checking
 

Functions

void usbdev_mock_setup (usbdev_mock_esr_cb_t esr_cb, usbdev_mock_ep_esr_cb_t ep_esr_cb, usbdev_mock_ready_cb_t ready_cb)
 usbdev mock device setup function
 

usbdev mock device endpoint states

enum  usbdev_mock_ep_state_t { EP_STATE_READY , EP_STATE_DATA_AVAILABLE }
 

Macro Definition Documentation

◆ USBDEV_MOCK_NUM_EP

#define USBDEV_MOCK_NUM_EP   (1)

Number of IN and OUT endpoints available in the mock usbdev device.

Definition at line 29 of file usbdev_mock.h.

Typedef Documentation

◆ usbdev_mock_ep_esr_cb_t

typedef void(* usbdev_mock_ep_esr_cb_t) (usbdev_mock_t *dev, usbdev_mock_ep_t *ep)

usbdev mock device callback for endpoint event checking

Parameters
devusbdev mock device descriptor
epusbdev mock device endpoint

Definition at line 70 of file usbdev_mock.h.

◆ usbdev_mock_esr_cb_t

typedef void(* usbdev_mock_esr_cb_t) (usbdev_mock_t *dev)

usbdev mock device callback for esr event checking

Parameters
devusbdev mock device descriptor

Definition at line 62 of file usbdev_mock.h.

◆ usbdev_mock_ready_cb_t

typedef void(* usbdev_mock_ready_cb_t) (usbdev_mock_t *dev, usbdev_mock_ep_t *ep, size_t len)

usbdev mock device callback for endpoint ready call checking

Parameters
devusbdev mock device descriptor
epusbdev mock device endpoint
lenlength supplied to the ready call

Definition at line 80 of file usbdev_mock.h.

◆ usbdev_mock_t

typedef struct usbdev_mock usbdev_mock_t

usbdev mock device forward declaration

Definition at line 55 of file usbdev_mock.h.

Enumeration Type Documentation

◆ usbdev_mock_ep_state_t

Enumerator
EP_STATE_READY 

Endpoint is ready/idle.

EP_STATE_DATA_AVAILABLE 

Endpoint has data

Definition at line 35 of file usbdev_mock.h.

Function Documentation

◆ usbdev_mock_setup()

void usbdev_mock_setup ( usbdev_mock_esr_cb_t  esr_cb,
usbdev_mock_ep_esr_cb_t  ep_esr_cb,
usbdev_mock_ready_cb_t  ready_cb 
)

usbdev mock device setup function

Parameters
esr_cbESR callback
ep_esr_cbEndpoint ESR callback
ready_cbEndpoint ready callback