Inline USB management functions in the Class drivers which are standardized but currently unused, to prevent them from using up unneccesary cycles and flash in the user application.

This commit is contained in:
Dean Camera 2010-01-05 04:50:18 +00:00
parent 6122ba93cf
commit 60e9641222
20 changed files with 119 additions and 120 deletions

View file

@ -150,11 +150,6 @@ static uint8_t DComp_HID_Host_NextHIDInterfaceEndpoint(void* const CurrentDescri
return DESCRIPTOR_SEARCH_NotFound;
}
void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)
{
(void)HIDInterfaceInfo;
}
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, const uint8_t ReportID, void* Buffer)
{

View file

@ -130,14 +130,6 @@
};
/* Function Prototypes: */
/** General management task for a given Human Interface Class 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] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
*/
void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Host interface configuration routine, to configure a given HID host interface instance using the Configuration
* Descriptor read from an attached USB device. This function automatically updates the given HID Host instance's
* state values and configures the pipes required to communicate with the interface if it is found within the
@ -261,6 +253,19 @@
uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
#endif
/* Inline Functions: */
/** General management task for a given Human Interface Class 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] 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)
{
(void)HIDInterfaceInfo;
}
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */

View file

@ -122,11 +122,6 @@ static uint8_t DComp_MIDI_Host_NextMIDIStreamingDataEndpoint(void* const Current
return DESCRIPTOR_SEARCH_NotFound;
}
void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
{
(void)MIDIInterfaceInfo;
}
uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, MIDI_EventPacket_t* const Event)
{
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))

View file

@ -97,13 +97,6 @@
};
/* Function Prototypes: */
/** 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
*/
void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Host interface configuration routine, to configure a given MIDI host interface instance using the Configuration
* Descriptor read from an attached USB device. This function automatically updates the given MIDI Host instance's
* state values and configures the pipes required to communicate with the interface if it is found within the device.
@ -144,7 +137,19 @@
*/
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);
/* Inline Functions: */
/** 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
*/
static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo);
static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)
{
(void)MIDIInterfaceInfo;
}
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */

View file

@ -127,11 +127,6 @@ static uint8_t DComp_NextMSInterfaceEndpoint(void* const CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound;
}
void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
{
(void)MSInterfaceInfo;
}
static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MS_CommandBlockWrapper_t* const SCSICommandBlock,
void* BufferPtr)
{

View file

@ -113,14 +113,6 @@
};
/* Function Prototypes: */
/** General management task for a given Mass Storage 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] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state
*/
void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Host interface configuration routine, to configure a given Mass Storage host interface instance using the
* Configuration Descriptor read from an attached USB device. This function automatically updates the given Mass
* Storage Host instance's state values and configures the pipes required to communicate with the interface if it
@ -269,6 +261,19 @@
const uint32_t BlockAddress, const uint8_t Blocks, const uint16_t BlockSize,
void* BlockBuffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(6);
/* Inline Functions: */
/** General management task for a given Mass Storage 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] 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)
{
(void)MSInterfaceInfo;
}
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */

View file

@ -122,11 +122,6 @@ static uint8_t DComp_NextPRNTInterfaceEndpoint(void* CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound;
}
void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
{
(void)PRNTInterfaceInfo;
}
uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
{
if (PRNTInterfaceInfo->State.AlternateSetting)

View file

@ -100,15 +100,6 @@
};
/* Function Prototypes: */
/** General management task for a given Printer 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] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state
*/
void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Host interface configuration routine, to configure a given Printer host interface instance using the
* Configuration Descriptor read from an attached USB device. This function automatically updates the given Printer
* instance's state values and configures the pipes required to communicate with the interface if it is found within
@ -184,6 +175,19 @@
uint8_t PRNT_Host_GetDeviceID(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, char* DeviceIDString,
uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(1);
/* Inline Functions: */
/** General management task for a given Printer 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] 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);
static inline void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)
{
(void)PRNTInterfaceInfo;
}
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */

View file

@ -205,11 +205,6 @@ static uint8_t DComp_RNDIS_Host_NextRNDISInterfaceEndpoint(void* const CurrentDe
return DESCRIPTOR_SEARCH_NotFound;
}
void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo)
{
(void)RNDISInterfaceInfo;
}
static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,
void* Buffer, uint16_t Length)
{

View file

@ -120,13 +120,6 @@
#define RNDIS_COMMAND_FAILED 0xC0
/* Function Prototypes: */
/** 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
*/
void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Host interface configuration routine, to configure a given RNDIS host interface instance using the Configuration
* Descriptor read from an attached USB device. This function automatically updates the given RNDIS Host instance's
* state values and configures the pipes required to communicate with the interface if it is found within the device.
@ -229,6 +222,18 @@
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);
/* Inline Functions: */
/** 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
*/
static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo);
static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo)
{
(void)RNDISInterfaceInfo;
}
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */

View file

@ -142,11 +142,6 @@ uint8_t DComp_SI_Host_NextSIInterfaceEndpoint(void* const CurrentDescriptor)
return DESCRIPTOR_SEARCH_NotFound;
}
void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{
(void)SIInterfaceInfo;
}
uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, SI_PIMA_Container_t* const PIMAHeader)
{
uint8_t ErrorCode;

View file

@ -108,15 +108,6 @@
};
/* Function Prototypes: */
/** General management task for a given Still Image host class interface, required for the correct operation of the
* interface. This should be called frequently in the main program loop, before the master USB management task
* \ref USB_USBTask().
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
*/
void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
/** Host interface configuration routine, to configure a given Still Image host interface instance using the
* Configuration Descriptor read from an attached USB device. This function automatically updates the given Still
* Image Host instance's state values and configures the pipes required to communicate with the interface if it is
@ -268,7 +259,20 @@
*/
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);
/* Inline Functions: */
/** General management task for a given Still Image host class interface, required for the correct operation of the
* interface. This should be called frequently in the main program loop, before the master USB management task
* \ref USB_USBTask().
*
* \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state
*/
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo);
static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
{
(void)SIInterfaceInfo;
}
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Macros: */