Loading...
Searching...
No Matches
USBUS CDC ECM - USBUS CDC ethernet control model

USBUS CDC ECM interface module. More...

Detailed Description

USBUS CDC ECM interface module.

Files

file  ecm.h
 Interface and definitions for USB CDC ECM type interfaces.
 

Data Structures

struct  usbus_cdcecm_device
 USBUS CDC ECM device interface context. More...
 

Macros

#define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED   1000000
 Link throughput as reported by the peripheral.
 
#define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_DOWNSTREAM   CONFIG_USBUS_CDC_ECM_CONFIG_SPEED
 Link download speed as reported by the peripheral.
 
#define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM   CONFIG_USBUS_CDC_ECM_CONFIG_SPEED
 Link upload speed as reported by the peripheral.
 
#define USBUS_CDCECM_EP_CTRL_SIZE   16
 CDC ECM interrupt endpoint size.
 
#define USBUS_CDCECM_EP_DATA_SIZE   64
 CDC ECM bulk data endpoint size.
 
#define USBUS_ETHERNET_FRAME_BUF   MATH_ALIGN(ETHERNET_FRAME_LEN, USBUS_CDCECM_EP_DATA_SIZE)
 Full ethernet frame rounded up to a whole number of transfers.
 
#define USBUS_CDC_ECM_EP_IN_REQUIRED_NUMOF   2
 Number of IN EPs required for the CDC ECM interface.
 
#define USBUS_CDC_ECM_EP_OUT_REQUIRED_NUMOF   1
 Number of Out EPs required for the CDC ECM interface.
 

Typedefs

typedef struct usbus_cdcecm_device usbus_cdcecm_device_t
 USBUS CDC ECM device interface context.
 

Enumerations

enum  usbus_cdcecm_notif_t { USBUS_CDCECM_NOTIF_NONE , USBUS_CDCECM_NOTIF_LINK_UP , USBUS_CDCECM_NOTIF_SPEED }
 notification state, used to track which information must be send to the host More...
 

Functions

void usbus_cdcecm_init (usbus_t *usbus, usbus_cdcecm_device_t *handler)
 CDC ECM initialization function.
 

Macro Definition Documentation

◆ CONFIG_USBUS_CDC_ECM_CONFIG_SPEED

#define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED   1000000

Link throughput as reported by the peripheral.

This defines a common up and down link throughput in bits/second. The USB peripheral will report this to the host. This doesn't affect the actual throughput, only what the peripheral reports to the host.

Definition at line 48 of file ecm.h.

◆ CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_DOWNSTREAM

#define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_DOWNSTREAM   CONFIG_USBUS_CDC_ECM_CONFIG_SPEED

Link download speed as reported by the peripheral.

Definition at line 55 of file ecm.h.

◆ CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM

#define CONFIG_USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM   CONFIG_USBUS_CDC_ECM_CONFIG_SPEED

Link upload speed as reported by the peripheral.

Definition at line 62 of file ecm.h.

◆ USBUS_CDC_ECM_EP_IN_REQUIRED_NUMOF

#define USBUS_CDC_ECM_EP_IN_REQUIRED_NUMOF   2

Number of IN EPs required for the CDC ECM interface.

Definition at line 93 of file ecm.h.

◆ USBUS_CDC_ECM_EP_OUT_REQUIRED_NUMOF

#define USBUS_CDC_ECM_EP_OUT_REQUIRED_NUMOF   1

Number of Out EPs required for the CDC ECM interface.

Definition at line 98 of file ecm.h.

◆ USBUS_CDCECM_EP_CTRL_SIZE

#define USBUS_CDCECM_EP_CTRL_SIZE   16

CDC ECM interrupt endpoint size.

Used by the device to report events to the host.

Note
Must be at least 16B to allow for reporting the link throughput

Definition at line 72 of file ecm.h.

◆ USBUS_CDCECM_EP_DATA_SIZE

#define USBUS_CDCECM_EP_DATA_SIZE   64

CDC ECM bulk data endpoint size.

Used for the transfer of network frames.

Definition at line 80 of file ecm.h.

◆ USBUS_ETHERNET_FRAME_BUF

#define USBUS_ETHERNET_FRAME_BUF   MATH_ALIGN(ETHERNET_FRAME_LEN, USBUS_CDCECM_EP_DATA_SIZE)

Full ethernet frame rounded up to a whole number of transfers.

Definition at line 88 of file ecm.h.

Enumeration Type Documentation

◆ usbus_cdcecm_notif_t

notification state, used to track which information must be send to the host

Enumerator
USBUS_CDCECM_NOTIF_NONE 

Nothing notified so far.

USBUS_CDCECM_NOTIF_LINK_UP 

Link status is notified.

USBUS_CDCECM_NOTIF_SPEED 

Link speed is notified.

Definition at line 104 of file ecm.h.

Function Documentation

◆ usbus_cdcecm_init()

void usbus_cdcecm_init ( usbus_t usbus,
usbus_cdcecm_device_t handler 
)

CDC ECM initialization function.

Parameters
usbusUSBUS thread to use
handlerCDCECM device struct