コード例 #1
0
//	Handle CLASS_INTERFACE requests
static
bool ClassInterfaceRequest(USBSetup& setup)
{
	u8 i = setup.wIndex;

	if (CDC_ACM_INTERFACE == i)
		return CDC_Setup(setup);

#ifdef PLUGGABLE_USB_ENABLED
	return PluggableUSB().setup(setup);
#endif
	return false;
}
コード例 #2
0
ファイル: Core.cpp プロジェクト: Dzenik/Cosa
static bool 
ClassInterfaceRequest(Setup& setup)
{
  uint8_t i = setup.wIndex;

#ifdef CDC_ENABLED
  if (CDC_ACM_INTERFACE == i) return (CDC_Setup(setup));
#endif

#ifdef HID_ENABLED
  if (HID_INTERFACE == i) return (HID_Setup(setup));
#endif

  return (false);
}
コード例 #3
0
ファイル: USBCore.cpp プロジェクト: Sonnenhans/arduino
//  Handle CLASS_INTERFACE requests
static
bool ClassInterfaceRequest(Setup& setup)
{
  u8 i = setup.wIndex;

#ifdef CDC_ENABLED
  if (CDC_ACM_INTERFACE == i)
    return CDC_Setup(setup);
#endif

#ifdef HID_ENABLED
#error NO
  if (HID_INTERFACE == i)
    return HID_Setup(setup);
#endif
  return false;
}
コード例 #4
0
ファイル: csl_cdc.c プロジェクト: psucurran/NoiseNinjas
/** ============================================================================
 *   @n@b CDC_Open
 *
 *   @b Description
 *   @n This function Opens the CDC module. It initializes CDC and Ctrl handles
 *      with the data given by the application.
 *
 *      NOTE: THIS FUNCTION CONFIGURES USB CDC MODULE IN HIGH SPEED MODE
 *
 *   @b Arguments
 *   @verbatim
		    pAppClassHandle      Application handle to the CDC Class Obj
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li        CSL_SOK                   - Returned for success
 *   @li        CSL_ESYS_BADHANDLE        - Invalid CDC handle
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Initializes CDC and Ctrl handles
 *
 *   @b Modifies
 *   @n CDC and Ctrl handle data
 *
 *   @b Example
 *   @verbatim
			CSL_CdcInitStructApp    cdcAppHandle;
			pCdcAppClassHandle      pAppClassHandle;
			Uint16                  cdcAppBuffer[420];
			CSL_Status              status;

			pAppClassHandle = &mscAppHandle;

			// Assign values to all the members in cdcAppHandle struct
			cdcAppHandle.pCdcObj = &cdcAppBuffer[0];
			.....
			.....
			status = CDC_Open(pAppClassHandle);
     @endverbatim
 *  ============================================================================
 */
CSL_Status CDC_Open(pCdcAppClassHandle    pAppClassHandle)
{
	CSL_Status    status;

	status = CSL_SOK;

	if(pAppClassHandle != NULL)
	{
		status = CDC_Setup(pAppClassHandle, TRUE);
	}
	else
	{
		status = CSL_ESYS_BADHANDLE;
	}

	return(status);
}
コード例 #5
0
ファイル: csl_cdc.c プロジェクト: psucurran/NoiseNinjas
/** ============================================================================
 *   @n@b CDC_OpenFullspeed
 *
 *   @b Description
 *   @n This function Opens the Cdc module for fullspeed mode operation. It
 *      initializes Cdc and Ctrl handles with the data given by the application
 *
 *      NOTE: THIS FUNCTION CONFIGURES USB CDC MODULE IN FULLSPEED MODE
 *
 *   @b Arguments
 *   @verbatim
		    pAppClassHandle      Application handle to the CDC Class Obj
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li        CSL_SOK                   - Returned for success
 *   @li        CSL_ESYS_BADHANDLE        - Invalid Cdc handle
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Initializes Cdc and Ctrl handles
 *
 *   @b Modifies
 *   @n Cdc and Ctrl handle data
 *
 *   @b Example
 *   @verbatim
			CSL_CdcInitStructApp    cdcAppHandle;
			pCdcAppClassHandle      pAppClassHandle;
			Uint16                  cdcAppBuffer[420];
			CSL_Status              status;

			pAppClassHandle = &cdcAppHandle;

			// Assign values to all the members in cdcAppHandle struct
			cdcAppHandle.pCdcObj = &cdcAppBuffer[0];
			.....
			.....
			status = CDC_OpenFullspeed(pAppClassHandle);
     @endverbatim
 *  ============================================================================
 */
CSL_Status CDC_OpenFullspeed(pCdcAppClassHandle    pAppClassHandle)
{
	CSL_Status    status;

	status = CSL_SOK;

	if(pAppClassHandle != NULL)
	{
		status = CDC_Setup(pAppClassHandle, FALSE);
		USB_setFullSpeedMode(CSL_USB_EP0_PACKET_SIZE);
	}
	else
	{
		status = CSL_ESYS_BADHANDLE;
	}

	return(status);
}
コード例 #6
0
ファイル: USBCore.cpp プロジェクト: joberec/Arduino_Boards
bool USBDeviceClass::handleClassInterfaceSetup(USBSetup& setup)
{
	uint8_t i = setup.wIndex;

	#if defined(CDC_ENABLED)
	if (CDC_ACM_INTERFACE == i)
	{
		if (CDC_Setup(setup) == false) {
			sendZlp(0);
		}
		return true;
	}
	#endif

	#if defined(PLUGGABLE_USB_ENABLED)
	bool ret = PluggableUSB().setup(setup);
	if ( ret == false) {
		sendZlp(0);
	}
	return ret;
	#endif

	return false;
}