完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我想在FX3板上读写I2C EEPROM,使用UBI2CREGMODE示例固件项目。但我不能理解这个过程。项目自述文件说:“该设备仅作为一个特定于控制端点的供应商专用USB设备,并提供一组供应商命令来读取/写入I2C EEPROM设备上的数据。”
这就是全部。没有其他信息是如何实现的。当我查看“CyfxUsSubUPCB”回调函数和“CyfxUsBi2cTele'”函数时,可以产生回调函数的“StUpDAT0”和“StuuDAT1”参数。1。如何用“SUPUTATD0”和“SUTUPDAT1”生成供应商命令?2。如何在“USB控制中心”中发送供应商命令?三。当我发送一个读命令时,我如何观察数据?4。当我想写EEPROM时,如何发送EEPROM数据?如果有人帮助我,我将不胜感激。问候,Ali 以上来自于百度翻译 以下为原文 Hello, I want to read/write I2C EEPROM on the FX3 board with U***I2cRegMode example firmware project. But I couldn't understand the process. Project readme file says, " The device enumerates as a vendor specific USB device with only the control endpoint and provides a set of vendor commands to read/write the data on I2C EEPROM devices.". That's all. There is no additional information how it can be realized. When I look over "CyFxUSBSetupCB" callback function and "CyFxU***I2cTransfer" function, I can produce callback function's "setupdat0" and "setupdat1" parameters. 1. How can I generate vendor commands with "setupdat0" and "setupdat1"? 2. How can I send vendor commands within "USB Control Center"? 3. When I send a read command, how can I observe the data? 4. When I want to write to EEPROM, how can I send the EEPROM data? I would appreciate, if someone help me. Regards, Ali |
|
相关推荐
2个回答
|
|
您好!
在USB控制中心突出显示控件端点,单击数据传输选项卡,然后输入以下字段中的值,以适合应用程序 指引方向 类型供应商 目标设备 重新编码您的供应商代码 你决定了吗? 你决定的WiDEX USB安装数据是由主机PC发送的一个8字节数组,这些存储在StudioDAT0和StudiUpDAT1中,固件随后解析以解码包含在设置数据中的控制信息。在EEPROM示例(CyfxUsBi2CurgMo.c)中,这是在下面的代码中完成的 /*解析控制请求参数。*/ AtTu=(UIT88T)(StuuDAT0&AMP;0x000 000 FFF); RQT=(UIT88T)((StuuDAT0&AMP;0x00 000 FF00)& gt;& gt;8); 值=(UTIN 16t)(StuuDAT0&GT;GT;16); 索引=(UTI1616T)(SETUPDAT1和0x0.00 FFFF); 长度=(UTIN 16t)(StuuDATD1 & Gt;gt;16); AtTr是请求类型,当您选择供应商时,将由控制中心设置。 RQT是用户供应商代码,在这个例子中,EEPROM读取代码显示 Cyfxfxrqt2i2cEEEEPROMENTION: I2CADDR=0xA0*((值和0x00 07)& lt;lt;1); CYU3PMESET(GLAP0缓冲器,0,SIZEOF(GLAP0缓冲器)); 状态= CyfxUsBi2cTrand(索引,I2CADDR,长度, GLAP0缓冲器,CyTrue); 如果(状态=CyuU3pl成功) { 状态= CYU3PUBSENEXDAT0DATA(长度,GLAP0缓冲器); } 断裂; 如果你在CyfxUBi2CurgMurdo.h中看到,你会发现这被定义为0xBB。 同样,这个例子中的值字段是EEPROMS地址,而索引给出内部EEPROM偏移地址。 若要读取EEPROM,则将下列数据放入控制中心 方向 类型供应商 目标设备 Req代码 WORD尝试0x000,但取决于EEPROM地址引脚是如何设置的 温德克斯0x000 在字节到传输框类型中,您要读取的字节数。 希望这有帮助。 索达法尔 以上来自于百度翻译 以下为原文 Hi In the USB Control Centre highlight the control endpoint, click on the data transfer tab and then enter values in the following fields to suit your application Direction Out/IN you decide Req Type Vendor Target Device Req Code Your Vendor code wValue you decide wIndex you decide USB setup data is an 8 byte array sent by the host pc and these are stored in setupdat0 and setupdat1 which the firmware then parses to decode the control information contained in the setup data. In the eeprom example (cyfxu***i2cregmode.c) this is done in the following code /* Parse the control request parameters. */ attr = (uint8_t) (setupdat0 & 0x000000FF); rqt = (uint8_t)((setupdat0 & 0x0000FF00) >> 8); value = (uint16_t) (setupdat0 >> 16); index = (uint16_t) (setupdat1 & 0x0000FFFF); length = (uint16_t) (setupdat1 >> 16); attr is the request type and will be set by Control Centre when you select Vendor. rqt is the users vendor code and in this example for an eeprom read the code shows case CY_FX_RQT_I2C_EEPROM_READ: i2cAddr = 0xA0 | ((value & 0x0007) << 1); CyU3PMemSet (glEp0Buffer, 0, sizeof (glEp0Buffer)); status = CyFxU***I2cTransfer (index, i2cAddr, length, glEp0Buffer, CyTrue); if (status == CY_U3P_SUCCESS) { status = CyU3PU***SendEP0Data(length, glEp0Buffer); } break; If you look in cyfxu***i2cregmode.h you will see that this is defined as 0xBB Likewise the value field in this example is the eeproms address while index give the internal eeprom offset address. To read the eeprom then the following data is put into Control Centre Direction IN Req Type Vendor Target Device Req Code 0xBB wValue try 0x0000 but depends on how the eeprom address pins are set wIndex 0x0000 In the Bytes to Transfer Box type in the number of bytes you want to read. Hope this helps. Sodafarl |
|
|
|
嗨,Sodafarl,你的回答很清楚,很有效。谢谢你的帮助。问候,Ali
以上来自于百度翻译 以下为原文 Hi Sodafarl, Your answer was very clear and it worked. Thanks for your help. Regards, Ali |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2102 浏览 1 评论
1848 浏览 1 评论
3666 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1783 浏览 6 评论
1533 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
565浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
419浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
434浏览 2评论
380浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
912浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 14:28 , Processed in 0.798582 second(s), Total 48, Slave 41 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号