Changed Still Image Host class driver to auto-fill TransactionID element of sent...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / StillImage.h
index 4d37796..75f76eb 100644 (file)
@@ -54,6 +54,9 @@
                #endif\r
 \r
        /* Public Interface - May be used in end-application: */\r
+               /* Macros: */\r
+                       #define SI_ERROR_LOGICAL_CMD_FAILED              0xC0\r
+\r
                /* Type Defines: */\r
                        typedef struct\r
                        {\r
                                           */\r
                                struct\r
                                {\r
-                                       bool Active; /**< Indicates if the current interface instance is connected to an attached device, valid\r
-                                                     *   after \ref HID_Host_ConfigurePipes() is called and the Host state machine is in the\r
-                                                     *   Configured state\r
-                                                     */\r
+                                       bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid\r
+                                                       *   after \ref HID_Host_ConfigurePipes() is called and the Host state machine is in the\r
+                                                       *   Configured state\r
+                                                       */\r
 \r
                                        uint16_t DataINPipeSize; /**< Size in bytes of the Still Image interface's IN data pipe */\r
                                        uint16_t DataOUTPipeSize;  /**< Size in bytes of the Still Image interface's OUT data pipe */\r
                                        uint16_t EventsPipeSize;  /**< Size in bytes of the Still Image interface's IN events pipe */\r
+                                       \r
+                                       bool IsSessionOpen; /**< Indicates if a PIMA session is currently open with the attached device */\r
+                                       uint32_t TransactionID; /**< Transaction ID for the next transaction to send to the device */\r
                                } State; /**< State data for the USB class interface within the device. All elements in this section\r
                                                  *   <b>may</b> be set to initial values, but may also be ignored to default to sane values when\r
                                                  *   the interface is enumerated.\r
                        uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint16_t ConfigDescriptorLength,\r
                                            uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3);\r
 \r
-                       void SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, SI_PIMA_Container_t* PIMAHeader);\r
-                       uint8_t SImage_Host_RecieveBlockHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, SI_PIMA_Container_t* PIMAHeader);\r
-                       uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes);\r
-                       uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes);\r
-                       bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* SIInterfaceInfo);\r
-                       uint8_t SImage_Host_RecieveEventHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, SI_PIMA_Container_t* PIMAHeader);\r
-                                                         \r
+                       uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo);\r
+                       uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* SIInterfaceInfo);\r
+\r
+                       uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint16_t Operation, uint8_t UsedParams,\r
+                                                       uint32_t Param1, uint32_t Param2, uint32_t Param3, void* DataBuff);\r
+                       \r
        /* Private Interface - For use in library only: */\r
        #if !defined(__DOXYGEN__)\r
                /* Macros: */\r
                        #if defined(INCLUDE_FROM_SI_CLASS_HOST_C)\r
                                static uint8_t DComp_SI_Host_NextSIInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);\r
                                static uint8_t DComp_SI_Host_NextSIInterfaceEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);\r
+\r
+                               static uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo,\r
+                                                                          SI_PIMA_Container_t* PIMAHeader);\r
+                               static uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo,\r
+                                                                             SI_PIMA_Container_t* PIMAHeader);\r
+                               static uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes);\r
+                               static uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, void* Buffer, uint16_t Bytes);\r
+                               static bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* SIInterfaceInfo);\r
+                               static uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* SIInterfaceInfo,\r
+                                                                             SI_PIMA_Container_t* PIMAHeader);\r
                        #endif\r
        #endif\r
        \r