打印

如何设置HID Report Descriptor里的数据啊?

[复制链接]
6106|14
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
我想试着用usb suite里的CyBulk程序从电脑上传输一些字符然后显示到lcd上
编译程序的时候老是出现
!ERROR file 'usbfs_descr.o': undefined symbol 'USBFS_D0_C1_INTERFACE_LOOKUP'
的错误。

HID Report Descriptor该如何设置呢?
请高人指点!
沙发
jxin| | 2009-12-17 15:37 | 只看该作者
出现这个错误就是因为没有配置USB Wizard, 怎么配置在USBFS User Module 里有讲

使用特权

评论回复
板凳
nishuidegou|  楼主 | 2009-12-17 16:06 | 只看该作者
本帖最后由 nishuidegou 于 2009-12-17 16:26 编辑

HID Report Descriptor该如何设置怎么找不到啊

要是我想做那么一个在lcd上显示的话该怎么配置USBFS才好啊

我试着写了几个但usb suite 都找不到呢
谢谢

使用特权

评论回复
地板
jxin| | 2009-12-17 17:28 | 只看该作者
5
lobby| | 2009-12-17 20:30 | 只看该作者
学习了。

使用特权

评论回复
6
nishuidegou|  楼主 | 2009-12-18 10:52 | 只看该作者

能帮我看下这个对么

使用特权

评论回复
7
nishuidegou|  楼主 | 2009-12-18 10:55 | 只看该作者
我写的代码也顺便帮我看看哪有问题吧!多谢
#include         // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules
extern BYTE UsbResetFlag;

void main(void)
{

   BYTE str[8];//used to save data from pc
   BYTE EpState;//used to save the endpoint state
   WORD Size;//used to save the size of the data from pc
   
   M8C_EnableGInt;
   USBFS_Start(0,USB_5V_OPERATION);//start usb with 5
   while(1)
   {
   if(UsbResetFlag)
   {
   while(!USBFS_bGetConfiguration());// Wait for the USB device to enumerate
   
   USBFS_EnableOutEP(1);
   
   EpState=USBFS_bGetEPState(1);//Gets the Endpoint state for the specified endpoint
   
   while(!USBFS_bGetEPAckState(1));//Determines whether or not an ACK transaction occurred
                                   //on this endpoint by reading the ACK bit
                                   //in the control register of the endpoint
   Size=USBFS_wGetEPCount(1);//This functions returns the value of the endpoint count register
   
   USBFS_bReadOutEP(1,str,8);//Moves the specified number of bytes from endpoint RAM to data RAM
   
   LCD_Start();//display the state and the data
   LCD_Position(0,1);
   LCD_PrHexByte(EpState);
   LCD_Position(0,6);
   LCD_PrHexByte(Size);
   LCD_Position(1,1);
   LCD_PrString(str);
   UsbResetFlag = 0;
   }
   }

使用特权

评论回复
8
jxin| | 2009-12-18 18:41 | 只看该作者
要看你USB Wizard 中device attributes的配置情况, 你上边的图看不见吧

使用特权

评论回复
9
nishuidegou|  楼主 | 2009-12-18 21:40 | 只看该作者
本帖最后由 nishuidegou 于 2009-12-18 21:45 编辑

使用特权

评论回复
10
nishuidegou|  楼主 | 2009-12-18 21:45 | 只看该作者
帮忙请看下,谢谢

使用特权

评论回复
11
love_life| | 2009-12-19 00:59 | 只看该作者
帮顶

使用特权

评论回复
12
jxin| | 2009-12-22 15:01 | 只看该作者
9楼这样的配置至少不应该出现1楼所述的错误,如果HID Class Descriptor中HID Report的usb_lcd的descriptor配置正确的话,应该可以正确编译的。

使用特权

评论回复
13
nishuidegou|  楼主 | 2009-12-24 22:43 | 只看该作者
改了改可是还是无法从PC上接收数据显示到LCD上

使用特权

评论回复
14
jxin| | 2009-12-28 11:10 | 只看该作者
如何改的? 显示的结果是什么啊

使用特权

评论回复
15
贾君鹏子| | 2009-12-28 23:03 | 只看该作者
图太小了,都看不见

使用特权

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

本版积分规则

4

主题

16

帖子

1

粉丝