aboutsummaryrefslogtreecommitdiff
path: root/Demos/Device/ClassDriver/Keyboard/Keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/ClassDriver/Keyboard/Keyboard.c')
-rw-r--r--Demos/Device/ClassDriver/Keyboard/Keyboard.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
index 7318edb8c7..f44a934516 100644
--- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c
+++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c
@@ -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;