Skip to content

Commit

Permalink
Release 6.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxin-azrtos committed Apr 3, 2021
1 parent f6be93a commit dfb4460
Show file tree
Hide file tree
Showing 42 changed files with 1,229 additions and 419 deletions.
16 changes: 14 additions & 2 deletions common/core/inc/ux_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* APPLICATION INTERFACE DEFINITION RELEASE */
/* */
/* ux_api.h PORTABLE C */
/* 6.1.5 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
Expand Down Expand Up @@ -83,6 +83,10 @@
/* resulting in version 6.1.4 */
/* 03-02-2021 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1.5 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* added macros for Word/DWord */
/* to bytes extraction, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/

Expand Down Expand Up @@ -217,7 +221,7 @@ typedef signed char SCHAR;
#define AZURE_RTOS_USBX
#define USBX_MAJOR_VERSION 6
#define USBX_MINOR_VERSION 1
#define USBX_PATCH_VERSION 5
#define USBX_PATCH_VERSION 6

/* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */

Expand All @@ -233,6 +237,14 @@ typedef signed char SCHAR;
#define UX_MIN(a, b) ((a) < (b) ? (a) : (b))
#define UX_MAX(a, b) ((a) > (b) ? (a) : (b))

#define UX_W0(word) ( (word) & 0xFF)
#define UX_W1(word) (((word) >> 8) & 0xFF)

#define UX_DW0(dword) ( (dword) & 0xFF)
#define UX_DW1(dword) (((dword) >> 8) & 0xFF)
#define UX_DW2(dword) (((dword) >> 16) & 0xFF)
#define UX_DW3(dword) (((dword) >> 24) & 0xFF)

/* Safe arithmetic check macros. */

#ifndef UX_DISABLE_ARITHMETIC_CHECK
Expand Down
11 changes: 10 additions & 1 deletion common/core/inc/ux_dcd_sim_slave.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* COMPONENT DEFINITION RELEASE */
/* */
/* ux_dcd_sim_slave.h PORTABLE C */
/* 6.1 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
Expand All @@ -44,6 +44,10 @@
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* added HCD connected to, */
/* supported bi-dir-endpoints, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/

Expand Down Expand Up @@ -112,7 +116,12 @@ typedef struct UX_DCD_SIM_SLAVE_STRUCT
*ux_dcd_sim_slave_dcd_owner;
struct UX_DCD_SIM_SLAVE_ED_STRUCT
ux_dcd_sim_slave_ed[UX_DCD_SIM_SLAVE_MAX_ED];
#ifdef UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT
struct UX_DCD_SIM_SLAVE_ED_STRUCT
ux_dcd_sim_slave_ed_in[UX_DCD_SIM_SLAVE_MAX_ED];
#endif
UINT (*ux_dcd_sim_slave_dcd_control_request_process_hub)(UX_SLAVE_TRANSFER *transfer_request);
VOID *ux_dcd_sim_slave_hcd;
} UX_DCD_SIM_SLAVE;


Expand Down
6 changes: 5 additions & 1 deletion common/core/inc/ux_hcd_sim_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* COMPONENT DEFINITION RELEASE */
/* */
/* ux_hcd_sim_host.h PORTABLE C */
/* 6.1.2 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
Expand All @@ -51,6 +51,9 @@
/* 11-09-2020 Chaoqiong Xiao Modified comment(s), */
/* added HCD uninitialize, */
/* resulting in version 6.1.2 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* added port status variable, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/

Expand Down Expand Up @@ -96,6 +99,7 @@ typedef struct UX_HCD_SIM_HOST_STRUCT
*ux_hcd_sim_host_hcd_owner;
ULONG ux_hcd_sim_host_hcor;
UINT ux_hcd_sim_host_nb_root_hubs;
ULONG ux_hcd_sim_host_port_status[1];
struct UX_HCD_SIM_HOST_ED_STRUCT
*ux_hcd_sim_host_ed_list;
struct UX_HCD_SIM_HOST_TD_STRUCT
Expand Down
50 changes: 49 additions & 1 deletion common/core/inc/ux_user_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/* PORT SPECIFIC C INFORMATION RELEASE */
/* */
/* ux_user.h PORTABLE C */
/* 6.1.4 */
/* 6.1.6 */
/* */
/* AUTHOR */
/* */
Expand All @@ -51,6 +51,13 @@
/* compile option for using */
/* packet pool from NetX, */
/* resulting in version 6.1.4 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* added DFU_UPLOAD option, */
/* added macro to enable */
/* device bi-dir-endpoints, */
/* added macro to disable CDC- */
/* ACM transmission support, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/

Expand Down Expand Up @@ -292,6 +299,47 @@

/* #define UX_DEVICE_CLASS_HID_MAX_EVENTS_QUEUE 8 */


