Skip to content

Commit

Permalink
Merge pull request #280 from xross/release/v2.0.2
Browse files Browse the repository at this point in the history
Release/v2.0.2
  • Loading branch information
xross authored Sep 16, 2021
2 parents d904d39 + 934e4c8 commit f8592f2
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 32 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
lib_xud Change Log
==================

2.0.2
-----

* ADDED: Legacy API wrapper functions/header files

2.0.1
-----

Expand Down
6 changes: 3 additions & 3 deletions examples/AN00124_CDC_VCOM_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/AN00125_mass_storage_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/AN00126_printer_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/AN00127_video_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/AN00129_hid_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions examples/AN00131_CDC_EDC_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/AN00132_image_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/AN00135_test_and_measurement_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/AN00136_vendor_specific/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib_xud/api/legacy/usb_defs.h
Original file line number Diff line number Diff line change
@@ -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"

4 changes: 4 additions & 0 deletions lib_xud/api/legacy/usb_device.h
Original file line number Diff line number Diff line change
@@ -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"

4 changes: 4 additions & 0 deletions lib_xud/api/legacy/usb_std_descriptors.h
Original file line number Diff line number Diff line change
@@ -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"

4 changes: 4 additions & 0 deletions lib_xud/api/legacy/usb_std_requests.h
Original file line number Diff line number Diff line change
@@ -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"

23 changes: 19 additions & 4 deletions lib_xud/api/xud.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions lib_xud/module_build_info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 2.0.1
VERSION = 2.0.2

MODULE_XCC_FLAGS = $(XCC_FLAGS) \
-O3 \
Expand Down Expand Up @@ -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 \
Expand Down
15 changes: 15 additions & 0 deletions lib_xud/src/core/XUD_Main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


0 comments on commit f8592f2

Please sign in to comment.