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.
 

usbdev mock device endpoint states

enum  usbdev_mock_ep_state_t { EP_STATE_READY, EP_STATE_DATA_AVAILABLE }
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 

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 67 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 59 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 77 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 34 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