首页 > 其他分享 >void USB_Init(uint8_t corenum, uint8_t mode);

void USB_Init(uint8_t corenum, uint8_t mode);

时间:2022-11-01 19:45:31浏览次数:48  
标签:function USB corenum uint8 host mode device 枚举

/* Function Prototypes: */
        /** Main function to initialize and start the USB interface. Once active, the USB interface will
         *  allow for device connection to a host when in device mode, or for device enumeration while in
         *  host mode.
         *
         *  As the USB library relies on interrupts for the device and host mode enumeration processes,
         *  the user must enable global interrupts before or shortly after this function is called. In
         *  device mode, interrupts must be enabled within 500ms of this function being called to ensure
         *  that the host does not time out whilst enumerating the device. In host mode, interrupts may be
         *  enabled at the application's leisure however enumeration will not begin of an attached device
         *  until after this has occurred.
         *
         *  Calling this function when the USB interface is already initialized will cause a complete USB
         *  interface reset and re-enumeration.
         *
         *  \see @ref Group_Device for the \c USB_DEVICE_OPT_* masks.

/*函数原型: */
/**主功能,可初始化和启动USB接口。一旦激活,USB接口就会启动
*允许在设备模式下将设备连接到主机,或在设备模式下进行设备枚举
*主机模式。
*
*由于USB库依赖于设备和主机模式枚举进程的中断,
*用户必须在调用此函数之前或之后不久启用全局中断。在
*设备模式,中断必须在500 ms内启用,以确保
*主机在枚举设备时没有超时。在主机模式下,中断可能是
*在应用程序空闲时启用,但枚举不会开始附加设备
*直到这一切发生之后。
*
*当USB接口已经初始化时,调用此功能将导致一个完整的USB
*接口重置和重新枚举。
*
*\参见@refGrece_USB_DEVICE_OPT_*掩码。

标签:function,USB,corenum,uint8,host,mode,device,枚举
From: https://www.cnblogs.com/hshy/p/16848900.html

相关文章

  • usb设备模式 主机模式
          enumUSB_Modes_t{         USB_MODE_None  =0,         /**<Indicatesthatthecontrolleriscurrentlynotinitialized......
  • usb hid报告描述符
    USB/HID设备报告描述符详解(3) USB描述符即USB设备的信息,系统设备列举所要执行的工作之一,即是取得这些有关于设各的相关信息,之后设备才能被系统识别使用。在图的......
  • usb vid pid 16进制定义
    #include"stdafx.h"#include<iostream>usingnamespacestd;typedefunsignedcharuint8_t;/*FollowingUSBDevicestatus*/typedefenum{U......
  • USB_CfgTypeDef
    /** *@brief USBInitializationStructuredefinition */typedefstruct{ uint32_tdev_endpoints;          /*!<DeviceEndpointsnumber.   ......
  • STM32 USB学习笔记6
    主机环境:Windows7SP1开发环境:MDK5.14目标板:STM32F103C8T6开发库:STM32F1Cube库和STM32_USB_Device_Library现在来分析哈USB器件库代码,先来看usbd_core文件,其头文件只......
  • usb协议分析
    STM32USB协议和代码分析一前言:usb接口是一个非常重要的通信接口,它的协议是有些复杂的。作为一个工程师,对usb协议和代码进行分析,是一个必备的素质和技能。最近......
  • USBD_CUSTOM_HID
     if(USBD_RegisterClass(&hUsbDeviceFS,&USBD_CUSTOM_HID)!=USBD_OK) {   Error_Handler(); }USBD_ClassTypeDef USBD_CUSTOM_HID={ USBD_CUSTOM_HID_......
  • usb描述符
    /**@defgroupUSBD_DESC_Private_VariablesUSBD_DESC_Private_Variables *@briefPrivatevariables. *@{ */USBD_DescriptorsTypeDefFS_Desc={ USBD_FS_Dev......
  • USBD_HandleTypeDef
    /*USBDevicehandlestructure*/在DEVICE库里面,最主要的数据结构是USBD_HandleTypeDef,它将USB传输中的数据抽象到该数据结构内.该结构体包含所有变量和结构体,用以实时......
  • USB_LP_CAN1_RX0_IRQn一直重定义
    USB_LP_CAN1_RX0_IRQn一直重定义怎么回事  keil5编译,想要用CAN接收中断接收数据,出现"USB_LP_CAN1_RX0_IRQn"hasalreadybeendeclaredinthecurrentscop......