香主来看看吧? USB初用 请教

[复制链接]
2652|6
 楼主| zhiyonghe 发表于 2011-5-31 10:39 | 显示全部楼层 |阅读模式
USB, ST, ic, ck, ni
本帖最后由 zhiyonghe 于 2011-5-31 16:01 编辑

STM32F10xUSBLib\Demos 里有: Audio_Speaker ;  Custom_HID  ; Device_Firmware_Upgrade ;  JoyStickMouse ;Mass_Storage   ; Virtual_COM_Port; 5个例子  其对应的 pProperty->Init() 有Joystick_init, MASS_init,……的初始化,想请教一下USB高手 这些模块主要用于什么场合??

主要是这四个 JoyStickMouse ;Mass_Storage   ; Virtual_COM_Port; Custom_HID  ;

我的应用中只是作为用于和PC机数据传输用的话那个更合适点?
 楼主| zhiyonghe 发表于 2011-5-31 11:10 | 显示全部楼层
那里有ST 提供的最新例程么??

安装的KEIL下的Demos 里找不到 usb_core.c /usb_init.c /usb-int.c /usb_mem.c /usb_regs.c…… 的文件

谢谢
 楼主| zhiyonghe 发表于 2011-5-31 16:06 | 显示全部楼层
本帖最后由 zhiyonghe 于 2011-6-1 13:29 编辑

下面是两个不同应用的 int();
  1. void USB_Init(void)
  2. {
  3. pInformation = &Device_Info;
  4. pInformation->ControlState = 2;
  5. pProperty = &Device_Property;
  6. pUser_Standard_Requests = &User_Standard_Requests;
  7. /* Initialize devices one by one */
  8. pProperty->Init();  
  9. }
pProperty->Init();  //这一句在不同的应用中指向下面各自的 int();

  1. void MASS_init()
  2. {
  3.   /* Update the serial number string descriptor with the data from the unique
  4.   ID*/
  5.   Get_SerialNum();
  6.   pInformation->Current_Configuration = 0;
  7.   /* Connect the device */
  8.   PowerOn();
  9.   /* USB interrupts initialization */
  10.   /* clear pending interrupts */
  11.   _SetISTR(0);
  12.   wInterrupt_Mask = IMR_MSK;
  13.   /* set interrupts mask */
  14.   _SetCNTR(wInterrupt_Mask);
  15.   bDeviceState = UNCONNECTED;
  16. }
  17. //==========================================================
  18. void Joystick_init(void)
  19. {
  20.   /* Update the serial number string descriptor with the data from the unique
  21.   ID*/
  22.   Get_SerialNum();
  23.   pInformation->Current_Configuration = 0;
  24.   /* Connect the device */
  25.   PowerOn();
  26.   /* USB interrupts initialization */
  27.   _SetISTR(0);               /* clear pending interrupts */
  28.   wInterrupt_Mask = IMR_MSK;
  29.   _SetCNTR(wInterrupt_Mask); /* set interrupts mask */
  30.   bDeviceState = UNCONNECTED;
  31. }

huatong 发表于 2011-5-31 20:10 | 显示全部楼层
我是用自定义的USB设备,加LIBUSB驱动,要的话就发给你吧
 楼主| zhiyonghe 发表于 2011-6-1 13:31 | 显示全部楼层
_crystal_ 发表于 2011-6-4 20:14 | 显示全部楼层
4# huatong
也发我一份好吗,谢谢。flying-in-rain@163.com
半个苹果 发表于 2011-6-4 23:54 | 显示全部楼层
4# huatong
同求,sunhanwen2009@126.com
谢谢拉
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:zhiyonghe  ~ 学 以 致 用 ~

131

主题

1265

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部