Dear all,
I have a question regarding the Jungo USB stack. I am developing a simple USB device (using a C6748 DSP) which communicates solely via control transfers. I have managed to initialise the Jungo device stack with appropriate descriptors and a custom function driver. My currently problem is that a function driver has a callback function for dealing with control transfers that is of the type (see the header jusb_core_fd.h):
typedef result_t (*if_control_msg_fn)(void *context, void *buffer, uint8_t ep0_req_tag);
My main question is: what should a function driver do in this callback function? More specifically, how can I return the required data if this control transfer is a Device-to-host transfer or how can I extract data if it is a Host-to-device transfer.
In case it helps: my current implementation of this callback function is simply this:
result_t receiveControlMessageCallback(void* context, void* buffer, uint8_t ep0_req_tag) { return UWE_UNKNOWN; }
I have verified that this function gets called whenever I send a vendor-specific control-request to the C6748 from a PC host. However, without further details on how to respond to control transfers I am not able to send data back to the host. It is not clear what buffer is, what ep0_req_tag is, where to put the data to satisfy the request or what value to return.
As pointed out in other threads, the documentation that ships with BIOSUSB is very incomplete and does not provide sufficient details for writing custom function drivers -- or adapting the existing examples for that matter. Considering that the Jungo stack is closed-source, this makes any kind of development on the Jungo stack near-impossible. Sending and responding to control transfers is one of the very basic functionalities of the USB standard and, in my view, should be relatively straight-forward to implement on a device that is said to support USB. I would be very grateful if someone could provide me with some information or examples that would enable me to develop USB device functionality on the C6748.
For info, I am using BIOSUSB 1.10.03,
Kind regards,
Mark