ASF USB Callbacks - existing, available and user defined

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

Gryphon
Posts: 1
Joined: Mon Aug 03, 2015 1:13 am

ASF USB Callbacks - existing, available and user defined

Mon Aug 03, 2015 1:44 am

Hello!

I'd like to implement such a example with AFS: Arduino Due (SAM3x8e) as USB HID device with 1 USB interface and 4 endpoints (1 control + 2 interrupt in + 1 interrupt out). Each interrupt_in endpoint has its own callback. If data is received at interrupt_in_1, toggle led 1, else toggle led 2. I cannot get how to do it using ASF.

Could you please help me with the questions I cannot answer myself using manuals from Atmel?
1. Where is located USB interrupt handler?
2. How can we get what did trigger USB interrupt? According to SAM3x datasheet there are many interrupt sources, but only one general flag is set. After getting a USB interrupt we should check different registers to get the exact source. Is there a way to do that using ASF, without register magic?
3. What are predefined callbacks? In manuals there are UDI callbacks for connect/disconnect and for power management. I cannot find data sent/data received callbacks and cannot get how to write and register them.
4. Is it adequate to use different endpoints for different effectors? I.e. I have 2 step motors and want interrupt callback to be as fast as possible. Is it better to give the motors a "personal" endpoint each, or have a single endpoint at price of a bit harder report_out parsing?

Looking forward to replies!

Return to “Development Tools”

Who is online

Users browsing this forum: Google [Bot] and 1 guest