Renamed SERIAL_STREAM_ASSERT() macro to STDOUT_ASSERT().
Minor tweaks to the library documentation.
This commit is contained in:
@@ -82,14 +82,14 @@
|
||||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the CDC interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the CDC interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the CDC interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the CDC interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the CDC interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the CDC interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the CDC interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the CDC interface's notification pipe should use double banking */
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the CDC interface's IN notification endpoint, if used. */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the CDC interface's notification pipe should use double banking. */
|
||||
} 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.
|
||||
*/
|
||||
@@ -97,13 +97,13 @@
|
||||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref CDC_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the CDC-ACM control interface within the attached device */
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the CDC-ACM control interface within the attached device. */
|
||||
|
||||
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 pipe, if used */
|
||||
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 pipe, if used. */
|
||||
|
||||
struct
|
||||
{
|
||||
@@ -118,14 +118,14 @@
|
||||
|
||||
struct
|
||||
{
|
||||
uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second */
|
||||
uint32_t BaudRateBPS; /**< Baud rate of the virtual serial port, in bits per second. */
|
||||
uint8_t CharFormat; /**< Character format of the virtual serial port, a value from the
|
||||
* CDCDevice_CDC_LineCodingFormats_t enum
|
||||
* \ref CDC_LineEncodingFormats_t enum.
|
||||
*/
|
||||
uint8_t ParityType; /**< Parity setting of the virtual serial port, a value from the
|
||||
* CDCDevice_LineCodingParity_t enum
|
||||
* \ref CDC_LineEncodingParity_t enum.
|
||||
*/
|
||||
uint8_t DataBits; /**< Bits of data per character of the virtual serial port */
|
||||
uint8_t DataBits; /**< Bits of data per character of the virtual serial port. */
|
||||
} LineEncoding; /**< Line encoding used in the virtual serial port, for the device's information. This is generally
|
||||
* only used if the virtual serial port data is to be reconstructed on a physical UART. When set
|
||||
* by the host application, the \ref CDC_Host_SetLineEncoding() function must be called to push
|
||||
@@ -141,17 +141,17 @@
|
||||
/** Enum for the possible error codes returned by the \ref CDC_Host_ConfigurePipes() function. */
|
||||
enum CDCHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
CDC_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
CDC_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
CDC_ENUMERROR_NoCDCInterfaceFound = 2, /**< A compatible CDC interface was not found in the device's Configuration Descriptor */
|
||||
CDC_ENUMERROR_EndpointsNotFound = 3, /**< Compatible CDC endpoints were not found in the device's CDC interface */
|
||||
CDC_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
CDC_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
CDC_ENUMERROR_NoCDCInterfaceFound = 2, /**< A compatible CDC interface was not found in the device's Configuration Descriptor. */
|
||||
CDC_ENUMERROR_EndpointsNotFound = 3, /**< Compatible CDC endpoints were not found in the device's CDC interface. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
/** General management task for a given CDC 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] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state.
|
||||
*/
|
||||
void CDC_Host_USBTask(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -161,11 +161,11 @@
|
||||
* 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] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing an CDC Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize 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 CDCHost_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* const CDCInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -173,9 +173,9 @@
|
||||
/** Sets the line encoding for the attached device's virtual serial port. This should be called when the LineEncoding
|
||||
* values of the interface have been changed to push the new settings to the USB device.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SetLineEncoding(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -184,19 +184,19 @@
|
||||
* notification. This should be called each time the CDC class driver's ControlLineStates.HostToDevice value is updated
|
||||
* to push the new states to the USB device.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Sends a Send Break request to the device. This is generally used to separate data data or to indicate a special condition
|
||||
* to the receiving device.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in] Duration Duration of the break, in milliseconds
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
* \param[in] Duration Duration of the break, in milliseconds.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendBreak(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Duration) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -208,11 +208,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in] Data Pointer to the string to send to the device
|
||||
* \param[in] Length Size in bytes of the string to send to the device
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
* \param[in] Data Pointer to the string to send to the device.
|
||||
* \param[in] Length Size in bytes of the string to send to the device.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, char* Data, const uint16_t Length)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -225,10 +225,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in] Data Byte of data to send to the device
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
* \param[in] Data Byte of data to send to the device.
|
||||
*
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_SendByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, const uint8_t Data) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -237,9 +237,9 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return Total number of buffered bytes received from the device
|
||||
* \return Total number of buffered bytes received from the device.
|
||||
*/
|
||||
uint16_t CDC_Host_BytesReceived(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -250,9 +250,9 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return Next received byte from the device, or 0 if no data received
|
||||
* \return Next received byte from the device, or 0 if no data received.
|
||||
*/
|
||||
uint8_t CDC_Host_ReceiveByte(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -261,9 +261,9 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t CDC_Host_Flush(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -274,16 +274,16 @@
|
||||
* \note The created stream can be given as stdout if desired to direct the standard output from all <stdio.h> functions
|
||||
* to the given CDC interface.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed.
|
||||
*/
|
||||
void CDC_Host_CreateStream(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, FILE* Stream);
|
||||
|
||||
/** Identical to CDC_Host_CreateStream(), except that reads are blocking until the calling stream function terminates
|
||||
* the transfer. While blocking, the USB and CDC service tasks are called repeatedly to maintain USB communications.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
|
||||
* \param[in,out] Stream Pointer to a FILE structure where the created stream should be placed.
|
||||
*/
|
||||
void CDC_Host_CreateBlockingStream(USB_ClassInfo_CDC_Host_t* CDCInterfaceInfo, FILE* Stream);
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
* are available in the ControlLineStates.DeviceToHost value inside the CDC host interface structure passed as a parameter, set as
|
||||
* a mask of CDC_CONTROL_LINE_IN_* masks.
|
||||
*
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state
|
||||
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class host configuration and state.
|
||||
*/
|
||||
void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
|
||||
@@ -85,20 +85,20 @@
|
||||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the HID interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the HID interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the HID interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the HID interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the HID interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t HIDInterfaceProtocol; /**< HID interface protocol value to match against if a specific
|
||||
* boot subclass protocol is required, either \ref HID_BOOT_MOUSE_PROTOCOL,
|
||||
* \ref HID_BOOT_KEYBOARD_PROTOCOL or \ref HID_NON_BOOT_PROTOCOL if any
|
||||
* HID device should be enumerated by the interface
|
||||
* HID device should be enumerated by the interface.
|
||||
*/
|
||||
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
|
||||
HID_ReportInfo_t* HIDParserData; /**< HID parser data to store the parsed HID report data, when boot protocol
|
||||
* is not used
|
||||
* is not used.
|
||||
*
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined,
|
||||
* this method is unavailable.
|
||||
@@ -111,23 +111,23 @@
|
||||
{
|
||||
bool IsActive; /**< 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
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t InterfaceNumber; /**< Interface index of the HID interface within the attached device */
|
||||
uint8_t InterfaceNumber; /**< Interface index of the HID interface within the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the HID interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the HID interface's OUT data pipe. */
|
||||
|
||||
bool SupportsBootProtocol; /**< Indicates if the current interface instance supports the HID Boot
|
||||
* Protocol when enabled via \ref HID_Host_SetBootProtocol()
|
||||
* Protocol when enabled via \ref HID_Host_SetBootProtocol().
|
||||
*/
|
||||
bool DeviceUsesOUTPipe; /**< Indicates if the current interface instance uses a separate OUT data pipe for
|
||||
* OUT reports, or if OUT reports are sent via the control pipe instead.
|
||||
*/
|
||||
bool UsingBootProtocol; /**< Indicates that the interface is currently initialized in Boot Protocol mode */
|
||||
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device */
|
||||
uint16_t HIDReportSize; /**< Size in bytes of the HID report descriptor in the device. */
|
||||
|
||||
uint8_t LargestReportSize; /**< Largest report the device will send, in bytes */
|
||||
uint8_t LargestReportSize; /**< Largest report the device will send, in bytes. */
|
||||
} 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.
|
||||
@@ -138,11 +138,11 @@
|
||||
/** Enum for the possible error codes returned by the \ref HID_Host_ConfigurePipes() function. */
|
||||
enum HIDHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
HID_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
HID_ENUMERROR_NoHIDInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor */
|
||||
HID_ENUMERROR_NoHIDDescriptorFound = 3, /**< The HID descriptor was not found in the device's HID interface */
|
||||
HID_ENUMERROR_EndpointsNotFound = 4, /**< Compatible HID endpoints were not found in the device's HID interface */
|
||||
HID_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
HID_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
HID_ENUMERROR_NoHIDInterfaceFound = 2, /**< A compatible HID interface was not found in the device's Configuration Descriptor. */
|
||||
HID_ENUMERROR_NoHIDDescriptorFound = 3, /**< The HID descriptor was not found in the device's HID interface. */
|
||||
HID_ENUMERROR_EndpointsNotFound = 4, /**< Compatible HID endpoints were not found in the device's HID interface. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
@@ -155,11 +155,11 @@
|
||||
* \note Once the device pipes are configured, the HID device's reporting protocol <b>must</b> be set via a call
|
||||
* to either the \ref HID_Host_SetBootProtocol() or \ref HID_Host_SetReportProtocol() function.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize 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 HIDHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -167,16 +167,16 @@
|
||||
|
||||
/** Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe.
|
||||
*
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* \pre This function must only be called when the Host state machine is in the \ref HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \note The destination buffer should be large enough to accommodate the largest report that the attached device
|
||||
* can generate.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] Buffer Buffer to store the received report into
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] Buffer Buffer to store the received report into.
|
||||
*
|
||||
* \return An error code from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return An error code from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, void* Buffer)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -189,11 +189,11 @@
|
||||
*
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method is unavailable.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] ReportID Report ID of the received report if ControlRequest is false, set by the to the Report ID to fetch
|
||||
* \param[in] Buffer Buffer to store the received report into
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] ReportID Report ID of the received report if ControlRequest is false, set by the to the Report ID to fetch.
|
||||
* \param[in] Buffer Buffer to store the received report into.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, const uint8_t ReportID,
|
||||
void* Buffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -208,14 +208,14 @@
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, the ReportID parameter is removed
|
||||
* from the parameter list of this function.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in] ReportID Report ID of the report to send to the device, or 0 if the device does not use report IDs
|
||||
* \param[in] ReportType Type of report to issue to the device, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature
|
||||
* \param[in] Buffer Buffer containing the report to send to the attached device
|
||||
* \param[in] ReportSize Report size in bytes to send to the attached device
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
* \param[in] ReportID Report ID of the report to send to the device, or 0 if the device does not use report IDs.
|
||||
* \param[in] ReportType Type of report to issue to the device, either \ref REPORT_ITEM_TYPE_Out or \ref REPORT_ITEM_TYPE_Feature.
|
||||
* \param[in] Buffer Buffer containing the report to send to the attached device.
|
||||
* \param[in] ReportSize Report size in bytes to send to the attached device.
|
||||
*
|
||||
* \return An error code from the \ref USB_Host_SendControlErrorCodes_t enum if the DeviceUsesOUTPipe flag is set in
|
||||
* the interface's state structure, a value from the \ref Pipe_Stream_RW_ErrorCodes_t enum otherwise
|
||||
* the interface's state structure, a value from the \ref Pipe_Stream_RW_ErrorCodes_t enum otherwise.
|
||||
*/
|
||||
uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
|
||||
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
|
||||
@@ -233,9 +233,9 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*
|
||||
* \return Boolean true if a report has been received, false otherwise
|
||||
* \return Boolean true if a report has been received, false otherwise.
|
||||
*/
|
||||
bool HID_Host_IsReportReceived(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -244,10 +244,10 @@
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method must still be called
|
||||
* to explicitly place the attached device into boot protocol mode before use.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*
|
||||
* \return \ref HID_ERROR_LOGICAL if the device does not support Boot Protocol mode, a value from the
|
||||
* \ref USB_Host_SendControlErrorCodes_t enum otherwise
|
||||
* \ref USB_Host_SendControlErrorCodes_t enum otherwise.
|
||||
*/
|
||||
uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -261,12 +261,12 @@
|
||||
*
|
||||
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method is unavailable.
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum if an error occurs while retrieving the HID
|
||||
* Report descriptor or the setting of the Report protocol, \ref HID_ERROR_LOGICAL if the HID interface does
|
||||
* not have a valid \ref HID_ReportInfo_t structure set in its configuration, a mask of \ref HID_ERROR_LOGICAL
|
||||
* and a value from the \ref HID_Parse_ErrorCodes_t otherwise
|
||||
* and a value from the \ref HID_Parse_ErrorCodes_t otherwise.
|
||||
*/
|
||||
uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
#endif
|
||||
@@ -276,7 +276,7 @@
|
||||
* the interface. This should be called frequently in the main program loop, before the master USB management task
|
||||
* \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
|
||||
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state.
|
||||
*/
|
||||
static inline void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo);
|
||||
static inline void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
|
||||
|
||||
@@ -133,12 +133,12 @@
|
||||
* left-aligned to the given data type. This allows for signed data to be interpreted correctly, by shifting the data
|
||||
* leftwards until the data's sign bit is in the correct position.
|
||||
*
|
||||
* \param[in] reportitem HID Report Item whose retrieved value is to be aligned
|
||||
* \param[in] type Data type to align the HID report item's value to
|
||||
* \param[in] ReportItem HID Report Item whose retrieved value is to be aligned.
|
||||
* \param[in] Type Data type to align the HID report item's value to.
|
||||
*
|
||||
* \return Left-aligned data of the given report item's pre-retrieved value for the given datatype
|
||||
* \return Left-aligned data of the given report item's pre-retrieved value for the given datatype.
|
||||
*/
|
||||
#define HID_ALIGN_DATA(reportitem, type) ((type)(reportitem->Value << ((8 * sizeof(type)) - reportitem->Attributes.BitSize)))
|
||||
#define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))
|
||||
|
||||
/* Public Interface - May be used in end-application: */
|
||||
/* Enums: */
|
||||
@@ -239,9 +239,9 @@
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t ReportID; /**< Report ID of the report within the HID interface */
|
||||
uint8_t ReportID; /**< Report ID of the report within the HID interface. */
|
||||
uint16_t ReportSizeBits[3]; /**< Total number of bits in each report type for the given Report ID,
|
||||
* indexed by the \ref HID_ReportItemTypes_t enum
|
||||
* indexed by the \ref HID_ReportItemTypes_t enum.
|
||||
*/
|
||||
} HID_ReportSizeInfo_t;
|
||||
|
||||
@@ -272,11 +272,11 @@
|
||||
/** Function to process a given HID report returned from an attached device, and store it into a given
|
||||
* \ref HID_ReportInfo_t structure.
|
||||
*
|
||||
* \param[in] ReportData Buffer containing the device's HID report table
|
||||
* \param[in] ReportSize Size in bytes of the HID report table
|
||||
* \param[out] ParserData Pointer to a \ref HID_ReportInfo_t instance for the parser output
|
||||
* \param[in] ReportData Buffer containing the device's HID report table.
|
||||
* \param[in] ReportSize Size in bytes of the HID report table.
|
||||
* \param[out] ParserData Pointer to a \ref HID_ReportInfo_t instance for the parser output.
|
||||
*
|
||||
* \return A value in the \ref HID_Parse_ErrorCodes_t enum
|
||||
* \return A value in the \ref HID_Parse_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, uint16_t ReportSize, HID_ReportInfo_t* const ParserData)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -287,10 +287,10 @@
|
||||
* When called, this copies the report item's Value element to it's PreviousValue element for easy
|
||||
* checking to see if an item's value has changed before processing a report.
|
||||
*
|
||||
* \param[in] ReportData Buffer containing an IN or FEATURE report from an attached device
|
||||
* \param[in,out] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array
|
||||
* \param[in] ReportData Buffer containing an IN or FEATURE report from an attached device.
|
||||
* \param[in,out] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
|
||||
*
|
||||
* \returns Boolean true if the item to retrieve was located in the given report, false otherwise
|
||||
* \returns Boolean true if the item to retrieve was located in the given report, false otherwise.
|
||||
*/
|
||||
bool USB_GetHIDReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -305,20 +305,20 @@
|
||||
*
|
||||
* If the device has multiple HID reports, the first byte in the report is set to the report ID of the given item.
|
||||
*
|
||||
* \param[out] ReportData Buffer holding the current OUT or FEATURE report data
|
||||
* \param[in] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array
|
||||
* \param[out] ReportData Buffer holding the current OUT or FEATURE report data.
|
||||
* \param[in] ReportItem Pointer to the report item of interest in a \ref HID_ReportInfo_t ReportItem array.
|
||||
*/
|
||||
void USB_SetHIDReportItemInfo(uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
||||
/** Retrieves the size of a given HID report in bytes from it's Report ID.
|
||||
*
|
||||
* \param[in] ParserData Pointer to a \ref HID_ReportInfo_t instance containing the parser output
|
||||
* \param[in] ReportID Report ID of the report whose size is to be retrieved
|
||||
* \param[in] ParserData Pointer to a \ref HID_ReportInfo_t instance containing the parser output.
|
||||
* \param[in] ReportID Report ID of the report whose size is to be retrieved.
|
||||
* \param[in] ReportType Type of the report whose size is to be determined, a valued from the
|
||||
* \ref HID_ReportItemTypes_t enum
|
||||
* \ref HID_ReportItemTypes_t enum.
|
||||
*
|
||||
* \return Size of the report in bytes, or 0 if the report does not exist
|
||||
* \return Size of the report in bytes, or 0 if the report does not exist.
|
||||
*/
|
||||
uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, const uint8_t ReportID,
|
||||
const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1);
|
||||
@@ -328,9 +328,9 @@
|
||||
* HID_ReportInfo_t structure. This can be used to filter only those items the application will be using, so that
|
||||
* no RAM is wasted storing the attributes for report items which will never be referenced by the application.
|
||||
*
|
||||
* \param[in] CurrentItem Pointer to the current report item for user checking
|
||||
* \param[in] CurrentItem Pointer to the current report item for user checking.
|
||||
*
|
||||
* \return Boolean true if the item should be stored into the HID_ReportInfo_t structure, false if it should be ignored
|
||||
* \return Boolean true if the item should be stored into the HID_ReportInfo_t structure, false if it should be ignored.
|
||||
*/
|
||||
bool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* CurrentItem);
|
||||
|
||||
|
||||
@@ -79,11 +79,11 @@
|
||||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the MIDI interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the MIDI interface's streaming IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the MIDI interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the MIDI interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the MIDI interface's streaming OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the MIDI interface's OUT data pipe should use double banking. */
|
||||
} 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.
|
||||
*/
|
||||
@@ -91,11 +91,11 @@
|
||||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref MIDI_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the MIDI Streaming Data interface's OUT data 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.
|
||||
@@ -106,10 +106,10 @@
|
||||
/** Enum for the possible error codes returned by the \ref MIDI_Host_ConfigurePipes() function. */
|
||||
enum MIDIHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
MIDI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
MIDI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
MIDI_ENUMERROR_NoStreamingInterfaceFound = 2, /**< A compatible MIDI interface was not found in the device's Configuration Descriptor */
|
||||
MIDI_ENUMERROR_EndpointsNotFound = 3, /**< Compatible MIDI data endpoints were not found in the device's MIDI interface */
|
||||
MIDI_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
MIDI_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
MIDI_ENUMERROR_NoStreamingInterfaceFound = 2, /**< A compatible MIDI interface was not found in the device's Configuration Descriptor. */
|
||||
MIDI_ENUMERROR_EndpointsNotFound = 3, /**< Compatible MIDI data endpoints were not found in the device's MIDI interface. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
@@ -119,11 +119,11 @@
|
||||
* 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] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize 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 MIDIHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref MIDIHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -133,10 +133,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
* \param[in] Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,
|
||||
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -146,9 +146,9 @@
|
||||
* pipe bank until either the pipe bank is full, or \ref MIDI_Host_Flush() is called. This allows for multiple MIDI
|
||||
* events to be packed into a single pipe packet, increasing data throughput.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -157,10 +157,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state
|
||||
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
|
||||
* \param[out] Event Pointer to a USB_MIDI_EventPacket_t structure where the received MIDI event is to be placed.
|
||||
*
|
||||
* \return Boolean true if a MIDI event packet was received, false otherwise
|
||||
* \return Boolean true if a MIDI event packet was received, false otherwise.
|
||||
*/
|
||||
bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,
|
||||
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -169,7 +169,7 @@
|
||||
/** General management task for a given MIDI 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] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state
|
||||
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state.
|
||||
*/
|
||||
static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
|
||||
|
||||
@@ -83,11 +83,11 @@
|
||||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Mass Storage interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Mass Storage interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Mass Storage interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Mass Storage interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Mass Storage interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Mass Storage interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Mass Storage interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Mass Storage interface's OUT data pipe should use double banking. */
|
||||
} 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.
|
||||
*/
|
||||
@@ -95,14 +95,14 @@
|
||||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref MS_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Mass Storage interface within the attached device */
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Mass Storage interface within the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Mass Storage interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Mass Storage interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Mass Storage interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Mass Storage interface's OUT data pipe. */
|
||||
|
||||
uint32_t TransactionTag; /**< Current transaction tag for data synchronizing of packets */
|
||||
uint32_t TransactionTag; /**< Current transaction tag for data synchronizing of packets. */
|
||||
} 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.
|
||||
@@ -117,17 +117,17 @@
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Blocks; /**< Number of blocks in the addressed LUN of the device */
|
||||
uint32_t BlockSize; /**< Number of bytes in each block in the addressed LUN */
|
||||
uint32_t Blocks; /**< Number of blocks in the addressed LUN of the device. */
|
||||
uint32_t BlockSize; /**< Number of bytes in each block in the addressed LUN. */
|
||||
} SCSI_Capacity_t;
|
||||
|
||||
/* Enums: */
|
||||
enum MSHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
MS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
MS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
MS_ENUMERROR_NoMSInterfaceFound = 2, /**< A compatible Mass Storage interface was not found in the device's Configuration Descriptor */
|
||||
MS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Mass Storage endpoints were not found in the device's interfaces */
|
||||
MS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
MS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
MS_ENUMERROR_NoMSInterfaceFound = 2, /**< A compatible Mass Storage interface was not found in the device's Configuration Descriptor. */
|
||||
MS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Mass Storage endpoints were not found in the device's interfaces. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
@@ -137,11 +137,11 @@
|
||||
* 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] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize 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 MSHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref MSHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -149,9 +149,9 @@
|
||||
/** Sends a MASS STORAGE RESET control request to the attached device, resetting the Mass Storage Interface
|
||||
* and readying it for the next Mass Storage command.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -163,10 +163,10 @@
|
||||
* on unsupported devices the max LUN index will be reported as zero and no error will be returned
|
||||
* if the device STALLs the request.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[out] MaxLUNIndex Pointer to a location where the highest LUN index value should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[out] MaxLUNIndex Pointer to a location where the highest LUN index value should be stored.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, uint8_t* const MaxLUNIndex)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -177,11 +177,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[out] InquiryData Location where the read inquiry data should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[out] InquiryData Location where the read inquiry data should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED.
|
||||
*/
|
||||
uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
SCSI_Inquiry_Response_t* const InquiryData) ATTR_NON_NULL_PTR_ARG(1)
|
||||
@@ -189,10 +189,10 @@
|
||||
|
||||
/** Sends a TEST UNIT READY command to the device, to determine if it is ready to accept other SCSI commands.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex)
|
||||
ATTR_NON_NULL_PTR_ARG(1);
|
||||
@@ -202,11 +202,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[out] DeviceCapacity Pointer to the location where the capacity information should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[out] DeviceCapacity Pointer to the location where the capacity information should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
SCSI_Capacity_t* const DeviceCapacity) ATTR_NON_NULL_PTR_ARG(1)
|
||||
@@ -218,11 +218,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[out] SenseData Pointer to the location where the sense information should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[out] SenseData Pointer to the location where the sense information should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
SCSI_Request_Sense_Response_t* const SenseData) ATTR_NON_NULL_PTR_ARG(1)
|
||||
@@ -234,11 +234,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in] PreventRemoval Boolean true if the device should be locked from removal, false otherwise
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[in] PreventRemoval Boolean true if the device should be locked from removal, false otherwise.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
const bool PreventRemoval) ATTR_NON_NULL_PTR_ARG(1);
|
||||
@@ -248,14 +248,14 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in] BlockAddress Starting block address within the device to read from
|
||||
* \param[in] Blocks Total number of blocks to read
|
||||
* \param[in] BlockSize Size in bytes of each block within the device
|
||||
* \param[out] BlockBuffer Pointer to where the read data from the device should be stored
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[in] BlockAddress Starting block address within the device to read from.
|
||||
* \param[in] Blocks Total number of blocks to read.
|
||||
* \param[in] BlockSize Size in bytes of each block within the device.
|
||||
* \param[out] BlockBuffer Pointer to where the read data from the device should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
const uint32_t BlockAddress, const uint8_t Blocks, const uint16_t BlockSize,
|
||||
@@ -266,14 +266,14 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to
|
||||
* \param[in] BlockAddress Starting block address within the device to write to
|
||||
* \param[in] Blocks Total number of blocks to read
|
||||
* \param[in] BlockSize Size in bytes of each block within the device
|
||||
* \param[in] BlockBuffer Pointer to where the data to write should be sourced from
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state.
|
||||
* \param[in] LUNIndex LUN index within the device the command is being issued to.
|
||||
* \param[in] BlockAddress Starting block address within the device to write to.
|
||||
* \param[in] Blocks Total number of blocks to read.
|
||||
* \param[in] BlockSize Size in bytes of each block within the device.
|
||||
* \param[in] BlockBuffer Pointer to where the data to write should be sourced from.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum or MS_ERROR_LOGICAL_CMD_FAILED if not ready.
|
||||
*/
|
||||
uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, const uint8_t LUNIndex,
|
||||
const uint32_t BlockAddress, const uint8_t Blocks, const uint16_t BlockSize,
|
||||
@@ -284,7 +284,7 @@
|
||||
* the interface. This should be called frequently in the main program loop, before the master USB management task
|
||||
* \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state
|
||||
* \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state.
|
||||
*/
|
||||
static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo);
|
||||
static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
|
||||
|
||||
@@ -79,11 +79,11 @@
|
||||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Printer interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Printer interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Printer interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Printer interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Printer interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Printer interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Printer interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Printer interface's OUT data pipe should use double banking. */
|
||||
} 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.
|
||||
*/
|
||||
@@ -91,13 +91,13 @@
|
||||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref PRNT_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Printer interface within the attached device */
|
||||
uint8_t AlternateSetting; /**< Alternate setting within the Printer Interface in the attached device */
|
||||
uint8_t InterfaceNumber; /**< Interface index of the Printer interface within the attached device. */
|
||||
uint8_t AlternateSetting; /**< Alternate setting within the Printer Interface in the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Printer interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Printer interface's OUT data pipe */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the Printer interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the Printer interface's OUT data 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.
|
||||
@@ -107,10 +107,10 @@
|
||||
/* Enums: */
|
||||
enum PRNTHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
PRNT_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
PRNT_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
PRNT_ENUMERROR_NoPrinterInterfaceFound = 2, /**< A compatible Printer interface was not found in the device's Configuration Descriptor */
|
||||
PRNT_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Printer endpoints were not found in the device's interfaces */
|
||||
PRNT_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
PRNT_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
PRNT_ENUMERROR_NoPrinterInterfaceFound = 2, /**< A compatible Printer interface was not found in the device's Configuration Descriptor. */
|
||||
PRNT_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Printer endpoints were not found in the device's interfaces. */
|
||||
};
|
||||
|
||||
/* Function Prototypes: */
|
||||
@@ -120,11 +120,11 @@
|
||||
* 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] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize 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 PRNTHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref PRNTHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -132,28 +132,28 @@
|
||||
/** Configures the printer to enable Bidirectional mode, if it is not already in this mode. This should be called
|
||||
* once the connected device's configuration has been set, to ensure the printer is ready to accept commands.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Retrieves the status of the virtual Printer port's inbound status lines. The result can then be masked against the
|
||||
* PRNT_PORTSTATUS_* macros to determine the printer port's status.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[out] PortStatus Location where the retrieved port status should be stored
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[out] PortStatus Location where the retrieved port status should be stored.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_GetPortStatus(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, uint8_t* const PortStatus)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
|
||||
/** Soft-resets the attached printer, readying it for new commands.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum
|
||||
* \return A value from the \ref USB_Host_SendControlErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_SoftReset(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -164,11 +164,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in] PrinterCommands Pointer to a buffer containing the raw command stream to send to the printer
|
||||
* \param[in] CommandSize Size in bytes of the command stream to be sent
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[in] PrinterCommands Pointer to a buffer containing the raw command stream to send to the printer.
|
||||
* \param[in] CommandSize Size in bytes of the command stream to be sent.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_SendData(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, void* PrinterCommands,
|
||||
uint16_t CommandSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -180,11 +180,11 @@
|
||||
*
|
||||
* This string, when supported, contains the model, manufacturer and acceptable printer languages for the attached device.
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[out] DeviceIDString Pointer to a buffer where the Device ID string should be stored, in ASCII format
|
||||
* \param[in] BufferSize Size in bytes of the buffer allocated for the Device ID string
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
* \param[out] DeviceIDString Pointer to a buffer where the Device ID string should be stored, in ASCII format.
|
||||
* \param[in] BufferSize Size in bytes of the buffer allocated for the Device ID string.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t PRNT_Host_GetDeviceID(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, char* DeviceIDString,
|
||||
uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -194,7 +194,7 @@
|
||||
* the interface. This should be called frequently in the main program loop, before the master USB management task
|
||||
* \ref USB_USBTask().
|
||||
*
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
|
||||
* \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state.
|
||||
*/
|
||||
static inline void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
|
||||
|
||||
@@ -83,16 +83,16 @@
|
||||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the RNDIS interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the RNDIS interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the RNDIS interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the RNDIS interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the RNDIS interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the RNDIS interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the RNDIS interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the RNDIS interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the RNDIS interface's IN notification endpoint, if used */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the RNDIS interface's notification pipe should use double banking */
|
||||
uint8_t NotificationPipeNumber; /**< Pipe number of the RNDIS interface's IN notification endpoint, if used. */
|
||||
bool NotificationPipeDoubleBank; /**< Indicates if the RNDIS interface's notification pipe should use double banking. */
|
||||
|
||||
uint32_t HostMaxPacketSize; /**< Maximum size of a packet which can be buffered by the host */
|
||||
uint32_t HostMaxPacketSize; /**< Maximum size of a packet which can be buffered by the host. */
|
||||
} 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.
|
||||
*/
|
||||
@@ -100,17 +100,17 @@
|
||||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref RNDIS_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* Configured state.
|
||||
*/
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the RNDIS control interface within the attached device */
|
||||
uint8_t ControlInterfaceNumber; /**< Interface index of the RNDIS control interface within the attached device. */
|
||||
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the RNDIS interface's IN data pipe */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the RNDIS interface's OUT data pipe */
|
||||
uint16_t NotificationPipeSize; /**< Size in bytes of the RNDIS interface's IN notification pipe, if used */
|
||||
uint16_t DataINPipeSize; /**< Size in bytes of the RNDIS interface's IN data pipe. */
|
||||
uint16_t DataOUTPipeSize; /**< Size in bytes of the RNDIS interface's OUT data pipe. */
|
||||
uint16_t NotificationPipeSize; /**< Size in bytes of the RNDIS interface's IN notification pipe, if used. */
|
||||
|
||||
uint32_t DeviceMaxPacketSize; /**< Maximum size of a packet which can be buffered by the attached RNDIS device */
|
||||
uint32_t DeviceMaxPacketSize; /**< Maximum size of a packet which can be buffered by the attached RNDIS device. */
|
||||
|
||||
uint32_t RequestID; /**< Request ID counter to give a unique ID for each command/response pair */
|
||||
uint32_t RequestID; /**< Request ID counter to give a unique ID for each command/response pair. */
|
||||
} 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.
|
||||
@@ -121,10 +121,10 @@
|
||||
/** Enum for the possible error codes returned by the \ref RNDIS_Host_ConfigurePipes() function. */
|
||||
enum RNDISHost_EnumerationFailure_ErrorCodes_t
|
||||
{
|
||||
RNDIS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully */
|
||||
RNDIS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor */
|
||||
RNDIS_ENUMERROR_NoRNDISInterfaceFound = 2, /**< A compatible RNDIS interface was not found in the device's Configuration Descriptor */
|
||||
RNDIS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible RNDIS endpoints were not found in the device's RNDIS interface */
|
||||
RNDIS_ENUMERROR_NoError = 0, /**< Configuration Descriptor was processed successfully. */
|
||||
RNDIS_ENUMERROR_InvalidConfigDescriptor = 1, /**< The device returned an invalid Configuration Descriptor. */
|
||||
RNDIS_ENUMERROR_NoRNDISInterfaceFound = 2, /**< A compatible RNDIS interface was not found in the device's Configuration Descriptor. */
|
||||
RNDIS_ENUMERROR_EndpointsNotFound = 3, /**< Compatible RNDIS endpoints were not found in the device's RNDIS interface. */
|
||||
};
|
||||
|
||||
/* Macros: */
|
||||
@@ -138,11 +138,11 @@
|
||||
* 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] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize 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 RNDISHost_EnumerationFailure_ErrorCodes_t enum
|
||||
* \return A value from the \ref RNDISHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -150,45 +150,45 @@
|
||||
/** Sends a RNDIS KEEPALIVE command to the device, to ensure that it does not enter standby mode after periods
|
||||
* of long inactivity.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_SendKeepAlive(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Initializes the attached RNDIS device's RNDIS interface. This should be called after the device's pipes have been
|
||||
* configured via the call to \ref RNDIS_Host_ConfigurePipes().
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_InitializeDevice(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
/** Sets a given RNDIS property of an attached RNDIS device.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] Oid OID number of the parameter to set
|
||||
* \param[in] Buffer Pointer to where the property data is to be sourced from
|
||||
* \param[in] Length Length in bytes of the property data to sent to the device
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] Oid OID number of the parameter to set.
|
||||
* \param[in] Buffer Pointer to where the property data is to be sourced from.
|
||||
* \param[in] Length Length in bytes of the property data to sent to the device.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_SetRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint32_t Oid, void* Buffer,
|
||||
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
|
||||
/** Gets a given RNDIS property of an attached RNDIS device.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] Oid OID number of the parameter to get
|
||||
* \param[in] Buffer Pointer to where the property data is to be written to
|
||||
* \param[in] MaxLength Length in bytes of the destination buffer size
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] Oid OID number of the parameter to get.
|
||||
* \param[in] Buffer Pointer to where the property data is to be written to.
|
||||
* \param[in] MaxLength Length in bytes of the destination buffer size.
|
||||
*
|
||||
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
|
||||
* logical command failure
|
||||
* logical command failure.
|
||||
*/
|
||||
uint8_t RNDIS_Host_QueryRNDISProperty(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, uint32_t Oid, void* Buffer,
|
||||
uint16_t MaxLength) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -198,9 +198,9 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*
|
||||
* \return Boolean true if a packet is waiting to be read in by the host, false otherwise
|
||||
* \return Boolean true if a packet is waiting to be read in by the host, false otherwise.
|
||||
*/
|
||||
bool RNDIS_Host_IsPacketReceived(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -210,11 +210,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[out] Buffer Pointer to a buffer where the packer data is to be written to
|
||||
* \param[out] PacketLength Pointer to where the length in bytes of the read packet is to be stored
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[out] Buffer Pointer to a buffer where the packer data is to be written to.
|
||||
* \param[out] PacketLength Pointer to where the length in bytes of the read packet is to be stored.
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t RNDIS_Host_ReadPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t* PacketLength)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -224,11 +224,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in] Buffer Pointer to a buffer where the packer data is to be read from
|
||||
* \param[in] PacketLength Length in bytes of the packet to send
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
* \param[in] Buffer Pointer to a buffer where the packer data is to be read from.
|
||||
* \param[in] PacketLength Length in bytes of the packet to send.
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t PacketLength)
|
||||
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -237,7 +237,7 @@
|
||||
/** General management task for a given RNDIS 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] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state
|
||||
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state.
|
||||
*/
|
||||
static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo)
|
||||
|
||||
@@ -83,14 +83,14 @@
|
||||
{
|
||||
const struct
|
||||
{
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Still Image interface's IN data pipe */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Still Image interface's IN data pipe should use double banking */
|
||||
uint8_t DataINPipeNumber; /**< Pipe number of the Still Image interface's IN data pipe. */
|
||||
bool DataINPipeDoubleBank; /**< Indicates if the Still Image interface's IN data pipe should use double banking. */
|
||||
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Still Image interface's OUT data pipe */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Still Image interface's OUT data pipe should use double banking */
|
||||
uint8_t DataOUTPipeNumber; /**< Pipe number of the Still Image interface's OUT data pipe. */
|
||||
bool DataOUTPipeDoubleBank; /**< Indicates if the Still Image interface's OUT data pipe should use double banking. */
|
||||
|
||||
uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used */
|
||||
bool EventsPipeDoubleBank; /**< Indicates if the Still Image interface's events data pipe should use double banking */
|
||||
uint8_t EventsPipeNumber; /**< Pipe number of the Still Image interface's IN events endpoint, if used. */
|
||||
bool EventsPipeDoubleBank; /**< Indicates if the Still Image interface's events data pipe should use double banking. */
|
||||
} 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.
|
||||
*/
|
||||
@@ -98,15 +98,15 @@
|
||||
{
|
||||
bool IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
|
||||
* after \ref SImage_Host_ConfigurePipes() is called and the Host state machine is in the
|
||||
* Configured state
|
||||
* 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 */
|
||||
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. */
|
||||
|
||||
bool IsSessionOpen; /**< Indicates if a PIMA session is currently open with the attached device */
|
||||
uint32_t TransactionID; /**< Transaction ID for the next transaction to send to the device */
|
||||
bool IsSessionOpen; /**< Indicates if a PIMA session is currently open with the attached device. */
|
||||
uint32_t TransactionID; /**< Transaction ID for the next transaction to send to the device. */
|
||||
} 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.
|
||||
@@ -117,13 +117,13 @@
|
||||
/** Enum for the possible error codes returned by the \ref SImage_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_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
|
||||
* Configuration Descriptor.
|
||||
*/
|
||||
SI_ENUMERROR_EndpointsNotFound = 3, /**< Compatible Still Image data endpoints were not found in the
|
||||
* device's Still Image interface
|
||||
* device's Still Image interface.
|
||||
*/
|
||||
};
|
||||
|
||||
@@ -134,11 +134,11 @@
|
||||
* 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] ConfigDescriptorSize Length of the attached device's Configuration Descriptor
|
||||
* \param[in] DeviceConfigDescriptor Pointer to a buffer containing the attached device's Configuration Descriptor
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] ConfigDescriptorSize 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
|
||||
* \return A value from the \ref SIHost_EnumerationFailure_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, uint16_t ConfigDescriptorSize,
|
||||
void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);
|
||||
@@ -149,10 +149,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -162,10 +162,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -175,10 +175,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in] PIMAHeader Pointer to a PIMA container structure that is to be sent
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] PIMAHeader Pointer to a PIMA container structure that is to be sent.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
|
||||
@@ -190,10 +190,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the received block is to be stored
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the received block is to be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_ReceiveBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
|
||||
@@ -204,13 +204,13 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in] Operation PIMA operation code to issue to the device
|
||||
* \param[in] TotalParams Total number of 32-bit parameters to send to the device in the issued command block
|
||||
* \param[in] Params Pointer to an array of 32-bit values containing the parameters to send in the command block
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] Operation PIMA operation code to issue to the device.
|
||||
* \param[in] TotalParams Total number of 32-bit parameters to send to the device in the issued command block.
|
||||
* \param[in] Params Pointer to an array of 32-bit values containing the parameters to send in the command block.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_SendCommand(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, const uint16_t Operation,
|
||||
const uint8_t TotalParams, uint32_t* Params) ATTR_NON_NULL_PTR_ARG(1);
|
||||
@@ -221,10 +221,10 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_ReceiveResponse(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -233,9 +233,9 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*
|
||||
* \return Boolean true if an event is waiting to be read, false otherwise
|
||||
* \return Boolean true if an event is waiting to be read, false otherwise.
|
||||
*/
|
||||
bool SImage_Host_IsEventReceived(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
|
||||
@@ -244,11 +244,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the event should be stored
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[out] PIMAHeader Pointer to a PIMA container structure where the event should be stored.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum, or \ref SI_ERROR_LOGICAL_CMD_FAILED if the device
|
||||
* returned a logical command failure
|
||||
* returned a logical command failure.
|
||||
*/
|
||||
uint8_t SImage_Host_ReceiveEventHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
||||
SI_PIMA_Container_t* const PIMAHeader) ATTR_NON_NULL_PTR_ARG(1)
|
||||
@@ -260,11 +260,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[in] Buffer Pointer to a buffer where the data to send has been stored
|
||||
* \param[in] Bytes Length in bytes of the data in the buffer to send to the attached device
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[in] Buffer Pointer to a buffer where the data to send has been stored.
|
||||
* \param[in] Bytes Length in bytes of the data in the buffer to send to the attached device.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_SendData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, void* Buffer,
|
||||
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -275,11 +275,11 @@
|
||||
* \pre This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the
|
||||
* call will fail.
|
||||
*
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
|
||||
* \param[out] Buffer Pointer to a buffer where the received data is to be stored
|
||||
* \param[in] Bytes Length in bytes of the data to read
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
* \param[out] Buffer Pointer to a buffer where the received data is to be stored.
|
||||
* \param[in] Bytes Length in bytes of the data to read.
|
||||
*
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum
|
||||
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, void* Buffer,
|
||||
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
|
||||
@@ -289,7 +289,7 @@
|
||||
* 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
|
||||
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state.
|
||||
*/
|
||||
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
|
||||
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
|
||||
|
||||
Reference in New Issue
Block a user