Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

你好!
  关于器件Cyusb3014的固件编程及GPIF接口配置, 我希望在slavefifoSync的模式基础

   

上增加控制传输模式,想问问GPIF配置及固件编程如何实现。
  诚挚感谢
   曹先生

   

我的微信:czs13641092952

   

How are you?
I ask a question for firmware about use of cyusb3014。On the basic of 

   

SlaveFifoSync FirmWare Mode, I hope to add a mode among that realize  a mode 

   

of control transmission。For this,how I do configure my GPIF and  program my 

   

firmware? 
 
Thanks a lot
caozhansheng

0 Likes
2 Replies
Anonymous
Not applicable

sorry,please excuse me for my poor English.  contron transmission mode  spell is wrong,I think to say   "control transmission mode",about EP0, hope that our Technical Support Engineer can give me some support ,I thank a lots for your advice very much!

0 Likes
Anonymous
Not applicable

Hi Cao,

   关于控制传输的只是用于EP0,标准的USB control transfer request可以查看USB 3.1 Spec 下的USB Device Requests的数据格式。其中有关于bmRequestType,bRequest,wValue,wIndex,wLength的说明。

   关于EP0的自定义的处理可以在如下回调函数CyFxSlFifoApplnUSBSetupCB下实现,可以在如下函数里面添加你的实现代码。

/* Callback to handle the USB setup requests. */

CyBool_t

CyFxSlFifoApplnUSBSetupCB (

uint32_t setupdat0,

uint32_t setupdat1

)

{

/* Fast enumeration is used. Only requests addressed to the interface, class,

* vendor and unknown control requests are received by this function.

* This application does not support any class or vendor requests. */

uint8_t  bRequest, bReqType;

uint8_t  bType, bTarget;

uint16_t wValue, wIndex;

CyBool_t isHandled = CyFalse;

/* Decode the fields from the setup request. */

bReqType = (setupdat0 & CY_U3P_USB_REQUEST_TYPE_MASK);

bType    = (bReqType & CY_U3P_USB_TYPE_MASK);

bTarget  = (bReqType & CY_U3P_USB_TARGET_MASK);

bRequest = ((setupdat0 & CY_U3P_USB_REQUEST_MASK) >> CY_U3P_USB_REQUEST_POS);

wValue   = ((setupdat0 & CY_U3P_USB_VALUE_MASK)   >> CY_U3P_USB_VALUE_POS);

wIndex   = ((setupdat1 & CY_U3P_USB_INDEX_MASK)   >> CY_U3P_USB_INDEX_POS);

    

     //todo

return isHandled;

}

    上位机端可以参考Cypress的C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\library下的文档,其中有关于API的说明。

0 Likes