Commit f896c00c authored by Dean Camera's avatar Dean Camera

Break device mode class driver interfaces into seperate config and state...

Break device mode class driver interfaces into seperate config and state structs which are then combined, for clarity. Move device mode class driver interfaces back into the device mode class driver headers from the common class headers to make room for host class interfaces.
parent e338cb6f
......@@ -40,12 +40,20 @@
* passed to all Audio Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
USB_ClassInfo_Audio_t Microphone_Audio_Interface =
USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
{
.StreamingInterfaceNumber = 1,
.Config =
{
.StreamingInterfaceNumber = 1,
.DataINEndpointNumber = AUDIO_STREAM_EPNUM,
.DataINEndpointSize = AUDIO_STREAM_EPSIZE,
.DataINEndpointNumber = AUDIO_STREAM_EPNUM,
.DataINEndpointSize = AUDIO_STREAM_EPSIZE,
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......@@ -59,7 +67,7 @@ int main(void)
for (;;)
{
if (Microphone_Audio_Interface.InterfaceEnabled)
if (Microphone_Audio_Interface.State.InterfaceEnabled)
ProcessNextSample();
Audio_Device_USBTask(&Microphone_Audio_Interface);
......
......@@ -40,12 +40,20 @@
* passed to all Audio Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
USB_ClassInfo_Audio_t Speaker_Audio_Interface =
USB_ClassInfo_Audio_Device_t Speaker_Audio_Interface =
{
.StreamingInterfaceNumber = 1,
.DataOUTEndpointNumber = AUDIO_STREAM_EPNUM,
.DataOUTEndpointSize = AUDIO_STREAM_EPSIZE,
.Config =
{
.StreamingInterfaceNumber = 1,
.DataINEndpointNumber = AUDIO_STREAM_EPNUM,
.DataINEndpointSize = AUDIO_STREAM_EPSIZE,
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......@@ -59,7 +67,7 @@ int main(void)
for (;;)
{
if (Speaker_Audio_Interface.InterfaceEnabled)
if (Speaker_Audio_Interface.State.InterfaceEnabled)
ProcessNextSample();
Audio_Device_USBTask(&Speaker_Audio_Interface);
......
......@@ -40,18 +40,26 @@
* passed to all CDC Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
USB_ClassInfo_CDC_t VirtualSerial_CDC_Interface =
USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{
.ControlInterfaceNumber = 0,
.Config =
{
.ControlInterfaceNumber = 0,
.DataINEndpointNumber = CDC_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataINEndpointNumber = CDC_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointNumber = CDC_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointNumber = CDC_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......
......@@ -41,18 +41,26 @@
* within a device can be differentiated from one another. This is for the first CDC interface,
* which sends strings to the host for each joystick movement.
*/
USB_ClassInfo_CDC_t VirtualSerial1_CDC_Interface =
USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface =
{
.ControlInterfaceNumber = 0,
.Config =
{
.ControlInterfaceNumber = 0,
.DataINEndpointNumber = CDC1_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataINEndpointNumber = CDC1_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointNumber = CDC1_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointNumber = CDC1_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
.NotificationEndpointNumber = CDC1_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
},
.State =
{
// Leave all state values to their defaults
}
};
/** LUFA CDC Class driver interface configuration and state information. This structure is
......@@ -60,18 +68,26 @@ USB_ClassInfo_CDC_t VirtualSerial1_CDC_Interface =
* within a device can be differentiated from one another. This is for the second CDC interface,
* which echos back all received data from the host.
*/
USB_ClassInfo_CDC_t VirtualSerial2_CDC_Interface =
USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
{
.ControlInterfaceNumber = 2,
.DataINEndpointNumber = CDC2_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointNumber = CDC2_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
.Config =
{
.ControlInterfaceNumber = 2,
.DataINEndpointNumber = CDC2_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointNumber = CDC2_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.NotificationEndpointNumber = CDC2_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......
......@@ -40,16 +40,22 @@
* passed to all HID Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
USB_ClassInfo_HID_t Generic_HID_Interface =
USB_ClassInfo_HID_Device_t Generic_HID_Interface =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = GENERIC_IN_EPNUM,
.ReportINEndpointSize = GENERIC_EPSIZE,
.ReportINBufferSize = GENERIC_REPORT_SIZE,
.UsingReportProtocol = true,
.Config =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = GENERIC_IN_EPNUM,
.ReportINEndpointSize = GENERIC_EPSIZE,
.ReportINBufferSize = GENERIC_REPORT_SIZE,
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......@@ -119,8 +125,8 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
if (Generic_HID_Interface.IdleMSRemaining)
Generic_HID_Interface.IdleMSRemaining--;
if (Generic_HID_Interface.State.IdleMSRemaining)
Generic_HID_Interface.State.IdleMSRemaining--;
}
/** HID class driver callback function for the creation of HID reports to the host.
......@@ -131,7 +137,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{
// Create generic HID report here
......@@ -145,7 +151,7 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceIn
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
// Process received generic HID report here
......
......@@ -72,8 +72,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif
......@@ -40,16 +40,22 @@
* passed to all HID Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
USB_ClassInfo_HID_t Joystick_HID_Interface =
USB_ClassInfo_HID_Device_t Joystick_HID_Interface =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = JOYSTICK_EPNUM,
.ReportINEndpointSize = JOYSTICK_EPSIZE,
.ReportINBufferSize = sizeof(USB_JoystickReport_Data_t),
.UsingReportProtocol = true,
.Config =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = JOYSTICK_EPNUM,
.ReportINEndpointSize = JOYSTICK_EPSIZE,
.ReportINBufferSize = sizeof(USB_JoystickReport_Data_t),
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......@@ -121,8 +127,8 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
if (Joystick_HID_Interface.IdleMSRemaining)
Joystick_HID_Interface.IdleMSRemaining--;
if (Joystick_HID_Interface.State.IdleMSRemaining)
Joystick_HID_Interface.State.IdleMSRemaining--;
}
/** HID class driver callback function for the creation of HID reports to the host.
......@@ -133,7 +139,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{
USB_JoystickReport_Data_t* JoystickReport = (USB_JoystickReport_Data_t*)ReportData;
......@@ -166,7 +172,7 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceIn
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
......
......@@ -83,8 +83,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
uint16_t CALLBACK_HID_Device_CreateNextHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessReceivedHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif
......@@ -41,16 +41,22 @@
* passed to all HID Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
USB_ClassInfo_HID_t Keyboard_HID_Interface =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = KEYBOARD_EPNUM,
.ReportINEndpointSize = KEYBOARD_EPSIZE,
.ReportINBufferSize = sizeof(USB_KeyboardReport_Data_t),
.IdleCount = 500,
USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
{
.Config =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = KEYBOARD_EPNUM,
.ReportINEndpointSize = KEYBOARD_EPSIZE,
.ReportINBufferSize = sizeof(USB_KeyboardReport_Data_t),
},
.State =
{
.IdleCount = 500,
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......@@ -122,8 +128,8 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
if (Keyboard_HID_Interface.IdleMSRemaining)
Keyboard_HID_Interface.IdleMSRemaining--;
if (Keyboard_HID_Interface.State.IdleMSRemaining)
Keyboard_HID_Interface.State.IdleMSRemaining--;
}
/** HID class driver callback function for the creation of HID reports to the host.
......@@ -134,7 +140,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
......@@ -167,7 +173,7 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceIn
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
uint8_t LEDMask = LEDS_NO_LEDS;
......
......@@ -86,8 +86,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif
......@@ -42,16 +42,22 @@
* within a device can be differentiated from one another. This is for the keyboard HID
* interface within the device.
*/
USB_ClassInfo_HID_t Keyboard_HID_Interface =
USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = KEYBOARD_IN_EPNUM,
.ReportINEndpointSize = HID_EPSIZE,
.ReportINBufferSize = sizeof(USB_KeyboardReport_Data_t),
.IdleCount = 500,
.Config =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = KEYBOARD_IN_EPNUM,
.ReportINEndpointSize = HID_EPSIZE,
.ReportINBufferSize = sizeof(USB_KeyboardReport_Data_t),
},
.State =
{
.IdleCount = 500,
}
};
/** LUFA HID Class driver interface configuration and state information. This structure is
......@@ -59,14 +65,22 @@ USB_ClassInfo_HID_t Keyboard_HID_Interface =
* within a device can be differentiated from one another. This is for the mouse HID
* interface within the device.
*/
USB_ClassInfo_HID_t Mouse_HID_Interface =
USB_ClassInfo_HID_Device_t Mouse_HID_Interface =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = MOUSE_IN_EPNUM,
.ReportINEndpointSize = HID_EPSIZE,
.ReportINBufferSize = sizeof(USB_MouseReport_Data_t),
.Config =
{
.InterfaceNumber = 0,
.ReportINEndpointNumber = MOUSE_IN_EPNUM,
.ReportINEndpointSize = HID_EPSIZE,
.ReportINBufferSize = sizeof(USB_MouseReport_Data_t),
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......@@ -142,11 +156,11 @@ void EVENT_USB_UnhandledControlPacket(void)
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
ISR(TIMER0_COMPA_vect, ISR_BLOCK)
{
if (Keyboard_HID_Interface.IdleMSRemaining)
Keyboard_HID_Interface.IdleMSRemaining--;
if (Keyboard_HID_Interface.State.IdleMSRemaining)
Keyboard_HID_Interface.State.IdleMSRemaining--;
if (Mouse_HID_Interface.IdleMSRemaining)
Mouse_HID_Interface.IdleMSRemaining--;
if (Mouse_HID_Interface.State.IdleMSRemaining)
Mouse_HID_Interface.State.IdleMSRemaining--;
}
/** HID class driver callback function for the creation of HID reports to the host.
......@@ -157,7 +171,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
*
* \return Number of bytes written in the report (or zero if no report is to be sent
*/
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{
uint8_t JoyStatus_LCL = Joystick_GetStatus();
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
......@@ -217,7 +231,7 @@ uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceIn
* \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report
*/
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
if (HIDInterfaceInfo == &Keyboard_HID_Interface)
......
......@@ -90,8 +90,9 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t* ReportID,
void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif
......@@ -40,15 +40,23 @@
* passed to all MIDI Class driver functions, so that multiple instances of the same class
* within a device can be differentiated from one another.
*/
USB_ClassInfo_MIDI_t Keyboard_MIDI_Interface =
USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface =
{
.StreamingInterfaceNumber = 1,
.Config =
{
.StreamingInterfaceNumber = 1,
.DataINEndpointNumber = MIDI_STREAM_IN_EPNUM,
.DataINEndpointSize = MIDI_STREAM_EPSIZE,
.DataINEndpointNumber = MIDI_STREAM_IN_EPNUM,
.DataINEndpointSize = MIDI_STREAM_EPSIZE,
.DataOUTEndpointNumber = MIDI_STREAM_OUT_EPNUM,
.DataOUTEndpointSize = MIDI_STREAM_EPSIZE,
.DataOUTEndpointNumber = MIDI_STREAM_OUT_EPNUM,
.DataOUTEndpointSize = MIDI_STREAM_EPSIZE,
},
.State =
{
// Leave all state values to their defaults
}
};
/** Main program entry point. This routine contains the overall program flow, including initial
......
......@@ -47,7 +47,7 @@
* \param BlockAddress Data block starting address for the write sequence
* \param TotalBlocks Number of blocks of data to write
*/
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
{
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
......@@ -143,7 +143,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uin
BytesInBlockDiv16++;
/* Check if the current command is being aborted by the host */
if (MSInterfaceInfo->IsMassStoreReset)
if (MSInterfaceInfo->State.IsMassStoreReset)
return;
}
......@@ -173,7 +173,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uin
* \param BlockAddress Data block starting address for the read sequence
* \param TotalBlocks Number of blocks of data to read
*/
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
{
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
......@@ -252,7 +252,7 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uint
BytesInBlockDiv16++;
/* Check if the current command is being aborted by the host */
if (MSInterfaceInfo->IsMassStoreReset)
if (MSInterfaceInfo->State.IsMassStoreReset)
return;
}
......
......@@ -64,9 +64,9 @@
#define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
/* Function Prototypes: */
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uint32_t BlockAddress,
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress,
uint16_t TotalBlocks);
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uint32_t BlockAddress,
void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, const uint32_t BlockAddress,
uint16_t TotalBlocks);
void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
......
......@@ -86,12 +86,12 @@ SCSI_Request_Sense_Response_t SenseData =
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_t* MSInterfaceInfo)
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)