aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-30 11:36:04 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-30 11:36:04 +0000
commit3dce79d68ccc50ee1007e485396826762b6965b5 (patch)
tree5196dda6bc6ff6b339548a26c6481f2dfa40dbdb /LUFA
parent0d3a3f7536b6b2f22858f82541c383aa3759aa15 (diff)
downloadlufa-3dce79d68ccc50ee1007e485396826762b6965b5.tar.gz
lufa-3dce79d68ccc50ee1007e485396826762b6965b5.tar.bz2
lufa-3dce79d68ccc50ee1007e485396826762b6965b5.zip
Added start of the Still Image Host Class driver demo and driver code.
Re-enabled building of the Host mode demos ClassDriver directory.
Diffstat (limited to 'LUFA')
-rw-r--r--LUFA/Drivers/USB/Class/Common/StillImage.h43
-rw-r--r--LUFA/Drivers/USB/Class/Host/CDC.c12
-rw-r--r--LUFA/Drivers/USB/Class/Host/CDC.h8
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.c4
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.h2
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.c8
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.h4
-rw-r--r--LUFA/Drivers/USB/Class/Host/StillImage.c109
-rw-r--r--LUFA/Drivers/USB/Class/Host/StillImage.h84
-rw-r--r--LUFA/ManPages/FutureChanges.txt2
10 files changed, 255 insertions, 21 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/StillImage.h b/LUFA/Drivers/USB/Class/Common/StillImage.h
index 41942d407..2723aeb44 100644
--- a/LUFA/Drivers/USB/Class/Common/StillImage.h
+++ b/LUFA/Drivers/USB/Class/Common/StillImage.h
@@ -52,10 +52,53 @@
#endif
/* Macros: */
+ /** Length in bytes of a given Unicode string's character length
+ *
+ * \param[in] chars Total number of Unicode characters in the string
+ */
+ #define UNICODE_STRING_LENGTH(chars) (chars << 1)
+ /** Timeout period between the issuing of a command to a device, and the reception of the first packet */
+ #define COMMAND_DATA_TIMEOUT_MS 5000
+
+ /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
+ * a command container.
+ *
+ * \param[in] params Number of parameters which are to be sent in the Param field of the container
+ */
+ #define PIMA_COMMAND_SIZE(params) ((sizeof(PIMA_SendBlock) - sizeof(PIMA_SendBlock.Params)) + \
+ (params * sizeof(PIMA_SendBlock.Params[0])))
+
+ /** Used in the DataLength field of a PIMA container, to give the total container size in bytes for
+ * a data container.
+ *
+ * \param[in] datalen Length in bytes of the data in the container
+ */
+ #define PIMA_DATA_SIZE(datalen) ((sizeof(PIMA_SendBlock) - sizeof(PIMA_SendBlock.Params)) + datalen)
/* Type defines: */
+ /** Type define for a PIMA container, use to send commands and receive responses to and from an
+ * attached Still Image device.
+ */
+ typedef struct
+ {
+ uint32_t DataLength; /**< Length of the container and data, in bytes */
+ uint16_t Type; /**< Container type, a value from the PIMA_Container_Types_t enum */
+ uint16_t Code; /**< Command, event or response code of the container */
+ uint32_t TransactionID; /**< Unique container ID to link blocks together */
+ uint32_t Params[4]; /**< Block parameters to be issued along with the block code (command blocks only) */
+ } SI_PIMA_Container_t;
+ /* Enums: */
+ /** Enum for the possible PIMA contains types. */
+ enum SI_PIMA_Container_Types_t
+ {
+ CType_Undefined = 0, /**< Undefined container type */
+ CType_CommandBlock = 1, /**< Command Block container type */
+ CType_DataBlock = 2, /**< Data Block container type */
+ CType_ResponseBlock = 3, /**< Response container type */
+ CType_EventBlock = 4, /**< Event Block container type */
+ };
/* Enums: */
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.c b/LUFA/Drivers/USB/Class/Host/CDC.c
index e790e64f8..e75bee2d0 100644
--- a/LUFA/Drivers/USB/Class/Host/CDC.c
+++ b/LUFA/Drivers/USB/Class/Host/CDC.c
@@ -57,12 +57,12 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint
DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).bInterfaceNumber;
#endif
- while (FoundEndpoints != (CDC_FOUND_DATAPIPE_IN | CDC_FOUND_DATAPIPE_OUT | CDC_FOUND_DATAPIPE_NOTIFICATION))
+ while (FoundEndpoints != (CDC_FOUND_NOTIFICATION_IN | CDC_FOUND_DATAPIPE_IN | CDC_FOUND_DATAPIPE_OUT))
{
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- DComp_CDC_Host_NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
+ DComp_CDC_Host_NextCDCInterfaceEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
- if (FoundEndpoints & CDC_FOUND_DATAPIPE_NOTIFICATION)
+ if (FoundEndpoints & CDC_FOUND_NOTIFICATION_IN)
{
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
DComp_CDC_Host_NextCDCDataInterface) != DESCRIPTOR_SEARCH_COMP_Found)
@@ -89,7 +89,7 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint
}
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- DComp_CDC_Host_NextInterfaceCDCDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
+ DComp_CDC_Host_NextCDCInterfaceEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
return CDC_ENUMERROR_EndpointsNotFound;
}
@@ -107,7 +107,7 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint
Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
- FoundEndpoints |= CDC_FOUND_DATAPIPE_NOTIFICATION;
+ FoundEndpoints |= CDC_FOUND_NOTIFICATION_IN;
}
}
else
@@ -171,7 +171,7 @@ static uint8_t DComp_CDC_Host_NextCDCDataInterface(void* CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound;
}
-static uint8_t DComp_CDC_Host_NextInterfaceCDCDataEndpoint(void* CurrentDescriptor)
+static uint8_t DComp_CDC_Host_NextCDCInterfaceEndpoint(void* CurrentDescriptor)
{
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
{
diff --git a/LUFA/Drivers/USB/Class/Host/CDC.h b/LUFA/Drivers/USB/Class/Host/CDC.h
index 4bb16a50b..f7dc08839 100644
--- a/LUFA/Drivers/USB/Class/Host/CDC.h
+++ b/LUFA/Drivers/USB/Class/Host/CDC.h
@@ -79,7 +79,7 @@
uint16_t DataINPipeSize; /**< Size in bytes of the CDC interface's IN data pipe */
uint16_t DataOUTPipeSize; /**< Size in bytes of the CDC interface's OUT data pipe */
- uint16_t NotificationPipeSize; /**< Size in bytes of the CDC interface's IN notification endpoint, if used */
+ uint16_t NotificationPipeSize; /**< Size in bytes of the CDC interface's IN notification pipe, if used */
struct
{
@@ -136,7 +136,7 @@
* \param[in] ConfigDescriptorLength Length of the attached device's Configuration Descriptor
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
*
- * \return A value from the \ref HIDHost_EnumerationFailure_ErrorCodes_t enum
+ * \return A value from the \ref CDCHost_EnumerationFailure_ErrorCodes_t enum
*/
uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, uint16_t ConfigDescriptorLength,
uint8_t* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1, 3);
@@ -214,7 +214,7 @@
#define CDC_FOUND_DATAPIPE_IN (1 << 0)
#define CDC_FOUND_DATAPIPE_OUT (1 << 1)
- #define CDC_FOUND_DATAPIPE_NOTIFICATION (1 << 2)
+ #define CDC_FOUND_NOTIFICATION_IN (1 << 2)
/* Function Prototypes: */
#if defined(INCLUDE_FROM_CDC_CLASS_HOST_C)
@@ -223,7 +223,7 @@
ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub);
static uint8_t DComp_CDC_Host_NextCDCControlInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
static uint8_t DComp_CDC_Host_NextCDCDataInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
- static uint8_t DComp_CDC_Host_NextInterfaceCDCDataEndpoint(void* CurrentDescriptor);
+ static uint8_t DComp_CDC_Host_NextCDCInterfaceEndpoint(void* CurrentDescriptor);
#endif
#endif
diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c
index 793523866..f9c42b281 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.c
+++ b/LUFA/Drivers/USB/Class/Host/HID.c
@@ -71,7 +71,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* HIDInterfaceInfo, uint
while (FoundEndpoints != (HID_FOUND_DATAPIPE_IN | HID_FOUND_DATAPIPE_OUT))
{
if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
- DComp_HID_Host_NextInterfaceHIDDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
+ DComp_HID_Host_NextHIDInterfaceEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
if (FoundEndpoints == (1 << HID_FOUND_DATAPIPE_IN))
break;
@@ -117,7 +117,7 @@ static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound;
}
-static uint8_t DComp_HID_Host_NextInterfaceHIDDataEndpoint(void* CurrentDescriptor)
+static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor)
{
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
{
diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h
index 56b27df79..48cdcb03b 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.h
+++ b/LUFA/Drivers/USB/Class/Host/HID.h
@@ -122,7 +122,7 @@
/* Function Prototypes: */
#if defined(INCLUDE_FROM_HID_CLASS_HOST_C)
static uint8_t DComp_HID_Host_NextHIDInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
- static uint8_t DComp_HID_Host_NextInterfaceHIDDataEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
+ static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
#endif
#endif
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c
index 65c49b15c..6a8373adc 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorage.c
+++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c
@@ -45,7 +45,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint16_
return MS_ENUMERROR_InvalidConfigDescriptor;
if (USB_GetNextDescriptorComp(&ConfigDescriptorLength, &DeviceConfigDescriptor,
- DComp_NextMassStorageInterface) != DESCRIPTOR_SEARCH_COMP_Found)
+ DComp_NextMSInterface) != DESCRIPTOR_SEARCH_COMP_Found)
{
return MS_ENUMERROR_NoMSInterfaceFound;
}
@@ -60,7 +60,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint16_
while (FoundEndpoints != (MS_FOUND_DATAPIPE_IN | MS_FOUND_DATAPIPE_OUT))
{
if (USB_GetNextDescriptorComp(&ConfigDescriptorLength, &DeviceConfigDescriptor,
- DComp_NextInterfaceBulkDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
+ DComp_NextMSInterfaceEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
{
return MS_ENUMERROR_EndpointsNotFound;
}
@@ -91,7 +91,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, uint16_
return MS_ENUMERROR_NoError;
}
-static uint8_t DComp_NextMassStorageInterface(void* CurrentDescriptor)
+static uint8_t DComp_NextMSInterface(void* CurrentDescriptor)
{
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
{
@@ -106,7 +106,7 @@ static uint8_t DComp_NextMassStorageInterface(void* CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound;
}
-static uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor)
+static uint8_t DComp_NextMSInterfaceEndpoint(void* CurrentDescriptor)
{
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
{
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.h b/LUFA/Drivers/USB/Class/Host/MassStorage.h
index 30969c412..9fc8851b5 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorage.h
+++ b/LUFA/Drivers/USB/Class/Host/MassStorage.h
@@ -322,8 +322,8 @@
/* Function Prototypes: */
#if defined(INCLUDE_FROM_MS_CLASS_HOST_C)
- static uint8_t DComp_NextMassStorageInterface(void* CurrentDescriptor);
- static uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor);
+ static uint8_t DComp_NextMSInterface(void* CurrentDescriptor);
+ static uint8_t DComp_NextMSInterfaceEndpoint(void* CurrentDescriptor);
static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* MSInterfaceInfo,
MS_CommandBlockWrapper_t* SCSICommandBlock,
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.c b/LUFA/Drivers/USB/Class/Host/StillImage.c
index 05bec698a..876f3b11d 100644
--- a/LUFA/Drivers/USB/Class/Host/StillImage.c
+++ b/LUFA/Drivers/USB/Class/Host/StillImage.c
@@ -36,4 +36,113 @@
#warning The Still Image Host mode Class driver is currently incomplete and is for preview purposes only.
+uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint16_t ConfigDescriptorSize,
+ uint8_t* ConfigDescriptorData)
+{
+ uint8_t FoundEndpoints = 0;
+
+ memset(&SIInterfaceInfo->State, 0x00, sizeof(SIInterfaceInfo->State));
+
+ if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)
+ return SI_ENUMERROR_InvalidConfigDescriptor;
+
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ DComp_SI_Host_NextSIInterface) != DESCRIPTOR_SEARCH_COMP_Found)
+ {
+ return SI_ENUMERROR_NoSIInterfaceFound;
+ }
+
+ while (FoundEndpoints != (SI_FOUND_EVENTS_IN | SI_FOUND_DATAPIPE_IN | SI_FOUND_DATAPIPE_OUT))
+ {
+ if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,
+ DComp_SI_Host_NextSIInterfaceEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)
+ {
+ return SI_ENUMERROR_EndpointsNotFound;
+ }
+
+ USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);
+
+ if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)
+ {
+ if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ Pipe_ConfigurePipe(SIInterfaceInfo->Config.EventsPipeNumber, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+ SIInterfaceInfo->State.EventsPipeSize = EndpointData->EndpointSize;
+
+ Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);
+
+ FoundEndpoints |= SI_FOUND_EVENTS_IN;
+ }
+ }
+ else
+ {
+ if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)
+ {
+ Pipe_ConfigurePipe(SIInterfaceInfo->Config.DataINPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_IN,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+ SIInterfaceInfo->State.DataINPipeSize = EndpointData->EndpointSize;
+
+ FoundEndpoints |= SI_FOUND_DATAPIPE_IN;
+ }
+ else
+ {
+ Pipe_ConfigurePipe(SIInterfaceInfo->Config.DataOUTPipeNumber, EP_TYPE_BULK, PIPE_TOKEN_OUT,
+ EndpointData->EndpointAddress, EndpointData->EndpointSize,
+ PIPE_BANK_DOUBLE);
+ SIInterfaceInfo->State.DataOUTPipeSize = EndpointData->EndpointSize;
+
+ FoundEndpoints |= SI_FOUND_DATAPIPE_OUT;
+ }
+ }
+ }
+
+ return SI_ENUMERROR_NoError;
+}
+
+uint8_t DComp_SI_Host_NextSIInterface(void* CurrentDescriptor)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class == STILL_IMAGE_CLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).SubClass == STILL_IMAGE_SUBCLASS) &&
+ (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == STILL_IMAGE_PROTOCOL))
+ {
+ return DESCRIPTOR_SEARCH_Found;
+ }
+ }
+
+ return DESCRIPTOR_SEARCH_NotFound;
+}
+
+uint8_t DComp_SI_Host_NextSIInterfaceEndpoint(void* CurrentDescriptor)
+{
+ if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
+ {
+ USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,
+ USB_Descriptor_Endpoint_t);
+
+ uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
+
+ if (((EndpointType == EP_TYPE_BULK) || (EndpointType == EP_TYPE_INTERRUPT)) &&
+ (!(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress))))
+ {
+ return DESCRIPTOR_SEARCH_Found;
+ }
+ }
+ else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)
+ {
+ return DESCRIPTOR_SEARCH_Fail;
+ }
+
+ return DESCRIPTOR_SEARCH_NotFound;
+}
+
+void SI_Host_USBTask(USB_ClassInfo_SI_Host_t* SIInterfaceInfo)
+{
+
+}
+
#endif
diff --git a/LUFA/Drivers/USB/Class/Host/StillImage.h b/LUFA/Drivers/USB/Class/Host/StillImage.h
index 5f3b389a3..6222cf595 100644
--- a/LUFA/Drivers/USB/Class/Host/StillImage.h
+++ b/LUFA/Drivers/USB/Class/Host/StillImage.h
@@ -54,8 +54,90 @@
#endif
/* Public Interface - May be used in end-application: */
+ /* Type Defines: */
+ typedef struct
+ {
+ const struct
+ {
+ uint8_t DataINPipeNumber; /**< Pipe number of the Still Image interface's IN data pipe */
+ uint8_t DataOUTPipeNumber; /**< Pipe number of the Still Image interface's OUT data pipe */
+ uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used */
+ } Config; /**< Config data for the USB class interface within the device. All elements in this section
+ * <b>must</b> be set or the interface will fail to enumerate and operate correctly.
+ */
+ struct
+ {
+ bool Active; /**< Indicates if the current interface instance is connected to an attached device, valid
+ * after \ref HID_Host_ConfigurePipes() is called and the Host state machine is in the
+ * Configured state
+ */
+
+ uint16_t DataINPipeSize; /**< Size in bytes of the Still Image interface's IN data pipe */
+ uint16_t DataOUTPipeSize; /**< Size in bytes of the Still Image interface's OUT data pipe */
+ uint16_t EventsPipeSize; /**< Size in bytes of the Still Image interface's IN events pipe */
+ } State; /**< State data for the USB class interface within the device. All elements in this section
+ * <b>may</b> be set to initial values, but may also be ignored to default to sane values when
+ * the interface is enumerated.
+ */
+ } USB_ClassInfo_SI_Host_t;
+
+ /* Enums: */
+ /** Enum for the possible error codes returned by the \ref SI_Host_ConfigurePipes() function. */
+ enum SIHost_EnumerationFailure_ErrorCodes_t
+ {
+ SI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
+ SI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
+ SI_ENUMERROR_NoSIInterfaceFound = 2, /**< A compatible Still Image interface was not found in the device's
+ * Configuration Descriptor
+ */
+ SI_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Still Image data endpoints were not found in the
+ * device's Still Image interface
+ */
+ };
+
/* Function Prototypes: */
-
+ /** General management task for a given Still Image host class interface, required for the correct operation of the
+ * interface. This should be called frequently in the main program loop, before the master USB management task
+ * \ref USB_USBTask().
+ *
+ * \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
+ */
+ void SI_Host_USBTask(USB_ClassInfo_SI_Host_t* SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
+
+
+ /** Host interface configuration routine, to configure a given Still Image host interface instance using the
+ * Configuration Descriptor read from an attached USB device. This function automatically updates the given Still
+ * Image Host instance's state values and configures the pipes required to communicate with the interface if it is
+ * found within the device. This should be called once after the stack has enumerated the attached device, while
+ * the host state machine is in the Addressed state.
+ *
+ * \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
+ * \param[in] ConfigDescriptorLength Length of the attached device's Configuration Descriptor
+ * \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
+ *
+ * \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum
+ */
+ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* SIInterfaceInfo, uint16_t ConfigDescriptorSize,
+ uint8_t* ConfigDescriptorData) ATTR_NON_NULL_PTR_ARG(1, 3);
+
+ /* Private Interface - For use in library only: */
+ #if !defined(__DOXYGEN__)
+ /* Macros: */
+ #define STILL_IMAGE_CLASS 0x06
+ #define STILL_IMAGE_SUBCLASS 0x01
+ #define STILL_IMAGE_PROTOCOL 0x01
+
+ #define SI_FOUND_EVENTS_IN (1 << 0)
+ #define SI_FOUND_DATAPIPE_IN (1 << 1)
+ #define SI_FOUND_DATAPIPE_OUT (1 << 2)
+
+ /* Function Prototypes: */
+ #if defined(INCLUDE_FROM_SI_CLASS_HOST_C)
+ static uint8_t DComp_SI_Host_NextSIInterface(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
+ static uint8_t DComp_SI_Host_NextSIInterfaceEndpoint(void* CurrentDescriptor) ATTR_NON_NULL_PTR_ARG(1);
+ #endif
+ #endif
+
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
diff --git a/LUFA/ManPages/FutureChanges.txt b/LUFA/ManPages/FutureChanges.txt
index 95d1150a3..669b94e07 100644
--- a/LUFA/ManPages/FutureChanges.txt
+++ b/LUFA/ManPages/FutureChanges.txt
@@ -12,7 +12,7 @@
* or post your suggestion as an enhancement request to the project bug tracker.
*
* <b>Targeted for This Release:</b>
- * - Finish Host Mode Class Drivers
+ * - Finish Host Mode Class Drivers, re-enable in makefile, add demo summaries
* (S) HID
* ( ) Still Image
* - Add overviews of each of the officially supported boards to the manual