Damian Gabino / picoGW_mcu
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers usb_device.cpp Source File

usb_device.cpp

00001 /**
00002   ******************************************************************************
00003   * @file           : USB_DEVICE  
00004   * @version        : v1.0_Cube
00005   * @brief          : This file implements the USB Device 
00006   ******************************************************************************
00007   *
00008   * COPYRIGHT(c) 2016 STMicroelectronics
00009   *
00010   * Redistribution and use in source and binary forms, with or without modification,
00011   * are permitted provided that the following conditions are met:
00012   * 1. Redistributions of source code must retain the above copyright notice,
00013   * this list of conditions and the following disclaimer.
00014   * 2. Redistributions in binary form must reproduce the above copyright notice,
00015   * this list of conditions and the following disclaimer in the documentation
00016   * and/or other materials provided with the distribution.
00017   * 3. Neither the name of STMicroelectronics nor the names of its contributors
00018   * may be used to endorse or promote products derived from this software
00019   * without specific prior written permission.
00020   *
00021   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00022   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00023   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00024   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00025   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00026   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00027   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00028   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00030   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031   *
00032   ******************************************************************************
00033 */
00034 
00035 /* Includes ------------------------------------------------------------------*/
00036 
00037 #include "usb_device.h"
00038 #include "usbd_core.h"
00039 #include "usbd_desc.h"
00040 #include "usbd_cdc.h"
00041 #include "usbd_cdc_if.h"
00042 
00043 /* USB Device Core handle declaration */
00044 USBD_HandleTypeDef hUsbDeviceFS;
00045 
00046 /* init function */                     
00047 void MX_USB_DEVICE_Init(void)
00048 {
00049   /* Init Device Library,Add Supported Class and Start the library*/
00050   USBD_Init(&hUsbDeviceFS, &FS_Desc, DEVICE_FS);
00051 
00052   USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC);
00053 
00054   USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS);
00055 
00056   USBD_Start(&hUsbDeviceFS);
00057 
00058 }
00059 
00060 /**
00061   * @}
00062   */
00063 
00064 /**
00065   * @}
00066   */
00067 
00068 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00069