Macros | Functions | Variables
usb_dev_dman.c File Reference

This file implements the device manager functionality of the StarterWare USB device stack. This file defines the hardware resource map which lists contains device/gadget object. More...

#include "types.h"
#include "error.h"
#include "string.h"
#include "usb_dev_dman.h"
#include "usblib.h"

Macros

#define DISABLE_FEATURE   0
 

Functions

uint32_t USBDeviceInit (usbGadgetObj_t *pUsbGadgetObj, char *pName)
 This function initialises the USB gadget device object and then calls the init routine of the device controller which it represents. More...
 
void USBDInitCoreObject (void)
 This API initialise the gadget list with the core objects available.
 
uint32_t USBDevEndpt0Handler (struct usbGadgetObj *pUsbGadgetObj, usbEndpt0event_t endptEvent, usbSetupPkt_t *pSetup)
 This function handles the request EP0 requests which come from the lower layer driver. The protocol layer will interpret the setup packet and call the required function accordingly. More...
 
void usbEp0reqComplete (struct usbGadgetObj *pUsbGadgetObj, struct usbDevRequest *pReq)
 This function handles the USB EP0 request complete. More...
 
void usbSetupEpReq (void *pUsbGadgetObj, uint32_t epNum, uint32_t *pUsbData, usbTokenType_t tokenType, uint32_t length, usbTransferType_t transferType)
 

Variables

static const pFnStdRequest gUsbStdReqTable []
 Function table to handle standard requests.
 
usbGadgetObj_t gadgetList [MAX_NUM_DEVICE_CONTROLLERS]
 List of gadget controllers present in the system. More...
 
usbDevRequest_t req
 Global variable to contain the request which is to be made to the lower layer driver.
 

Detailed Description

This file implements the device manager functionality of the StarterWare USB device stack. This file defines the hardware resource map which lists contains device/gadget object.

Macro Definition Documentation

#define DISABLE_FEATURE   0

Copyright (c) Texas Instruments Incorporated 2015-2016

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

uint32_t USBDevEndpt0Handler ( struct usbGadgetObj pUsbGadgetObj,
usbEndpt0event_t  endptEvent,
usbSetupPkt_t pSetup 
)

This function handles the request EP0 requests which come from the lower layer driver. The protocol layer will interpret the setup packet and call the required function accordingly.

Parameters
pUsbGadgetObjpointer to the USB gadget object.
endptEventEndpoint event which has occured.
pSetuppointer to the setup packet received by the USB
uint32_t USBDeviceInit ( usbGadgetObj_t pUsbGadgetObj,
char *  pName 
)

This function initialises the USB gadget device object and then calls the init routine of the device controller which it represents.

Parameters
pointerto usb gadget object
pNamepointer to string containing controller instance name. this instance would be assigned with the string passed to it.
Return values
errorstatus- Status of the API call. Can be any of the following, S_PASS - indicates the operation is success E_FAIL - indicates the module is not enabled (timeout) E_INVALID_PARAM - gadget object pointer not valid
void usbEp0reqComplete ( struct usbGadgetObj pUsbGadgetObj,
struct usbDevRequest pReq 
)

This function handles the USB EP0 request complete.

Parameters
pUsbGadgetObjpointer to the USB gadget object.
pReqpointer to the USB request which has been completed
void usbSetupEpReq ( void *  pUsbGadgetObj,
uint32_t  epNum,
uint32_t *  pUsbData,
usbTokenType_t  tokenType,
uint32_t  length,
usbTransferType_t  transferType 
)

Setup Endpoint request. This request is requested by the class driver Same function is used for endpoint 0 and other endpoints request.

Parameters
pUsbGadgetObjpointer to the USB gadget object.
epNumEndpoint number on which the request has to be made.
pUsbDataPointer to the data in which data has been received or the data contained by this pointer is to be sent.
tokenTypeThe type of token or the direction field.
lengthLength of the transfer
transferTypeThe type of transfer which has to be initiated.

Variable Documentation

List of gadget controllers present in the system.

Copyright (c) Texas Instruments Incorporated 2015-2016

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Copyright 2016, Texas Instruments Incorporated