IOTON boards API using mbed SDK - http://ioton.cc/plataforma-ton

Dependents:   ton_demo ton_template

usb_user.c

Committer:
krebyy
Date:
2017-06-29
Revision:
3:9c7195d31602
Parent:
2:3a73d77c2cef

File content as of revision 3:9c7195d31602:

/* Ioton USBCD Library
 * Copyright (c) 2016 Ioton Technology
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "usb_user.h"


/* External Variables ------------------------------------------------------- */
extern PCD_HandleTypeDef hpcd;
USBD_HandleTypeDef USBD_Device;

/**
  * @brief USB initialization
  * @param None
  * @return None
  */
void initUSB(void)
{
	USBD_Init(&USBD_Device, &VCP_Desc, 0);
	USBD_RegisterClass(&USBD_Device, &USBD_CDC);
	USBD_CDC_RegisterInterface(&USBD_Device, &USBD_CDC_Template_fops);
	USBD_Start(&USBD_Device);
}


/**
  * @brief  This function handles USB-On-The-Go FS global interrupt request.
  * @param  None
  * @retval None
  */
void OTG_FS_IRQHandler(void)
{
    HAL_PCD_IRQHandler(&hpcd);
}