Hi Guys,
First AVR project (and generally not used to working at such a low level) with a simple premise for a project, but a challenging one for a newbie to implement:
Control the functionality of my Canon EOS T1i with my usbkey based on commands sent to avr via uart.
I've got my serial comms working nicely with interrupts and ring buffer and I have implemented a command parser that is working rather well… Now I just have the more complex part of comms with the camera to deal with.
I've done some general reading around PIMA and found some useful references at http://www.circuitsathome.com/canon-eos-cameras-principles-of-interfacing-and-library-description (the guy implemented EOS control for arduino with usb host shield)
I started with the classdriver stillimagehost demo as my start point and (a big) if i've understood the program flow correctly then the attached flowchart is roughly what i need to implement.
So my questions:
1. does all the above make sense, does the flow work in terms of how LUFA and PTP work?
2. Skimming the PIMA documentation (http://www.broomscloset.com/closet/photo/exif/PIMA15740-2000.PDF) I note on page 40 that the response consists of a uint16 response code followed by uint32 sessionID, transactionID and 5 optional parameters. the lufa supplied SI_Host_ReceiveResponse only returns a uint8 and so does not have the ability to look at the full response… so I'm guessing to retrieve this would I use SI_Host_ReceiveBlockHeader in place of receive response thus leaving me with a PIMA_Container struct with the data i may need (subnote I notice the PIMA_Container struct only has 3 params but the spec says 5 are possible?)?
3. PIMA events are handled by checking SI_Host_IsEventReceived and if the result is true then we use SI_Host_ReceiveEventHeader to get the data. Reading http://www.circuitsathome.com/canon-eos-cameras-principles-of-interfacing-and-library-description it seems to suggest EOS cameras don't use the typical PIMA event mechanism for all events - Can anyone confirm this?
Looking at the deviceInfo for the camera (http://www.circuitsathome.com/ptpusb-control-camera-data#EOS500D) operation 9116 is EOS_GetEvent. the first link seems to suggest there can be quite a bit of data returned for one of these events (more than just what would fit in a response) - does that mean I need to read additional data with something like SI_Host_ReadData and if so how do I know the number of bytes to read?
If someone has some experience in this area and can make sense of my tired ramblings I'd very much appreciate any direction you have to offer
Regards
Tim