Cypress技术论坛
直播中

李星星

8年用户 173经验值
私信 关注
[问答]

FX2LP如何通过固件手动清空IN端点的缓冲区?

你好,
我有一个大容量端点,在自动启用,不断充满了数据从外部主机。
在数据传输暂停之后,在继续新的传输之前,我可能想丢弃端点缓冲器的旧内容。
我必须写哪些寄存器来声明输入缓冲区是空的,以便他们能够从外部主机接收新数据?
我认为这是一个简单而愚蠢的问题,但我在过去的问题上工作了一夜,我的大脑感觉就像两块湿透的旧面包。
非常感谢你的帮助!

以上来自于百度翻译


     以下为原文
  Hi,

I have an Bulk IN endpoint with Auto-IN enabled that is constantly filled with data from the external master.
After a pause in data transfer I might want to discard the presumably old content of the endpoint buffers before I continue with the new transfer.

What do I have to write in which registers to declare the input buffers empty so that they can accept new data from the external master?

I assume this is an easy and silly question, but I have worked overnight on my previous problem and my brains feel like two soaked loafs of old bread.

Many thanks for any help!

回帖(1)

杜美娜

2018-9-10 15:33:14
你好,弗兰克,
为了丢弃已经提交给主机的数据,FX2LP必须切换到手动模式。实现下面一段代码来丢弃数据,并重新启用端点缓冲区由外部主机填充。
FiPosit=0x80;/ /激活NAC-ALL以避免竞争条件
同步延迟;
EP6FIFOCFG=0x00;/ /切换到手动模式
同步延迟;
FIFSET=0x06;//复位FIFO 6
同步延迟;
EP6FIFOCFG=0x0C;/ /切换到自动模式
同步延迟;
FiPosit=0x00;/ /释放NACKALL
同步延迟;
最好的问候,
斯里纳斯

以上来自于百度翻译


     以下为原文
  Hello Frank,
 
To discard the data that has already been committed to the host, the FX2LP has to be switched to MANUAL mode. Implement the below piece of code to discard the data and re-enable the endpoint buffer to be filled by external master.
 
FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions
SYNCDELAY;
EP6FIFOCFG = 0x00; //switching to manual mode
SYNCDELAY;
FIFORESET = 0x06; // Reset FIFO 6
SYNCDELAY;
EP6FIFOCFG = 0x0C; //switching to auto mode
SYNCDELAY;
FIFORESET = 0x00; //Release NAKALL
SYNCDELAY;
 
Best regards,
Srinath S
举报

更多回帖

发帖
×
20
完善资料,
赚取积分