USB host development aims to provide host-related functions, including protocol encapsulation, device management, and driver installation and uninstall.
USB device development aims to provide device-related functions, including device management, configuration management, and I/O management. These functions implement creation, configuration, and data communication of USB devices.
The following figures show the UBS host and device driver models.
The following figures show the USB host and device driver models.
**Figure 1** USB host driver model<aname="fig1649563542917"></a>
- The USB host Driver Development Kit (DDK) provides driver capability APIs that can be directly called in user mode. The APIs can be classified into the DDK initialization class, interface operation class, and request operation class by function. These APIs can be used to perform DDK initialization, bind/release and open/close an interface, allocate/release a request, and implement synchronous or asynchronous transfer.
- The USB device DDK provides device management, I/O management, and configuration management APIs, which can be used to create and delete a device, obtain/open an interface, and perform synchronous or asynchronous transfer.
### Available APIs(<a name="section141mcpsimp"></a>)
[Figure 1](#fig1649563542917) describes the APIs provided by the USB host driver model.
**Table 1** APIs provided by the USB host driver model
<tdclass="cellrowborder"valign="top"width="33.33333333333333%"headers="mcps1.2.4.1.3 "><pid="p27252992712"><aname="p27252992712"></a><aname="p27252992712"></a>Initializes the USB host driver DDK.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p172549192711"><aname="p172549192711"></a><aname="p172549192711"></a>Exits the USB host driver DDK.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p187255962716"><aname="p187255962716"></a><aname="p187255962716"></a>Obtains a USB interface.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p117251894270"><aname="p117251894270"></a><aname="p117251894270"></a>Releases a USB interface.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p157251914278"><aname="p157251914278"></a><aname="p157251914278"></a>Adds or removes a USB interface.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p67254915272"><aname="p67254915272"></a><aname="p67254915272"></a>Opens a USB interface.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p67251095276"><aname="p67251095276"></a><aname="p67251095276"></a>Closes a USB interface.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p6725109112720"><aname="p6725109112720"></a><aname="p6725109112720"></a>Sets a USB interface.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p107261298272"><aname="p107261298272"></a><aname="p107261298272"></a>Obtains USB pipe information.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p177261797274"><aname="p177261797274"></a><aname="p177261797274"></a>Clears the state of the pipe with the specified index.</p>
</td>
</tr>
<trid="row1757189172714"><tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.1 "><pid="p1726998273"><aname="p1726998273"></a><aname="p1726998273"></a>struct UsbRequest *UsbAllocRequest(const UsbInterfaceHandle *interfaceHandle, int isoPackets, int length);</p>
</td>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p1272617982713"><aname="p1272617982713"></a><aname="p1272617982713"></a>Allocates a request object.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p177271592271"><aname="p177271592271"></a><aname="p177271592271"></a>Releases a request object.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p372714942718"><aname="p372714942718"></a><aname="p372714942718"></a>Sends an asynchronous request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p872713910270"><aname="p872713910270"></a><aname="p872713910270"></a>Fills in a request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p37271897276"><aname="p37271897276"></a><aname="p37271897276"></a>Cancels an asynchronous request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p87279914277"><aname="p87279914277"></a><aname="p87279914277"></a>Sends a synchronous request.</p>
<tdclass="cellrowborder"valign="top"width="33.33333333333333%"headers="mcps1.2.4.1.3 "><pid="p1572711919272"><aname="p1572711919272"></a><aname="p1572711919272"></a>Initializes the USB raw APIs.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p372710942717"><aname="p372710942717"></a><aname="p372710942717"></a>Exits the USB raw APIs.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p1772719972717"><aname="p1772719972717"></a><aname="p1772719972717"></a>Opens a USB device.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p1372715902711"><aname="p1372715902711"></a><aname="p1372715902711"></a>Closes a USB device.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p272715932717"><aname="p272715932717"></a><aname="p272715932717"></a>Performs a control transfer synchronously.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p872789162713"><aname="p872789162713"></a><aname="p872789162713"></a>Performs a bulk transfer synchronously.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p117271895271"><aname="p117271895271"></a><aname="p117271895271"></a>Performs an interrupt transfer synchronously.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p472714912710"><aname="p472714912710"></a><aname="p472714912710"></a>Obtains the configuration descriptor of a device.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p772759162711"><aname="p772759162711"></a><aname="p772759162711"></a>Releases the memory space of a configuration descriptor.</p>
</td>
</tr>
<trid="row9756119182711"><tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.1 "><pid="p3727699274"><aname="p3727699274"></a><aname="p3727699274"></a>int UsbRawGetConfiguration(const UsbRawHandle *devHandle, int *config);</p>
</td>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p13728109192717"><aname="p13728109192717"></a><aname="p13728109192717"></a>Obtains the configuration in use.</p>
</td>
</tr>
<trid="row37567922714"><tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.1 "><pid="p1872849162718"><aname="p1872849162718"></a><aname="p1872849162718"></a>int UsbRawSetConfiguration(const UsbRawHandle *devHandle, int config);</p>
</td>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p87280914277"><aname="p87280914277"></a><aname="p87280914277"></a>Sets the configuration in use.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p472879202719"><aname="p472879202719"></a><aname="p472879202719"></a>Obtains the device pointer based on the device handle.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p8728139172715"><aname="p8728139172715"></a><aname="p8728139172715"></a>Obtains the device descriptor of the specified USB device.</p>
</td>
</tr>
<trid="row117561919273"><tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.1 "><pid="p072820912714"><aname="p072820912714"></a><aname="p072820912714"></a>int UsbRawClaimInterface(const UsbRawHandle *devHandle, int interfaceNumber);</p>
</td>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p972817914279"><aname="p972817914279"></a><aname="p972817914279"></a>Declares the interface on the specified device handle.</p>
</td>
</tr>
<trid="row87561920275"><tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.1 "><pid="p2728191276"><aname="p2728191276"></a><aname="p2728191276"></a>int UsbRawReleaseInterface(const UsbRawHandle *devHandle, int interfaceNumber);</p>
</td>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p8728159102710"><aname="p8728159102710"></a><aname="p8728159102710"></a>Releases the previously declared interface.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p107281992272"><aname="p107281992272"></a><aname="p107281992272"></a>Resets a device.</p>
</td>
</tr>
<trid="row14756109152719"><tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.1 "><pid="p137288914273"><aname="p137288914273"></a><aname="p137288914273"></a>struct UsbRawRequest *UsbRawAllocRequest(const UsbRawHandle *devHandle, int isoPackets, int length);</p>
</td>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p27281797274"><aname="p27281797274"></a><aname="p27281797274"></a>Allocates a transfer request with the specified number of sync packet descriptors.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p17281917278"><aname="p17281917278"></a><aname="p17281917278"></a>Releases the previously allocated transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p117281090271"><aname="p117281090271"></a><aname="p117281090271"></a>Fills in a bulk transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p177281299278"><aname="p177281299278"></a><aname="p177281299278"></a>Fills in a control setup packet.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p1372815952715"><aname="p1372815952715"></a><aname="p1372815952715"></a>Fills in a control transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p19728092271"><aname="p19728092271"></a><aname="p19728092271"></a>Fills in an interrupt transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p107281913275"><aname="p107281913275"></a><aname="p107281913275"></a>Fills in an isochronous transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p187299922718"><aname="p187299922718"></a><aname="p187299922718"></a>Submits a transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p872912911274"><aname="p872912911274"></a><aname="p872912911274"></a>Cancels a transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p572929102710"><aname="p572929102710"></a><aname="p572929102710"></a>Handles a transfer request event.</p>
</td>
</tr>
</tbody>
</table>
[Figure 2](#fig8847615103013) describes the APIs provided by the USB device driver model.
**Table 2** APIs provided by the USB device driver model
<tdclass="cellrowborder"valign="top"width="33.33333333333333%"headers="mcps1.2.4.1.3 "><pid="p241853152716"><aname="p241853152716"></a><aname="p241853152716"></a>Creates a USB device.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p5435318271"><aname="p5435318271"></a><aname="p5435318271"></a>Deletes a USB device.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p54135392719"><aname="p54135392719"></a><aname="p54135392719"></a>Obtains a USB device.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p124453132715"><aname="p124453132715"></a><aname="p124453132715"></a>Closes an interface.</p>
<tdclass="cellrowborder"valign="top"width="33.33333333333333%"headers="mcps1.2.4.1.3 "><pid="p5514538278"><aname="p5514538278"></a><aname="p5514538278"></a>Applies for a control transfer request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p105105342716"><aname="p105105342716"></a><aname="p105105342716"></a>Applies for a data request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p26165372718"><aname="p26165372718"></a><aname="p26165372718"></a>Releases a request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p361253112718"><aname="p361253112718"></a><aname="p361253112718"></a>Sends an asynchronous request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p06853112710"><aname="p06853112710"></a><aname="p06853112710"></a>Sends a synchronous request.</p>
<tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.2 "><pid="p13725312275"><aname="p13725312275"></a><aname="p13725312275"></a>Cancels a request.</p>
</td>
</tr>
</tbody>
</table>
## Development Guidelines<a name="section581mcpsimp"></a>
- The USB device DDK provides device management, I/O management, and configuration management APIs, which can be used to create or delete a device, obtain or open an interface, and perform synchronous or asynchronous transfer.
### Available APIs
The tables below describe the APIs provided by the USB host driver model.
**Table 1** usb_ddk_interface.h
| API| Description|
| -------- | -------- |
| int32_t UsbInitHostSdk(struct UsbSession \*\*session); | Initializes the USB host driver DDK.|
| int32_t UsbExitHostSdk(const struct UsbSession<br>\*session); | Exits the USB host driver DDK.|
| const struct UsbInterface \*UsbClaimInterface(const<br>struct UsbSession \*session, uint8_t busNum, uint8_t<br>usbAddr, uint8_t interfaceIndex); | Obtains a USB interface.|
| int UsbReleaseInterface(const struct UsbInterface<br>\*interfaceObj); | Releases a USB interface.|
| int UsbAddOrRemoveInterface(const struct UsbSession<br>\*session, uint8_t busNum, uint8_t usbAddr, uint8_t<br>interfaceIndex, UsbInterfaceStatus status); | Adds or removes a USB interface.|
| UsbInterfaceHandle \*UsbOpenInterface(const struct<br>UsbInterface \*interfaceObj); | Opens a USB interface.|
| int32_t UsbCloseInterface(const UsbInterfaceHandle<br>\*interfaceHandle); | Closes a USB interface.|
| int32_t UsbSelectInterfaceSetting(const<br>UsbInterfaceHandle \*interfaceHandle, uint8_t<br>settingIndex, struct UsbInterface \*\*interfaceObj); | Sets a USB interface.|
| int32_t UsbGetPipeInfo(const UsbInterfaceHandle<br>\*interfaceHandle, uint8_t settingIndex, uint8_t pipeId,<br>struct UsbPipeInfo \*pipeInfo); | Obtains USB pipe information.|
| int32_t UsbClearInterfaceHalt(const<br>UsbInterfaceHandle \*interfaceHandle, uint8_t<br>pipeAddress); | Clears the state of the pipe with the specified index.|
| struct UsbRequest \*UsbAllocRequest(const<br>UsbInterfaceHandle \*interfaceHandle, int isoPackets<br>, int length); | Allocates a request object.|
| int UsbFreeRequest(const struct UsbRequest<br>\*request); | Releases a request object.|
| int UsbSubmitRequestAsync(const struct UsbRequest<br>\*request); | Sends an asynchronous request.|
| int32_t UsbFillRequest(const struct UsbRequest<br>\*request, const UsbInterfaceHandle \*interfaceHandle,<br>const struct UsbRequestParams \*params); | Fills in a request.|
| sint UsbCancelRequest(const struct UsbRequest<br>\*request); | Cancels an asynchronous request.|
| int UsbSubmitRequestSync(const struct UsbRequest<br>\*request); | Sends a synchronous request.|
**Table 2** usb_raw_api.h
| API| Description|
| -------- | -------- |
| int UsbRawInit(struct UsbSession \*\*session); | Initializes the USB raw APIs.|
| int UsbRawExit(const struct UsbSession \*session); | Exits the USB raw APIs.|
| UsbRawHandle \*UsbRawOpenDevice(const struct<br>UsbSession \*session, uint8_t busNum, uint8_t<br>usbAddr); | Opens a USB device.|
| int UsbRawCloseDevice(const UsbRawHandle<br>\*devHandle); | Closes a USB device.|
| int UsbRawSendControlRequest(const struct<br>UsbRawRequest \*request, const UsbRawHandle<br>\*devHandle, const struct UsbControlRequestData<br>\*requestData); | Performs a control transfer synchronously.|
| int UsbRawSendBulkRequest(const struct<br>UsbRawRequest \*request, const UsbRawHandle<br>\*devHandle, const struct UsbRequestData<br>\*requestData); | Performs a bulk transfer synchronously.|
| int UsbRawSendInterruptRequest(const struct<br>UsbRawRequest \*request, const UsbRawHandle<br>\*devHandle, const struct UsbRequestData<br>\*requestData); | Performs an interrupt transfer synchronously.|
| int UsbRawGetConfigDescriptor(const UsbRawDevice<br>\*rawDev, uint8_t configIndex, struct<br>UsbRawConfigDescriptor \*\*config); | Obtains the configuration descriptor of a device.|
| void UsbRawFreeConfigDescriptor(const struct<br>UsbRawConfigDescriptor \*config); | Releases the memory space of a configuration descriptor.|
| int UsbRawGetConfiguration(const UsbRawHandle<br>\*devHandle, int \*config); | Obtains the configuration in use.|
| int UsbRawSetConfiguration(const UsbRawHandle<br>\*devHandle, int config); | Sets the configuration in use.|
| UsbRawDevice \*UsbRawGetDevice(const UsbRawHandle<br>\*devHandle); | Obtains the device pointer based on the device handle.|
| int UsbRawGetDeviceDescriptor(const UsbRawDevice<br>\*rawDev, struct<br>UsbDeviceDescriptor \*desc); | Obtains the device descriptor of the specified USB device.|
| int UsbRawClaimInterface(const UsbRawHandle<br>\*devHandle, int<br>interfaceNumber); | Declares the interface on the specified device handle.|
| int UsbRawReleaseInterface(const UsbRawHandle<br>\*devHandle, in<br>t interfaceNumber); | Releases the previously declared interface.|
| int UsbRawResetDevice(const UsbRawHandle<br>\*devHandle); | Resets a device.|
| struct UsbRawRequest \*UsbRawAllocRequest(const<br>UsbRawHandle<br>\*devHandle, int isoPackets, int length); | Allocates a transfer request with the specified number of sync packet descriptors.|
| int UsbRawFreeRequest(const struct UsbRawRequest<br>\*request); | Releases the previously allocated transfer request.|
| int UsbRawFillBulkRequest(const struct UsbRawRequest<br>\*request, const UsbRawHandle \*devHandle, const struct<br>UsbRawFillRequestData \*fillData); | Fills in a bulk transfer request.|
| int UsbRawFillControlSetup(const unsigned char \*setup,<br>const struct UsbControlRequestData \*requestData); | Fills in a control setup packet.|
| int UsbRawFillControlRequest(const struct UsbRawRequest<br>\*request, const UsbRawHandle \*devHandle, const struct<br>UsbRawFillRequestData \*fillData); | Fills in a control transfer request.|
| int UsbRawFillInterruptRequest(const struct UsbRawRequest<br>\*request, const UsbRawHandle \*devHandle, const struct<br>UsbRawFillRequestData \*fillData); | Fills in an interrupt transfer request.|
| int UsbRawFillIsoRequest(const struct UsbRawRequest<br>\*request, const UsbRawHandle \*devHandle, const struct<br>UsbRawFillRequestData \*fillData); | Fills in an isochronous transfer request.|
| int UsbRawSubmitRequest(const struct UsbRawRequest<br>\*request); | Submits a transfer request.|
| int UsbRawCancelRequest(const struct UsbRawRequest<br>\*request); | Cancels a transfer request.|
| int UsbRawHandleRequests(const UsbRawHandle<br>\*devHandle); | Handles a transfer request event.|
The tables below describe the APIs provided by the USB device driver model.
**Table 3** usbfn_device.h
| API| Description|
| -------- | -------- |
| const struct UsbFnDevice \*UsbFnCreateDevice(const<br>char \*udcName, const struct UsbFnDescriptorData<br>\*descriptor); | Creates a USB device.|
| int UsbFnRemoveDevice(struct UsbFnDevice<br>\*fnDevice); | Deletes a USB device.|
| const struct UsbFnDevice \*UsbFnGetDevice(const char<br>\*udcName); | Obtains a USB device.|
| struct UsbFnRequest<br>\*UsbFnAllocCtrlRequest(UsbFnInterfaceHandle handle,<br>uint32_t len); | Allocates a control transfer request.|
| struct UsbFnRequest \*UsbFnAllocRequest(UsbFnInterfaceHandle handle,<br>uint8_t pipe, uint32_t len); | Allocates a data request.|
| int UsbFnFreeRequest(struct UsbFnRequest \*req); | Releases a request.|
| int UsbFnSubmitRequestAsync(struct UsbFnRequest<br>\*req); | Sends an asynchronous request.|
| int UsbFnSubmitRequestSync(struct UsbFnRequest<br>\*req, uint32_t timeout); | Sends a synchronous request.|
| int UsbFnCancelRequest(struct UsbFnRequest \*req); | Cancels a request.|
## How to Develop
The USB driver is developed based on the Hardware Driver Foundation (HDF), platform, and Operating System Abstraction Layer (OSAL) APIs. A unified driver model is provided for USB devices, irrespective of the operating system and chip architecture. This document uses a serial port as an example to describe how to develop drivers for the USB host and USB device.
### How to Develop<a name="section583mcpsimp"></a>
### Developing Driver Using Host DDK APIs<a name="section584mcpsimp"></a>
### Developing Driver Using Host DDK APIs
1. Configure the driver mapping table.
2. Initialize the USB host DDK.
3. Obtain a **UsbInterface** object.
4. Open the **UsbInterface** object to obtain the **UsbInterfaceHandle** object.
5. Obtain pipe information of the specified **pipeIndex** based on the **UsbInterfaceHandle** object.
6. Allocate an I/O request for the **UsbInterfaceHandle** object.
7. Fill in the I/O request based on the input parameters.
8. Submit the I/O request in synchronous or asynchronous mode.
### Developing Driver Using Host Raw APIs<a name="section594mcpsimp"></a>
### Developing Driver Using Host Raw APIs
1. Configure the driver mapping table.
2. Initialize the host raw data, open the USB device, obtain the descriptor, and then obtain interface and endpoint information based on the descriptor.
3. Allocate a request and fill in the request based on the transfer type.
4. Submit the I/O request in synchronous or asynchronous mode.
### Developing Driver Using Device DDK APIs<a name="section600mcpsimp"></a>
### Developing Driver Using Device DDK APIs
1. Construct a descriptor.
2. Instantiate a USB device using the descriptor constructed.
3. Call **UsbFnDeviceGetInterface** to obtain an interface, call **UsbFnInterfaceGetPipeInfo** to obtain pipe information based on the interface, call **UsbFnInterfaceOpen** to open the interface to obtain the handle, and call **UsbFnRequestAlloc** to obtain the request based on the handle and pipe ID.
4. Call **UsbFnInterfaceStartRecvEvent** to receive events such as Enable and Setup, and respond to the events in **UsbFnEventCallback**.
5. Send and receive data in synchronous or asynchronous mode.
## Development Examples<a name="section607mcpsimp"></a>
## Development Example
The following examples help you better understand the development of the USB serial port driver.
### Developing Driver Using Host DDK APIs<a name="section609mcpsimp"></a>
### Developing Driver Using Device DDK APIs<a name="section615mcpsimp"></a>
The core code of the USB Abstract Control Model (ACM) device is available in **drivers/peripheral/usb/gadget/function/acm/cdcacm.c**. The following is an example:
### Developing Driver Using Device DDK APIs
The core code of the USB Abstract Control Model (ACM) device is available in **drivers\peripheral\usb\gadget\function\acm\cdcacm.c**. The following is an example.