/* Defined, this macro will disable DFU_UPLOAD support. */

/* #define UX_DEVICE_CLASS_DFU_UPLOAD_DISABLE */

/* Defined, this macro will enable DFU_GETSTATUS and DFU_GETSTATE in dfuERROR. */

/* #define UX_DEVICE_CLASS_DFU_ERROR_GET_ENABLE */

/* Defined, this macro will change status mode.
0 - simple mode,
status is queried from application in dfuDNLOAD-SYNC and dfuMANIFEST-SYNC state,
no bwPollTimeout.
1 - status is queried from application once requested,
b0-3 : media status
b4-7 : bStatus
b8-31: bwPollTimeout
bwPollTimeout supported.
*/

/* #define UX_DEVICE_CLASS_DFU_STATUS_MODE (1) */

/* Defined, this value represents the default DFU status bwPollTimeout.
The value is 3 bytes long (max 0xFFFFFFu).
By default the bwPollTimeout is 1 (means 1ms).
*/

/* #define UX_DEVICE_CLASS_DFU_STATUS_POLLTIMEOUT (1) */

/* Defined, this macro will enable custom request process callback. */

/* #define UX_DEVICE_CLASS_DFU_CUSTOM_REQUEST_ENABLE */

/* Defined, this macro disables CDC ACM non-blocking transmission support. */

/* #define UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE */

/* Defined, this macro enables device bi-directional-endpoint support. */

/* #define UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT */

/* Defined, this value will only enable the host side of usbx. */
/* #define UX_HOST_SIDE_ONLY */

Expand Down
15 changes: 13 additions & 2 deletions common/core/src/ux_dcd_sim_slave_endpoint_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_dcd_sim_slave_endpoint_create PORTABLE C */
/* 6.1 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
Expand Down Expand Up @@ -67,6 +67,9 @@
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* supported bi-dir-endpoints, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_create(UX_DCD_SIM_SLAVE *dcd_sim_slave, UX_SLAVE_ENDPOINT *endpoint)
Expand All @@ -79,9 +82,17 @@ ULONG sim_slave_endpoint_index;
/* The simulator slave controller has 16 endpoints maximum. Endpoint 0 is always control.
The other endpoints are generic. We can use the endpoint number as an index. */
sim_slave_endpoint_index = endpoint ->ux_slave_endpoint_descriptor.bEndpointAddress & ~(ULONG)UX_ENDPOINT_DIRECTION;

/* Fetch the address of the physical endpoint. */
#ifdef UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT
ed = ((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress == 0) ?
&dcd_sim_slave -> ux_dcd_sim_slave_ed[0] :
((endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) ?
&dcd_sim_slave -> ux_dcd_sim_slave_ed_in[sim_slave_endpoint_index] :
&dcd_sim_slave -> ux_dcd_sim_slave_ed[sim_slave_endpoint_index]));
#else
ed = &dcd_sim_slave -> ux_dcd_sim_slave_ed[sim_slave_endpoint_index];
#endif

/* Check the endpoint status, if it is free, reserve it. If not reject this endpoint. */
if ((ed -> ux_sim_slave_ed_status & UX_DCD_SIM_SLAVE_ED_STATUS_USED) == 0)
Expand Down
17 changes: 16 additions & 1 deletion common/core/src/ux_dcd_sim_slave_endpoint_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_dcd_sim_slave_endpoint_status PORTABLE C */
/* 6.1 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
Expand Down Expand Up @@ -67,6 +67,9 @@
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* supported bi-dir-endpoints, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_endpoint_status(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG endpoint_index)
Expand All @@ -75,8 +78,20 @@ UINT _ux_dcd_sim_slave_endpoint_status(UX_DCD_SIM_SLAVE *dcd_sim_slave, ULONG e
UX_DCD_SIM_SLAVE_ED *ed;


#ifdef UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT
ULONG ed_addr = endpoint_index; /* Passed value as endpoint address. */
ULONG ed_dir = ed_addr & UX_ENDPOINT_DIRECTION;
ULONG ed_index = ed_addr & ~UX_ENDPOINT_DIRECTION;

