diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b34c7fd6..12d65f97 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ lib_xud Change Log ================== +2.0.2 +----- + + * ADDED: Legacy API wrapper functions/header files + 2.0.1 ----- diff --git a/examples/AN00124_CDC_VCOM_class/Makefile b/examples/AN00124_CDC_VCOM_class/Makefile index 42e269e1..51257fda 100644 --- a/examples/AN00124_CDC_VCOM_class/Makefile +++ b/examples/AN00124_CDC_VCOM_class/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_usb_cdc_demo BUILD_FLAGS = -O3 -g -report -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00125_mass_storage_class/Makefile b/examples/AN00125_mass_storage_class/Makefile index 35f5d7ef..d7ecdc4d 100644 --- a/examples/AN00125_mass_storage_class/Makefile +++ b/examples/AN00125_mass_storage_class/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_mass_storage_demo BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -lflash -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00126_printer_class/Makefile b/examples/AN00126_printer_class/Makefile index 271b2ad9..5bf8d26e 100644 --- a/examples/AN00126_printer_class/Makefile +++ b/examples/AN00126_printer_class/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_printer_demo BUILD_FLAGS = -O3 -report -DUSE_XSCOPE=1 -fxscope -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00127_video_class/Makefile b/examples/AN00127_video_class/Makefile index c5f24dc4..61762944 100644 --- a/examples/AN00127_video_class/Makefile +++ b/examples/AN00127_video_class/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_video_demo BUILD_FLAGS = -O3 -report -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00129_hid_class/Makefile b/examples/AN00129_hid_class/Makefile index a5c8c121..216c1563 100644 --- a/examples/AN00129_hid_class/Makefile +++ b/examples/AN00129_hid_class/Makefile @@ -16,8 +16,8 @@ APP_NAME = app_hid_mouse_demo # the xCORE.AI series. BUILD_FLAGS = -O3 -report -fxscope -XCC_FLAGS_200 = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=500 -XCC_FLAGS_AI = $(BUILD_FLAGS) -DXUD_CORE_CLOCK=600 +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) USED_MODULES = lib_xud diff --git a/examples/AN00131_CDC_EDC_class/Makefile b/examples/AN00131_CDC_EDC_class/Makefile index d7c0b808..130682be 100644 --- a/examples/AN00131_CDC_EDC_class/Makefile +++ b/examples/AN00131_CDC_EDC_class/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_cdc_edc_demo BUILD_FLAGS = -Wall -O3 -report -DUSE_XSCOPE=1 -fxscope -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00132_image_class/Makefile b/examples/AN00132_image_class/Makefile index dc2fd25a..256f3d54 100644 --- a/examples/AN00132_image_class/Makefile +++ b/examples/AN00132_image_class/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_usb_image_demo BUILD_FLAGS = -O3 -report -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00135_test_and_measurement_class/Makefile b/examples/AN00135_test_and_measurement_class/Makefile index 65052e14..c75a3a15 100644 --- a/examples/AN00135_test_and_measurement_class/Makefile +++ b/examples/AN00135_test_and_measurement_class/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_test_and_measurement BUILD_FLAGS = -O3 -report -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/examples/AN00136_vendor_specific/Makefile b/examples/AN00136_vendor_specific/Makefile index 896f389f..404f0a5e 100644 --- a/examples/AN00136_vendor_specific/Makefile +++ b/examples/AN00136_vendor_specific/Makefile @@ -14,14 +14,14 @@ APP_NAME = app_vendor_specific_demo BUILD_FLAGS = -O3 -report -XCC_FLAGS_xcore200 = $(BUILD_FLAGS) -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -XCC_FLAGS_xcoreai = $(BUILD_FLAGS) +XCC_FLAGS_200 = $(BUILD_FLAGS) +XCC_FLAGS_AI = $(BUILD_FLAGS) # The TARGET variable determines what target system the application is # compiled for. It either refers to an XN file in the source directories # or a valid argument for the --target option when compiling. -ifeq ($(CONFIG),xcoreai) +ifeq ($(CONFIG),AI) TARGET = XCORE-AI-EXPLORER else TARGET = XCORE-200-EXPLORER diff --git a/lib_xud/api/legacy/usb_defs.h b/lib_xud/api/legacy/usb_defs.h new file mode 100644 index 00000000..af9f8565 --- /dev/null +++ b/lib_xud/api/legacy/usb_defs.h @@ -0,0 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. +#include "XUD_USB_Defines.h" + diff --git a/lib_xud/api/legacy/usb_device.h b/lib_xud/api/legacy/usb_device.h new file mode 100644 index 00000000..b3aafdb0 --- /dev/null +++ b/lib_xud/api/legacy/usb_device.h @@ -0,0 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. +#include "xud_device.h" + diff --git a/lib_xud/api/legacy/usb_std_descriptors.h b/lib_xud/api/legacy/usb_std_descriptors.h new file mode 100644 index 00000000..a1ae7002 --- /dev/null +++ b/lib_xud/api/legacy/usb_std_descriptors.h @@ -0,0 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. +#include "xud_std_descriptors.h" + diff --git a/lib_xud/api/legacy/usb_std_requests.h b/lib_xud/api/legacy/usb_std_requests.h new file mode 100644 index 00000000..54dbae9e --- /dev/null +++ b/lib_xud/api/legacy/usb_std_requests.h @@ -0,0 +1,4 @@ +// Copyright 2021 XMOS LIMITED. +// This Software is subject to the terms of the XMOS Public Licence: Version 1. +#include "xud_std_requests.h" + diff --git a/lib_xud/api/xud.h b/lib_xud/api/xud.h index d5517d84..aac91c30 100644 --- a/lib_xud/api/xud.h +++ b/lib_xud/api/xud.h @@ -34,13 +34,19 @@ #define USB_TILE tile[0] #endif +// TODO use PLATFORM_REFERENCE_MHZ from platform.h #ifndef REF_CLK_FREQ #define REF_CLK_FREQ 100 #endif #ifndef XUD_CORE_CLOCK -#warning XUD_CORE_CLOCK not defined, using default (700MHz) -#define XUD_CORE_CLOCK (700) + #ifdef __XS2A__ + //#warning XUD_CORE_CLOCK not defined, using default (500MHz) + #define XUD_CORE_CLOCK (500) + #else + //#warning XUD_CORE_CLOCK not defined, using default (600MHz) + #define XUD_CORE_CLOCK (600) + #endif #endif #if !defined(PORT_USB_CLK) @@ -108,7 +114,6 @@ typedef enum XUD_Result XUD_RES_ERR = 2, } XUD_Result_t; -#if defined(__XC__) || defined(__DOXYGEN__) /** This performs the low-level USB I/O operations. Note that this * needs to run in a thread with at least 80 MIPS worst case execution * speed. @@ -154,7 +159,17 @@ int XUD_Main(/*tileref * unsafe usbtileXUD_res_t &xudres, */ XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], XUD_BusSpeed_t desiredSpeed, XUD_PwrConfig pwrConfig); -#endif + +/* Legacy API support */ +int XUD_Manager(chanend c_epOut[], int noEpOut, + chanend c_epIn[], int noEpIn, + NULLABLE_RESOURCE(chanend, c_sof), + XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], + NULLABLE_RESOURCE(port, p_usb_rst), + NULLABLE_RESOURCE(xcore_clock_t, clk), + unsigned rstMask, + XUD_BusSpeed_t desiredSpeed, + XUD_PwrConfig pwrConfig); /** * \brief This function must be called by a thread that deals with an OUT endpoint. diff --git a/lib_xud/module_build_info b/lib_xud/module_build_info index c84082d9..e1befd75 100644 --- a/lib_xud/module_build_info +++ b/lib_xud/module_build_info @@ -1,4 +1,4 @@ -VERSION = 2.0.1 +VERSION = 2.0.2 MODULE_XCC_FLAGS = $(XCC_FLAGS) \ -O3 \ @@ -29,7 +29,8 @@ OPTIONAL_HEADERS += xud_conf.h DEPENDENT_MODULES = EXPORT_INCLUDE_DIRS = api \ - src/user + src/user \ + api/legacy INCLUDE_DIRS = $(EXPORT_INCLUDE_DIRS) \ src/core \ diff --git a/lib_xud/src/core/XUD_Main.xc b/lib_xud/src/core/XUD_Main.xc index 95b0c0c3..00cfffb3 100755 --- a/lib_xud/src/core/XUD_Main.xc +++ b/lib_xud/src/core/XUD_Main.xc @@ -594,3 +594,18 @@ int XUD_Main(chanend c_ep_out[], int noEpOut, return 0; } +/* Legacy API support */ +int XUD_Manager(chanend c_epOut[], int noEpOut, + chanend c_epIn[], int noEpIn, + NULLABLE_RESOURCE(chanend, c_sof), + XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[], + NULLABLE_RESOURCE(port, p_usb_rst), + NULLABLE_RESOURCE(clock, clk), + unsigned rstMask, + XUD_BusSpeed_t desiredSpeed, + XUD_PwrConfig pwrConfig) +{ + return XUD_Main(c_epOut, noEpOut, c_epIn, noEpIn, c_sof, epTypeTableOut, epTypeTableIn, desiredSpeed, pwrConfig); +} + +