打印

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

[复制链接]
1937|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();
void USB_Init(void)
{
pInformation = &Device_Info;
pInformation->ControlState = 2;
pProperty = &Device_Property;
pUser_Standard_Requests = &User_Standard_Requests;
/* Initialize devices one by one */
pProperty->Init();  
}
pProperty->Init();  //这一句在不同的应用中指向下面各自的 int();
 
void MASS_init()
{
  /* Update the serial number string descriptor with the data from the unique
  ID*/
  Get_SerialNum();
  pInformation->Current_Configuration = 0;
  /* Connect the device */
  PowerOn();
  /* USB interrupts initialization */
  /* clear pending interrupts */
  _SetISTR(0);
  wInterrupt_Mask = IMR_MSK;
  /* set interrupts mask */
  _SetCNTR(wInterrupt_Mask);
  bDeviceState = UNCONNECTED;
}
//==========================================================
void Joystick_init(void)
{
  /* Update the serial number string descriptor with the data from the unique
  ID*/
  Get_SerialNum();
  pInformation->Current_Configuration = 0;
  /* Connect the device */
  PowerOn();
  /* USB interrupts initialization */
  _SetISTR(0);               /* clear pending interrupts */
  wInterrupt_Mask = IMR_MSK;
  _SetCNTR(wInterrupt_Mask); /* set interrupts mask */
  bDeviceState = UNCONNECTED;
}

使用特权

评论回复
地板
huatong| | 2011-5-31 20:10 | 只看该作者
我是用自定义的USB设备,加LIBUSB驱动,要的话就发给你吧

使用特权

评论回复
5
zhiyonghe|  楼主 | 2011-6-1 13:31 | 只看该作者

使用特权

评论回复
6
_crystal_| | 2011-6-4 20:14 | 只看该作者
4# huatong
也发我一份好吗,谢谢。flying-in-rain@163.com

使用特权

评论回复
7
半个苹果| | 2011-6-4 23:54 | 只看该作者
4# huatong
同求,sunhanwen2009@126.com
谢谢拉

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

131

主题

1265

帖子

1

粉丝