| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- Data Structures
- Data Structure Index
- Data Fields

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
USBD_CDC_API_T Struct Reference
Communication Device Class (CDC) Function Driver

## Detailed Description

CDC class API functions structure.

This module exposes functions which interact directly with USB device controller hardware.

Definition at line 240 of file usbd_cdcuser.h.

`#include "usbd_cdcuser.h"`

## Data Fields
uint32_t(* | GetMemSize )(USBD_CDC_INIT_PARAM_T *param)
ErrorCode_t(* | init )(USBD_HANDLE_T hUsb, USBD_CDC_INIT_PARAM_T *param, USBD_HANDLE_T *phCDC)
ErrorCode_t(* | SendNotification )(USBD_HANDLE_T hCdc, uint8_t bNotification, uint16_t data)

## Field Documentation

uint32_t(* GetMemSize)(USBD_CDC_INIT_PARAM_T *param)

Function to determine the memory required by the CDC function driver module.

This function is called by application layer before calling pUsbApi->CDC->Init(), to allocate memory used by CDC function driver module. The application should allocate the memory which is accessible by USB controller/DMA controller.

Note
  Some memory areas are not accessible by all bus masters.

Parameters

  [in] | param | Structure containing CDC function driver module initialization parameters.

Returns
  Returns the required memory size in bytes.

Function to determine the memory required by the CDC function driver module.

This function is called by application layer before calling pUsbApi->CDC->Init(), to allocate memory used by CDC function driver module. The application should allocate the memory which is accessible by USB controller/DMA controller.

Note
  Some memory areas are not accessible by all bus masters.

Parameters

  param | Structure containing CDC function driver module initialization parameters.

Returns
  Returns the required memory size in bytes.

Definition at line 253 of file usbd_cdcuser.h.

ErrorCode_t(* init)(USBD_HANDLE_T hUsb, USBD_CDC_INIT_PARAM_T *param, USBD_HANDLE_T *phCDC)

Function to initialize CDC function driver module.

This fuction is called by application layer to initialize CDC function driver module.

Parameters

  [in] | hUsb | Handle to the USB device stack.
  [in,out] | param | Structure containing CDC function driver module initialization parameters.

Returns
  Returns ErrorCode_t type to indicate success or error condition.

Return values

  LPC_OK | On success
  ERR_USBD_BAD_MEM_BUF | Memory buffer passed is not 4-byte aligned or smaller than required.
  ERR_API_INVALID_PARAM2 | Either CDC_Write() or CDC_Read() or CDC_Verify() callbacks are not defined.
  ERR_USBD_BAD_INTF_DESC | Wrong interface descriptor is passed.
  ERR_USBD_BAD_EP_DESC | Wrong endpoint descriptor is passed.

Function to initialize CDC function driver module.

This fuction is called by application layer to initialize CDC function driver module.

Parameters

  hUsb | Handle to the USB device stack.
  param | Structure containing CDC function driver module initialization parameters.

Returns
  Returns ErrorCode_t type to indicate success or error condition.

Return values

  LPC_OK | On success
  ERR_USBD_BAD_MEM_BUF | Memory buffer passed is not 4-byte aligned or smaller than required.
  ERR_API_INVALID_PARAM2 | Either CDC_Write() or CDC_Read() or CDC_Verify() callbacks are not defined.
  ERR_USBD_BAD_INTF_DESC | Wrong interface descriptor is passed.
  ERR_USBD_BAD_EP_DESC | Wrong endpoint descriptor is passed.

Definition at line 271 of file usbd_cdcuser.h.

ErrorCode_t(* SendNotification)(USBD_HANDLE_T hCdc, uint8_t bNotification, uint16_t data)

Function to initialize CDC function driver module.

This fuction is called by application layer to initialize CDC function driver module.

Parameters

  [in] | hUsb | Handle to the USB device stack.
  [in,out] | param | Structure containing CDC function driver module initialization parameters.

Returns
  Returns ErrorCode_t type to indicate success or error condition.

Return values

  LPC_OK | On success
  ERR_USBD_BAD_MEM_BUF | Memory buffer passed is not 4-byte aligned or smaller than required.
  ERR_API_INVALID_PARAM2 | Either CDC_Write() or CDC_Read() or CDC_Verify() callbacks are not defined.
  ERR_USBD_BAD_INTF_DESC | Wrong interface descriptor is passed.
  ERR_USBD_BAD_EP_DESC | Wrong endpoint descriptor is passed.

Function to initialize CDC function driver module.

This fuction is called by application layer to initialize CDC function driver module.

Parameters

  hUsb | Handle to the USB device stack.
  param | Structure containing CDC function driver module initialization parameters.

Returns
  Returns ErrorCode_t type to indicate success or error condition.

Return values

  LPC_OK | On success
  ERR_USBD_BAD_MEM_BUF | Memory buffer passed is not 4-byte aligned or smaller than required.
  ERR_API_INVALID_PARAM2 | Either CDC_Write() or CDC_Read() or CDC_Verify() callbacks are not defined.
  ERR_USBD_BAD_INTF_DESC | Wrong interface descriptor is passed.
  ERR_USBD_BAD_EP_DESC | Wrong endpoint descriptor is passed.

Definition at line 289 of file usbd_cdcuser.h.

The documentation for this struct was generated from the following files:

- C:/nxp/v1.03/lpcopen_v1.03/lpcopen/software/lpc_core/lpc_ip/usbd_rom/usbd_cdcuser.h
- C:/nxp/v1.03/lpcopen_v1.03/lpcopen/software/LPCUSBLib/Drivers/USB/Core/DCD/USBRom/usbd_cdcuser.h