Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions common/usbx_device_classes/inc/ux_device_class_hid.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/

Expand All @@ -14,7 +14,7 @@
/** */
/** USBX Component */
/** */
/** HID Class */
/** Device HID Class */
/** */
/**************************************************************************/
/**************************************************************************/
Expand Down Expand Up @@ -389,7 +389,7 @@ typedef struct UX_SLAVE_CLASS_HID_PARAMETER_STRUCT

/* Define HID Class function prototypes. */
UINT _ux_device_class_hid_descriptor_send(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
ULONG request_index, ULONG host_length);
ULONG request_index, ULONG host_length);
UINT _ux_device_class_hid_activate(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_hid_deactivate(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_hid_control_request(UX_SLAVE_CLASS_COMMAND *command);
Expand All @@ -398,35 +398,35 @@ VOID _ux_device_class_hid_interrupt_thread(ULONG hid_class);
UINT _ux_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_hid_uninitialize(UX_SLAVE_CLASS_COMMAND *command);
UINT _ux_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_EVENT *hid_event);
UX_SLAVE_CLASS_HID_EVENT *hid_event);
UINT _ux_device_class_hid_event_check(UX_SLAVE_CLASS_HID *hid,
UX_DEVICE_CLASS_HID_EVENT **hid_event);
VOID _ux_device_class_hid_event_free(UX_SLAVE_CLASS_HID *hid);
UINT _ux_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_EVENT *hid_event);
UX_SLAVE_CLASS_HID_EVENT *hid_event);
UINT _ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
ULONG request_index, ULONG host_length);
ULONG request_index, ULONG host_length);
UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type,
ULONG request_index, ULONG host_length);
ULONG request_index, ULONG host_length);

UINT _ux_device_class_hid_tasks_run(VOID *class_instance);
UINT _ux_device_class_hid_tasks_run(VOID *hid_instance);

UINT _ux_device_class_hid_read(UX_SLAVE_CLASS_HID *hid,
UCHAR *buffer, ULONG requested_length,
ULONG *actual_length);

VOID _ux_device_class_hid_receiver_thread(ULONG hid_class);
UINT _ux_device_class_hid_receiver_initialize(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_PARAMETER *parameter,
UX_DEVICE_CLASS_HID_RECEIVER **receiver);
UX_SLAVE_CLASS_HID_PARAMETER *parameter,
UX_DEVICE_CLASS_HID_RECEIVER **receiver);
VOID _ux_device_class_hid_receiver_uninitialize(UX_DEVICE_CLASS_HID_RECEIVER *receiver);
UINT _ux_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid,
UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event);
UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event);
UINT _ux_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid);

UINT _ux_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid,
UCHAR *buffer, ULONG requested_length,
ULONG *actual_length);
UCHAR *buffer, ULONG requested_length,
ULONG *actual_length);
UINT _ux_device_class_hid_receiver_tasks_run(UX_SLAVE_CLASS_HID *hid);


Expand All @@ -436,16 +436,16 @@ UINT _uxe_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid,
UINT _uxe_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_EVENT *hid_event);
UINT _uxe_device_class_hid_read(UX_SLAVE_CLASS_HID *hid,
UCHAR *buffer, ULONG requested_length,
ULONG *actual_length);
UCHAR *buffer, ULONG requested_length,
ULONG *actual_length);
UINT _uxe_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid,
UCHAR *buffer, ULONG requested_length,
ULONG *actual_length);
UCHAR *buffer, ULONG requested_length,
ULONG *actual_length);
UINT _uxe_device_class_hid_receiver_initialize(UX_SLAVE_CLASS_HID *hid,
UX_SLAVE_CLASS_HID_PARAMETER *parameter,
UX_DEVICE_CLASS_HID_RECEIVER **receiver);
UX_SLAVE_CLASS_HID_PARAMETER *parameter,
UX_DEVICE_CLASS_HID_RECEIVER **receiver);
UINT _uxe_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid,
UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event);
UX_DEVICE_CLASS_HID_RECEIVED_EVENT *event);
UINT _uxe_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid);


Expand Down Expand Up @@ -493,4 +493,4 @@ UINT _uxe_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid);
}
#endif

#endif
#endif /* UX_DEVICE_CLASS_HID_H */
8 changes: 5 additions & 3 deletions common/usbx_device_classes/src/ux_device_class_hid_activate.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/


/**************************************************************************/
/**************************************************************************/
/** */
/** USBX Component */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
*
* SPDX-License-Identifier: MIT
**************************************************************************/


/**************************************************************************/
/**************************************************************************/
/** */
/** USBX Component */
/** */
/** USBX Component */
/** */
/** Device HID Class */
/** */
Expand All @@ -28,44 +29,44 @@
#include "ux_device_stack.h"


/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _ux_device_class_hid_control_request PORTABLE C */
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _ux_device_class_hid_control_request PORTABLE C */
/* 6.1.12 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This function manages the based sent by the host on the control */
/* endpoints with a CLASS or VENDOR SPECIFIC type. */
/* */
/* INPUT */
/* */
/* hid Pointer to hid class */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _ux_device_stack_transfer_request Transfer request */
/* */
/* This function manages the based sent by the host on the control */
/* endpoints with a CLASS or VENDOR SPECIFIC type. */
/* */
/* INPUT */
/* */
/* command Pointer to hid command */
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
/* _ux_device_stack_transfer_request Transfer request */
/* _ux_device_class_hid_report_get Process Get_Report request */
/* _ux_device_class_hid_report_set Process Set_Report request */
/* _ux_device_class_hid_descriptor_send Send requested descriptor */
/* */
/* CALLED BY */
/* */
/* */
/* CALLED BY */
/* */
/* HID Class */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* prefixed UX to MS_TO_TICK, */
Expand Down Expand Up @@ -119,10 +120,10 @@ UX_SLAVE_CLASS_HID *hid;

/* Duration - upper byte of wValue. */
duration = *(transfer_request -> ux_slave_transfer_request_setup + UX_SETUP_VALUE + 1);

/* Get the class container. */
class_ptr = command -> ux_slave_class_command_class_ptr;

/* Get the storage instance from this class container. */
hid = (UX_SLAVE_CLASS_HID *) class_ptr -> ux_slave_class_instance;

Expand All @@ -149,8 +150,8 @@ UX_SLAVE_CLASS_HID *hid;

/* Send the requested descriptor to the host. */
_ux_device_class_hid_descriptor_send(hid, request_value, request_index, request_length);
break;
break;

case UX_DEVICE_CLASS_HID_COMMAND_GET_IDLE:
case UX_DEVICE_CLASS_HID_COMMAND_SET_IDLE:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* SPDX-License-Identifier: MIT
**************************************************************************/


/**************************************************************************/
/**************************************************************************/
/** */
Expand Down
Loading