Skip to content
Merged
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
5 changes: 3 additions & 2 deletions common/core/inc/ux_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,16 @@ typedef signed char SCHAR;

/* Map the error log macros to internal USBX function. */

#define UX_DEBUG_LOG(debug_location, debug_message, debug_code, debug_parameter_1, debug_parameter_2) _ux_utility_debug_log((UCHAR *) debug_location, (UCHAR *) debug_message, (ULONG) debug_code, (ULONG) debug_parameter_1, (ULONG) debug_parameter_2);
#define UX_DEBUG_LOG(debug_location, debug_message, debug_code, debug_parameter_1, debug_parameter_2) \
_ux_utility_debug_log((UCHAR *) debug_location, (UCHAR *) debug_message, (ULONG) debug_code, \
(ULONG) debug_parameter_1, (ULONG) debug_parameter_2);

VOID _ux_utility_debug_log(UCHAR *debug_location, UCHAR *debug_message, ULONG debug_code, ULONG debug_parameter_1, ULONG debug_parameter_2);

/* DEBUG LOG MESSAGES SHOULD BE WRITTEN LIKE THIS IN THE CODE : */
/* If error log is enabled, insert this error message into the log buffer. */
/* UX_DEBUG_LOG("_ux_host_stack_rh_device_insertion", "Device insertion", port_index, port_index, 0) */


#else

/* If Log is not defined, map it to nothing so that debug messages can stay in the code. */
Expand Down
102 changes: 53 additions & 49 deletions common/core/inc/ux_user_sample.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/***************************************************************************
* 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 */
/** */
/** User Specific */
Expand All @@ -20,29 +20,29 @@
/**************************************************************************/


/**************************************************************************/
/* */
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* ux_user.h PORTABLE C */
/**************************************************************************/
/* */
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* ux_user.h PORTABLE C */
/* 6.3.0 */
/* */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
/* This file contains user defines for configuring USBX in specific */
/* ways. This file will have an effect only if the application and */
/* USBX library are built with UX_INCLUDE_USER_DEFINE_FILE defined. */
/* Note that all the defines in this file may also be made on the */
/* command line when building USBX library and application objects. */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* */
/* This file contains user defines for configuring USBX in specific */
/* ways. This file will have an effect only if the application and */
/* USBX library are built with UX_INCLUDE_USER_DEFINE_FILE defined. */
/* Note that all the defines in this file may also be made on the */
/* command line when building USBX library and application objects. */
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
Expand Down Expand Up @@ -115,15 +115,15 @@


/* Define various build options for the USBX port. The application should either make changes
here by commenting or un-commenting the conditional compilation defined OR supply the defines
here by commenting or un-commenting the conditional compilation defined OR supply the defines
though the compiler's equivalent of the -D option. */

/* Define USBX Generic Thread Stack Size. */
/* #define UX_THREAD_STACK_SIZE (2 * 1024) */

/* Define USBX Host Enum Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE */
/*
#define UX_HOST_ENUM_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
/*
#define UX_HOST_ENUM_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
*/


Expand All @@ -137,14 +137,14 @@
#define UX_HOST_HNP_POLLING_THREAD_STACK UX_THREAD_STACK_SIZE
*/

/* Override various options with default values already assigned in ux_api.h or ux_port.h. Please
/* Override various options with default values already assigned in ux_api.h or ux_port.h. Please
also refer to ux_port.h for descriptions on each of these options. */

/* Defined, this value represents minimal allocated memory alignment in number of bytes.
The default is UX_ALIGN_8 (0x07) to align allocated memory to 8 bytes. */
/* #define UX_ALIGN_MIN UX_ALIGN_8 */

/* Defined, this value represents how many ticks per seconds for a specific hardware platform.
/* Defined, this value represents how many ticks per seconds for a specific hardware platform.
The default is 1000 indicating 1 tick per millisecond. */

/* #define UX_PERIODIC_RATE 1000
Expand All @@ -167,7 +167,7 @@
/* Defined, this value is the maximum number of classes that can be loaded by USBX. This value
represents the class container and not the number of instances of a class. For instance, if a
particular implementation of USBX needs the hub class, the printer class, and the storage
class, then the UX_MAX_CLASSES value can be set to 3 regardless of the number of devices
class, then the UX_MAX_CLASSES value can be set to 3 regardless of the number of devices
that belong to these classes. */

/* #define UX_MAX_CLASSES 3
Expand All @@ -185,9 +185,9 @@
/* #define UX_MAX_SLAVE_INTERFACES 16
*/

/* Defined, this value represents the number of different host controllers available in the system.
For USB 1.1 support, this value will usually be 1. For USB 2.0 support, this value can be more
than 1. This value represents the number of concurrent host controllers running at the same time.
/* Defined, this value represents the number of different host controllers available in the system.
For USB 1.1 support, this value will usually be 1. For USB 2.0 support, this value can be more
than 1. This value represents the number of concurrent host controllers running at the same time.
If for instance there are two instances of OHCI running, or one EHCI and one OHCI controller
running, the UX_MAX_HCD should be set to 2. */

Expand All @@ -196,8 +196,8 @@


/* Defined, this value represents the maximum number of devices that can be attached to the USB.
Normally, the theoretical maximum number on a single USB is 127 devices. This value can be
scaled down to conserve memory. Note that this value represents the total number of devices
Normally, the theoretical maximum number on a single USB is 127 devices. This value can be
scaled down to conserve memory. Note that this value represents the total number of devices
regardless of the number of USB buses in the system. */