/* Fetch the address of the physical endpoint. */
ed = ((ed_addr == 0) ? &dcd_sim_slave -> ux_dcd_sim_slave_ed[0] :
((ed_dir) ? &dcd_sim_slave -> ux_dcd_sim_slave_ed_in[ed_index] :
&dcd_sim_slave -> ux_dcd_sim_slave_ed[ed_index]));
#else

/* Fetch the address of the physical endpoint. */
ed = &dcd_sim_slave -> ux_dcd_sim_slave_ed[endpoint_index];
#endif

/* Check the endpoint status, if it is free, we have a illegal endpoint. */
if ((ed -> ux_sim_slave_ed_status & UX_DCD_SIM_SLAVE_ED_STATUS_USED) == 0)
Expand Down
21 changes: 20 additions & 1 deletion common/core/src/ux_dcd_sim_slave_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@

#include "ux_api.h"
#include "ux_dcd_sim_slave.h"
#include "ux_hcd_sim_host.h"


/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
/* _ux_dcd_sim_slave_initialize PORTABLE C */
/* 6.1 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
Expand Down Expand Up @@ -66,13 +67,18 @@
/* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* resulting in version 6.1 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* added link with HCD, */
/* set device to full speed, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_initialize(VOID)
{

UX_SLAVE_DCD *dcd;
UX_DCD_SIM_SLAVE *dcd_sim_slave;
UX_HCD *hcd;


/* Get the pointer to the DCD. */
Expand All @@ -97,6 +103,19 @@ UX_DCD_SIM_SLAVE *dcd_sim_slave;
/* Initialize the function collector for this DCD. */
dcd -> ux_slave_dcd_function = _ux_dcd_sim_slave_function;

/* Link the HCD (always first registered one) to DCD driver. */
if (_ux_system_host)
{
hcd = _ux_system_host -> ux_system_host_hcd_array;
if (hcd)
{
dcd_sim_slave -> ux_dcd_sim_slave_hcd = (VOID *)hcd;
}
}

/* Set system to full speed by default. */
_ux_system_slave -> ux_system_slave_speed = UX_FULL_SPEED_DEVICE;

/* Set the state of the controller to OPERATIONAL now. */
dcd -> ux_slave_dcd_status = UX_DCD_STATUS_OPERATIONAL;

Expand Down
24 changes: 20 additions & 4 deletions common/core/src/ux_dcd_sim_slave_initialize_complete.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/* FUNCTION RELEASE */
/* */
/* _ux_dcd_sim_slave_initialize_complete PORTABLE C */
/* 6.1 */
/* 6.1.6 */
/* AUTHOR */
/* */
/* Chaoqiong Xiao, Microsoft Corporation */
Expand Down Expand Up @@ -69,6 +69,9 @@
/* 09-30-2020 Chaoqiong Xiao Modified comment(s), */
/* prefixed UX to MS_TO_TICK, */
/* resulting in version 6.1 */
/* 04-02-2021 Chaoqiong Xiao Modified comment(s), */
/* added framework init cases, */
/* resulting in version 6.1.6 */
/* */
/**************************************************************************/
UINT _ux_dcd_sim_slave_initialize_complete(VOID)
Expand All @@ -86,9 +89,22 @@ UX_SLAVE_TRANSFER *transfer_request;
/* Get the pointer to the device. */
device = &_ux_system_slave -> ux_system_slave_device;

/* Slave simulator is a Full speed controller. */
_ux_system_slave -> ux_system_slave_device_framework = _ux_system_slave -> ux_system_slave_device_framework_full_speed;
_ux_system_slave -> ux_system_slave_device_framework_length = _ux_system_slave -> ux_system_slave_device_framework_length_full_speed;
/* Prepare according to speed. */
if (_ux_system_slave -> ux_system_slave_speed == UX_HIGH_SPEED_DEVICE)
{
_ux_system_slave -> ux_system_slave_device_framework =
_ux_system_slave -> ux_system_slave_device_framework_high_speed;
_ux_system_slave -> ux_system_slave_device_framework_length =
_ux_system_slave -> ux_system_slave_device_framework_length_high_speed;
}
else
{
_ux_system_slave -> ux_system_slave_device_framework =
_ux_system_slave -> ux_system_slave_device_framework_full_speed;
_ux_system_slave -> ux_system_slave_device_framework_length =
_ux_system_slave -> ux_system_slave_device_framework_length_full_speed;

}

/* Get the device framework pointer. */
device_framework = _ux_system_slave -> ux_system_slave_device_framework;
Expand Down
Loading

0 comments on commit dfb4460

Please sign in to comment.