USB Device CDC EEM API#

USBD_CDC_EEM_ConfigureBufAlignOctets()#

Description#

Configures the alignment of the internal buffers.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

void  USBD_CDC_EEM_ConfigureBufAlignOctets (CPU_SIZE_T  buf_align_octets)

Arguments#

buf_align_octets

Buffer alignment, in octets.

Returned Value#

None.

Notes / Warnings#

  1. This function is optional, if it is not called, the default value will be used.

  2. This function MUST be called before the CDC EEM class is initialized via the function USBD_CDC_EEM_Init().

USBD_CDC_EEM_ConfigureEchoBufLen()#

Description#

Configures the length, in octets, of the buffer used for echo requests.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

void  USBD_CDC_EEM_ConfigureEchoBufLen (CPU_INT16U  echo_buf_len)

Arguments#

echo_buf_len

Length, in octets, of the echo buffer.

Returned Value#

None.

Notes / Warnings#

  1. This function is optional, if it is not called, the default value will be used.

  2. This function MUST be called before the CDC EEM class is initialized via the function USBD_CDC_EEM_Init().

USBD_CDC_EEM_ConfigureMemSeg()#

Description#

Configures the memory segment to use when allocating control data and buffers.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

void  USBD_CDC_EEM_ConfigureMemSeg (MEM_SEG  *p_mem_seg,
                                    MEM_SEG  *p_mem_seg_buf)

Arguments#

p_mem_seg

Pointer to memory segment to use when allocating control data. Can be the same segment used for p_mem_seg_buf. DEF_NULL means general purpose heap segment.

p_mem_seg_buf

Pointer to memory segment to use when allocating data buffers. Can be the same segment used for p_mem_seg. DEF_NULL means general purpose heap segment.

Returned Value#

None.

Notes / Warnings#

  1. This function is optional, if it is not called, the default value will be used.

  2. This function MUST be called before the CDC EEM class is initialized via the function USBD_CDC_EEM_Init().

USBD_CDC_EEM_ConfigureRxBuf()#

Description#

Configures the quantity CDC EEM receive buffer(s).

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

void  USBD_CDC_EEM_ConfigureRxBuf (CPU_INT08U  rx_buf_qty,
                                   CPU_INT32U  rx_buf_len)

Arguments#

rx_buf_qty

Quantity of receive buffer. Unless your USB driver supports URQ queuing, always set to 1.

rx_buf_len

Length, in octets, of the receive buffer(s).

Returned Value#

None.

Notes / Warnings#

  1. This function is optional, if it is not called, the default value will be used.

  2. This function MUST be called before the CDC EEM class is initialized via the function USBD_CDC_EEM_Init().

USBD_CDC_EEM_Init()#

Description#

Initializes the internal structures and variables used by the CDC EEM class.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

void USBD_CDC_EEM_Init (USBD_CDC_EEM_QTY_CFG   *p_qty_cfg,
                        RTOS_ERR               *p_err)

Arguments#

p_qty_cfg

Pointer to the configuration structure.

p_err

Pointer to the variable that will receive one of these returned error codes from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_NOT_AVAIL

  • RTOS_ERR_OS_ILLEGAL_RUN_TIME

  • RTOS_ERR_POOL_EMPTY

  • RTOS_ERR_BLK_ALLOC_CALLBACK

  • RTOS_ERR_SEG_OVF

Returned Value#

None.

Notes / Warnings#

None.

USBD_CDC_EEM_NetIF_Reg()#

Description#

Adds a new instance of the CDC EEM class AND registers a new Ethernet controller to the platform manager.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

CPU_INT08U  USBD_CDC_EEM_NetIF_Reg (CPU_CHAR                       **p_name,
                                    USBD_CDC_EEM_NET_IF_ETHER_CFG   *p_net_if_ether_cfg,
                                    RTOS_ERR                        *p_err)

Arguments#

p_name

Pointer to a string that will receive the Network Interface Name as registered in the platform manager.

p_net_if_ether_cfg

Pointer to structure containing the configurations related to the Ethernet Interface.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function:

  • RTOS_ERR_NONE

  • RTOS_ERR_SUBCLASS_INSTANCE_ALLOC

  • RTOS_ERR_ALREADY_EXISTS

  • RTOS_ERR_NOT_FOUND

  • RTOS_ERR_SEG_OVF

Returned Value#

  • Class instance number, if no errors are returned.

  • USBD_CLASS_NBR_NONE, if any errors are returned.

Notes / Warnings#

  1. Micrium OS Net Ethernet module MUST be available in your product to be able to use this function.

USBD_CDC_EEM_Add()#

Description#

Adds a new instance of the CDC EEM class.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

CPU_INT08U USBD_CDC_EEM_Add (RTOS_ERR   *p_err)

Arguments#

p_err

Pointer to the variable that will receive one of these returned error codes from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_SUBCLASS_INSTANCE_ALLOC

Returned Value#

  • Class instance number, if no errors are returned.

  • USBD_CLASS_NBR_NONE, if any errors are returned.

Notes / Warnings#

None.

USBD_CDC_EEM_ConfigAdd()#

Description#

Adds the CDC-EEM class instance into the specified configuration.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

void USBD_CDC_EEM_ConfigAdd ( CPU_INT08U    class_nbr,
                              CPU_INT08U    dev_nbr,
                              CPU_INT08U    config_nbr,
                        const CPU_CHAR     *p_if_name,
                              RTOS_ERR     *p_err)

Arguments#

class_nbr

Class instance number.

dev_nbr

Device number.

config_nbr

Configuration index to which to add the CDC-EEM class instance.

p_if_name

Pointer to the string that contains name of the CDC-EEM interface. Can be DEF_NULL.

p_err

Pointer to the variable that will receive one of these returned error codes from this function :

  • RTOS_ERR_NONE

  • RTOS_ERR_INVALID_DEV_STATE

  • RTOS_ERR_IF_ALT_ALLOC

  • RTOS_ERR_ALLOC

  • RTOS_ERR_IF_ALLOC

  • RTOS_ERR_INVALID_ARG

  • RTOS_ERR_EP_ALLOC

  • RTOS_ERR_EP_NONE_AVAIL

Returned Value#

None.

Notes / Warnings#

None.

USBD_CDC_EEM_IsConn()#

Description#

Gets the CDC-EEM class instance connection state.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

CPU_BOOLEAN USBD_CDC_EEM_IsConn (CPU_INT08U   class_nbr)

Arguments#

class_nbr

Class instance number.

Returned Value#

  • DEF_YES, if the class instance is connected.

  • DEF_NO, if the class instance is NOT connected.

Notes / Warnings#

None.

USBD_CDC_EEM_DevNbrGet#

Description#

Gets the device number associated to this CDC-EEM class instance.

Files#

usbd_cdc_eem.h/usbd_cdc_eem.c

Prototype#

CPU_INT08U USBD_CDC_EEM_DevNbrGet (CPU_INT08U  class_nbr,
                                   RTOS_ERR   *p_err)

Arguments#

class_nbr

Class instance number.

p_err

Pointer to the variable that will receive the returned error code from this function:

  • RTOS_ERR_NONE

Returned Value#

Device number.

Notes / Warnings#

None.