/* #define UX_MAX_DEVICES 127
Expand All @@ -213,7 +213,7 @@

/* Defined, this value represents the maximum number of SCSI logical units represented in the
host storage class driver. */

/* #define UX_MAX_HOST_LUN 1
*/

Expand Down Expand Up @@ -274,13 +274,13 @@


/* Defined, this value represents the maximum number of bytes that can be received or transmitted
on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default
is 4096 bytes but can be reduced in memory constrained environments. For cd-rom support in the storage
on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default
is 4096 bytes but can be reduced in memory constrained environments. For cd-rom support in the storage
class, this value cannot be less than 2048. */

#define UX_SLAVE_REQUEST_DATA_MAX_LENGTH (1024 * 2)

/* Defined, this enables processing of Get String Descriptor requests with zero Language ID.
/* Defined, this enables processing of Get String Descriptor requests with zero Language ID.
The first language ID in the language ID framwork will be used if the request has a zero
Language ID. */
/* #define UX_DEVICE_ENABLE_GET_STRING_WITH_ZERO_LANGUAGE_ID */
Expand All @@ -297,7 +297,7 @@

/* Define USBX Mass Storage Thread Stack Size. The default is to use UX_THREAD_STACK_SIZE. */

/* #define UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
/* #define UX_HOST_CLASS_STORAGE_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE
*/

/* Defined, this value represents the maximum number of Ed, regular TDs and Isochronous TDs. These values
Expand All @@ -313,13 +313,13 @@

#define UX_HOST_CLASS_HID_DECOMPRESSION_BUFFER 4096

/* Defined, this value represents the maximum number of HID usages for a HID device.
/* Defined, this value represents the maximum number of HID usages for a HID device.
Default is 2048 but for simple HID devices like keyboard and mouse it can be reduced a lot. */

#define UX_HOST_CLASS_HID_USAGES 2048


/* By default, each key in each HID report from the device is reported by ux_host_class_hid_keyboard_key_get
/* By default, each key in each HID report from the device is reported by ux_host_class_hid_keyboard_key_get
(a HID report from the device is received whenever there is a change in a key state i.e. when a key is pressed
or released. The report contains every key that is down). There are limitations to this method such as not being
able to determine when a key has been released.
Expand Down Expand Up @@ -352,13 +352,13 @@
/* #define UX_HOST_CLASS_HID_KEYBOARD_EVENTS_KEY_CHANGES_MODE_REPORT_MODIFIER_KEYS */


/* Defined, this value represents the maximum number of media for the host storage class.
/* Defined, this value represents the maximum number of media for the host storage class.
Default is 8 but for memory constrained resource systems this can ne reduced to 1. */

#define UX_HOST_CLASS_STORAGE_MAX_MEDIA 2

/* Defined, this value includes code to handle storage devices that use the CB
or CBI protocol (such as floppy disks). It is off by default because these
or CBI protocol (such as floppy disks). It is off by default because these
protocols are obsolete, being superseded by the Bulk Only Transport (BOT) protocol
which virtually all modern storage devices use.
*/
Expand Down Expand Up @@ -415,8 +415,8 @@

/* #define UX_DEVICE_CLASS_HID_EVENT_BUFFER_LENGTH 64 */

/* Defined, this value represents the the maximum number of HID events/reports
that can be queued at once.
/* Defined, this value represents the the maximum number of HID events/reports
that can be queued at once.
*/

/* #define UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE 8 */
Expand Down Expand Up @@ -485,7 +485,7 @@
/* #define UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT */

/* Defined, this macro disables interface alternate setting support.
Device stalls
Device stalls
*/
/* UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE */

Expand Down Expand Up @@ -563,13 +563,13 @@
/* Defined, this value will include the OTG polling thread. OTG can only be active if both host/device are present.
*/

#ifndef UX_HOST_SIDE_ONLY
#ifndef UX_DEVICE_SIDE_ONLY
#ifndef UX_HOST_SIDE_ONLY
#ifndef UX_DEVICE_SIDE_ONLY

/* #define UX_OTG_SUPPORT */

#endif
#endif
#endif
#endif

/* Defined, this macro will enable the standalone mode of usbx. */
/* #define UX_STANDALONE */
Expand All @@ -592,6 +592,10 @@

#define UX_HOST_CLASS_STORAGE_MAX_TRANSFER_SIZE (1024 * 1)

/* Defined, this option enables error log. */

/* #define UX_ENABLE_DEBUG_LOG */

/* Defined, this value represents the size of the log pool.
*/
#define UX_DEBUG_LOG_SIZE (1024 * 16)
Expand Down Expand Up @@ -641,7 +645,7 @@
#include "usbh_hcs.h"
#include "usbh_stdreq.h"
#include "usbh_core.h"
#endif
#endif

#endif
#endif

1 change: 1 addition & 0 deletions common/core/inc/ux_utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ VOID* _ux_utility_memory_allocate_add_safe(ULONG align,ULONG cache,UL
#define ux_utility_event_flags_set _ux_utility_event_flags_set
#define ux_utility_unicode_to_string _ux_utility_unicode_to_string
#define ux_utility_string_to_unicode _ux_utility_string_to_unicode
#define ux_utility_debug_callback_register _ux_utility_debug_callback_register
#define ux_utility_delay_ms _ux_utility_delay_ms
#define ux_utility_error_callback_register _ux_utility_error_callback_register
#define ux_system_error_handler _ux_system_error_handler
Expand Down
Loading