{\r
Temp = *Data;\r
*Data = *(Data + Bytes - 1);\r
- *(Data + Bytes) = Temp;\r
+ *(Data + Bytes - 1) = Temp;\r
\r
Data++;\r
Bytes -= 2;\r
return true;\r
}\r
\r
-void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
-{\r
- (void)AudioInterfaceInfo;\r
-}\r
-\r
bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
{\r
if ((USB_DeviceState != DEVICE_STATE_Configured) || !(AudioInterfaceInfo->State.InterfaceEnabled))\r
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state\r
*/\r
void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
-\r
- /** General management task for a given Audio class interface, required for the correct operation of the interface. This should\r
- * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
- *\r
- * \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state\r
- */\r
- void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
\r
/** Determines if the given audio interface is ready for a sample to be read from it, and selects the streaming\r
* OUT endpoint ready for reading.\r
bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
\r
/* Inline Functions: */\r
+ /** General management task for a given Audio class interface, required for the correct operation of the interface. This should\r
+ * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state\r
+ */\r
+ static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
+ static inline void Audio_Device_USBTask(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
+ {\r
+ (void)AudioInterfaceInfo;\r
+ }\r
+\r
/** Reads the next 8-bit audio sample from the current audio interface.\r
*\r
* \note This should be preceded immediately by a call to the USB_Audio_IsSampleReceived() function to ensure that\r
*/\r
void HID_Device_USBTask(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** Indicates that a millisecond of idle time has elapsed on the given HID interface, and the interface's idle count should be\r
- * decremented. This should be called once per millisecond so that hardware key-repeats function correctly. It is recommended\r
- * that this be called by the \ref EVENT_USB_Device_StartOfFrame() event, once SOF events have been enabled via\r
- * \ref USB_Device_EnableSOFEvents();.\r
- *\r
- * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state\r
- */\r
- static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
- static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo)\r
- {\r
- if (HIDInterfaceInfo->State.IdleMSRemaining)\r
- HIDInterfaceInfo->State.IdleMSRemaining--;\r
- }\r
- \r
/** HID class driver callback for the user creation of a HID IN report. This callback may fire in response to either\r
* HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the\r
* user is responsible for the creation of the next HID input report to be sent to the host.\r
const void* ReportData, const uint16_t ReportSize) ATTR_NON_NULL_PTR_ARG(1)\r
ATTR_NON_NULL_PTR_ARG(3);\r
\r
+ /* Inline Functions: */\r
+ /** Indicates that a millisecond of idle time has elapsed on the given HID interface, and the interface's idle count should be\r
+ * decremented. This should be called once per millisecond so that hardware key-repeats function correctly. It is recommended\r
+ * that this be called by the \ref EVENT_USB_Device_StartOfFrame() event, once SOF events have been enabled via\r
+ * \ref USB_Device_EnableSOFEvents();.\r
+ *\r
+ * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state\r
+ */\r
+ static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
+ static inline void HID_Device_MillisecondElapsed(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo)\r
+ {\r
+ if (HIDInterfaceInfo->State.IdleMSRemaining)\r
+ HIDInterfaceInfo->State.IdleMSRemaining--;\r
+ }\r
+ \r
/* Disable C linkage for C++ Compilers: */\r
#if defined(__cplusplus)\r
}\r
return true;\r
}\r
\r
-void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)\r
-{\r
- (void)MIDIInterfaceInfo;\r
-}\r
-\r
uint8_t MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo, MIDI_EventPacket_t* const Event)\r
{\r
if (USB_DeviceState != DEVICE_STATE_Configured)\r
*/ \r
void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
\r
- /** General management task for a given MIDI class interface, required for the correct operation of the interface. This should\r
- * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
- *\r
- * \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state\r
- */\r
- void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
-\r
/** Sends a MIDI event packet to the host. If no host is connected, the event packet is discarded.\r
*\r
* \note This function must only be called when the Device state machine is in the DEVICE_STATE_Configured state or\r
bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo,\r
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
\r
+ /* Inline Functions: */\r
+ /** General management task for a given MIDI class interface, required for the correct operation of the interface. This should\r
+ * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state\r
+ */\r
+ static inline void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);\r
+ static inline void MIDI_Device_USBTask(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)\r
+ {\r
+ (void)MIDIInterfaceInfo;\r
+ } \r
+\r
/* Disable C linkage for C++ Compilers: */\r
#if defined(__cplusplus)\r
}\r
return DESCRIPTOR_SEARCH_NotFound;\r
}\r
\r
-void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)\r
-{\r
- (void)HIDInterfaceInfo;\r
-}\r
-\r
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)\r
uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, const uint8_t ReportID, void* Buffer)\r
{\r
};\r
\r
/* Function Prototypes: */\r
- /** General management task for a given Human Interface Class host class interface, required for the correct operation of\r
- * the interface. This should be called frequently in the main program loop, before the master USB management task\r
- * \ref USB_USBTask().\r
- *\r
- * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state\r
- */\r
- void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
-\r
/** Host interface configuration routine, to configure a given HID host interface instance using the Configuration\r
* Descriptor read from an attached USB device. This function automatically updates the given HID Host instance's\r
* state values and configures the pipes required to communicate with the interface if it is found within the\r
uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
#endif\r
\r
+ /* Inline Functions: */\r
+ /** General management task for a given Human Interface Class host class interface, required for the correct operation of\r
+ * the interface. This should be called frequently in the main program loop, before the master USB management task\r
+ * \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state\r
+ */\r
+ static inline void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo);\r
+ static inline void HID_Host_USBTask(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo)\r
+ {\r
+ (void)HIDInterfaceInfo;\r
+ } \r
+\r
/* Private Interface - For use in library only: */\r
#if !defined(__DOXYGEN__)\r
/* Macros: */\r
return DESCRIPTOR_SEARCH_NotFound;\r
}\r
\r
-void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)\r
-{\r
- (void)MIDIInterfaceInfo;\r
-}\r
-\r
uint8_t MIDI_Host_SendEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo, MIDI_EventPacket_t* const Event)\r
{\r
if ((USB_HostState != HOST_STATE_Configured) || !(MIDIInterfaceInfo->State.IsActive))\r
};\r
\r
/* Function Prototypes: */\r
- /** General management task for a given MIDI host class interface, required for the correct operation of the interface. This should\r
- * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
- *\r
- * \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state\r
- */\r
- void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
- \r
/** Host interface configuration routine, to configure a given MIDI host interface instance using the Configuration\r
* Descriptor read from an attached USB device. This function automatically updates the given MIDI Host instance's\r
* state values and configures the pipes required to communicate with the interface if it is found within the device.\r
*/\r
bool MIDI_Host_ReceiveEventPacket(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo,\r
MIDI_EventPacket_t* const Event) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
- \r
+\r
+ /* Inline Functions: */\r
+ /** General management task for a given MIDI host class interface, required for the correct operation of the interface. This should\r
+ * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] MIDIInterfaceInfo Pointer to a structure containing an MIDI Class host configuration and state\r
+ */\r
+ static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo);\r
+ static inline void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo)\r
+ {\r
+ (void)MIDIInterfaceInfo;\r
+ }\r
+\r
/* Private Interface - For use in library only: */\r
#if !defined(__DOXYGEN__)\r
/* Macros: */\r
return DESCRIPTOR_SEARCH_NotFound;\r
}\r
\r
-void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)\r
-{\r
- (void)MSInterfaceInfo;\r
-}\r
-\r
static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, MS_CommandBlockWrapper_t* const SCSICommandBlock,\r
void* BufferPtr)\r
{\r
};\r
\r
/* Function Prototypes: */\r
- /** General management task for a given Mass Storage host class interface, required for the correct operation of\r
- * the interface. This should be called frequently in the main program loop, before the master USB management task\r
- * \ref USB_USBTask().\r
- *\r
- * \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state\r
- */\r
- void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
- \r
/** Host interface configuration routine, to configure a given Mass Storage host interface instance using the\r
* Configuration Descriptor read from an attached USB device. This function automatically updates the given Mass\r
* Storage Host instance's state values and configures the pipes required to communicate with the interface if it\r
const uint32_t BlockAddress, const uint8_t Blocks, const uint16_t BlockSize,\r
void* BlockBuffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(6);\r
\r
+ /* Inline Functions: */\r
+ /** General management task for a given Mass Storage host class interface, required for the correct operation of\r
+ * the interface. This should be called frequently in the main program loop, before the master USB management task\r
+ * \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] MSInterfaceInfo Pointer to a structure containing an MS Class host configuration and state\r
+ */\r
+ static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo);\r
+ static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)\r
+ {\r
+ (void)MSInterfaceInfo;\r
+ }\r
+\r
/* Private Interface - For use in library only: */\r
#if !defined(__DOXYGEN__)\r
/* Macros: */\r
return DESCRIPTOR_SEARCH_NotFound;\r
}\r
\r
-void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)\r
-{\r
- (void)PRNTInterfaceInfo;\r
-}\r
-\r
uint8_t PRNT_Host_SetBidirectionalMode(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)\r
{\r
if (PRNTInterfaceInfo->State.AlternateSetting)\r
};\r
\r
/* Function Prototypes: */\r
- /** General management task for a given Printer host class interface, required for the correct operation of\r
- * the interface. This should be called frequently in the main program loop, before the master USB management task\r
- * \ref USB_USBTask().\r
- *\r
- * \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state\r
- */\r
- void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
- \r
-\r
/** Host interface configuration routine, to configure a given Printer host interface instance using the\r
* Configuration Descriptor read from an attached USB device. This function automatically updates the given Printer\r
* instance's state values and configures the pipes required to communicate with the interface if it is found within\r
uint8_t PRNT_Host_GetDeviceID(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo, char* DeviceIDString,\r
uint16_t BufferSize) ATTR_NON_NULL_PTR_ARG(1);\r
\r
+ /* Inline Functions: */\r
+ /** General management task for a given Printer host class interface, required for the correct operation of\r
+ * the interface. This should be called frequently in the main program loop, before the master USB management task\r
+ * \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] PRNTInterfaceInfo Pointer to a structure containing a Printer Class host configuration and state\r
+ */\r
+ static inline void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo);\r
+ static inline void PRNT_Host_USBTask(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceInfo)\r
+ {\r
+ (void)PRNTInterfaceInfo;\r
+ }\r
+\r
/* Private Interface - For use in library only: */\r
#if !defined(__DOXYGEN__)\r
/* Macros: */\r
return DESCRIPTOR_SEARCH_NotFound;\r
}\r
\r
-void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo)\r
-{\r
- (void)RNDISInterfaceInfo;\r
-}\r
-\r
static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo,\r
void* Buffer, uint16_t Length)\r
{\r
#define RNDIS_COMMAND_FAILED 0xC0 \r
\r
/* Function Prototypes: */\r
- /** General management task for a given RNDIS host class interface, required for the correct operation of the interface. This should\r
- * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
- *\r
- * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state\r
- */\r
- void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
- \r
/** Host interface configuration routine, to configure a given RNDIS host interface instance using the Configuration\r
* Descriptor read from an attached USB device. This function automatically updates the given RNDIS Host instance's\r
* state values and configures the pipes required to communicate with the interface if it is found within the device.\r
uint8_t RNDIS_Host_SendPacket(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo, void* Buffer, uint16_t PacketLength)\r
ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
\r
+ /* Inline Functions: */\r
+ /** General management task for a given RNDIS host class interface, required for the correct operation of the interface. This should\r
+ * be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] RNDISInterfaceInfo Pointer to a structure containing an RNDIS Class host configuration and state\r
+ */\r
+ static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo);\r
+ static inline void RNDIS_Host_USBTask(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfaceInfo)\r
+ {\r
+ (void)RNDISInterfaceInfo;\r
+ }\r
+\r
/* Private Interface - For use in library only: */\r
#if !defined(__DOXYGEN__)\r
/* Macros: */\r
return DESCRIPTOR_SEARCH_NotFound;\r
}\r
\r
-void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)\r
-{\r
- (void)SIInterfaceInfo;\r
-}\r
-\r
uint8_t SImage_Host_SendBlockHeader(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, SI_PIMA_Container_t* const PIMAHeader)\r
{\r
uint8_t ErrorCode;\r
};\r
\r
/* Function Prototypes: */\r
- /** General management task for a given Still Image host class interface, required for the correct operation of the\r
- * interface. This should be called frequently in the main program loop, before the master USB management task\r
- * \ref USB_USBTask().\r
- *\r
- * \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state\r
- */\r
- void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
-\r
-\r
/** Host interface configuration routine, to configure a given Still Image host interface instance using the\r
* Configuration Descriptor read from an attached USB device. This function automatically updates the given Still\r
* Image Host instance's state values and configures the pipes required to communicate with the interface if it is\r
*/\r
uint8_t SImage_Host_ReadData(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, void* Buffer,\r
const uint16_t Bytes) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
- \r
+ \r
+ /* Inline Functions: */\r
+ /** General management task for a given Still Image host class interface, required for the correct operation of the\r
+ * interface. This should be called frequently in the main program loop, before the master USB management task\r
+ * \ref USB_USBTask().\r
+ *\r
+ * \param[in,out] SIInterfaceInfo Pointer to a structure containing a Still Image Class host configuration and state\r
+ */\r
+ static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo);\r
+ static inline void SImage_Host_USBTask(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)\r
+ {\r
+ (void)SIInterfaceInfo;\r
+ } \r
+\r
/* Private Interface - For use in library only: */\r
#if !defined(__DOXYGEN__)\r
/* Macros: */\r
* reset\r
* - Changed over the MassStorageKeyboard Class driver device demo to use Start of Frame events rather than a timer to keep track\r
* of elapsed milliseconds\r
+ * - Inlined currently unused (but standardized) maintenance functions in the Device and Host Class drivers to save space\r
*\r
* <b>Fixed:</b>\r
* - Fixed AVRISP project not able to enter programming mode when ISP protocol is used\r
* Project Homepage: http://www.fourwalledcubicle.com/LUFA.php \n\r
* Development Blog: http://www.fourwalledcubicle.com/blog \n\r
* Discussion Group: http://groups.google.com/group/myusb-support-list \n\r
- * SVN Access, Bug Reports and Feature Requests: http://code.google.com/p/lufa-lib/ \n\r
+ * Official Releases, SVN Access, Issue Tracker: http://code.google.com/p/lufa-lib/ \n\r
* Git Access: http://github.com/abcminiuser/lufa-lib\r
* Commit RSS: http://github.com/feeds/abcminiuser/commits/lufa-lib/master\r
* Author's Website: http://www.fourwalledcubicle.com \n\r