Skip to content
Closed
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
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
lib_xud Change Log
==================

0.2.0
-----

* CHANGE: Pass channel end for hardware peripheral messages rather than
allocating one with each message

0.1.1
-----

Expand All @@ -9,6 +15,7 @@ lib_xud Change Log
* RESOLVED: Continuous suspend/resume notifications when host disconnected
(introduced earlier as part of #11813)


0.1.0
-----

Expand Down
3 changes: 2 additions & 1 deletion examples/AN00124_CDC_VCOM_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void app_virtual_com(client interface usb_cdc_interface cdc) {
int main() {
/* Channels to communicate with USB endpoints */
chan c_ep_out[XUD_EP_COUNT_OUT], c_ep_in[XUD_EP_COUNT_IN];
chan c_set_addr;
/* Interface to communicate with USB CDC (Virtual Serial) */
interface usb_cdc_interface cdc_data;

Expand All @@ -37,7 +38,7 @@ int main() {
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on USB_TILE: CdcEndpointsHandler(c_ep_in[1], c_ep_out[1], c_ep_in[2], cdc_data);

Expand Down
2 changes: 1 addition & 1 deletion examples/AN00124_CDC_VCOM_class/src/xud_cdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface usb_cdc_interface {
};

/* Endpoint 0 handling both std USB requests and CDC class specific requests */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in);
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr);

/* Function to handle all endpoints of the CDC class excluding control endpoint0 */
void CdcEndpointsHandler(chanend c_epint_in, chanend c_epbulk_out, chanend c_epbulk_in,
Expand Down
4 changes: 2 additions & 2 deletions examples/AN00124_CDC_VCOM_class/src/xud_cdc.xc
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ XUD_Result_t ControlInterfaceClassRequests(XUD_ep ep_out, XUD_ep ep_in, USB_Setu
}

/* Endpoint 0 handling both std USB requests and CDC class specific requests */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;

Expand Down Expand Up @@ -312,7 +312,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
result = USB_StandardRequests(ep0_out, ep0_in, devDesc,
sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0, stringDescriptors, sizeof(stringDescriptors)/sizeof(stringDescriptors[0]),
sp, usbBusSpeed);
sp, usbBusSpeed, c_set_addr);
}
}

Expand Down
5 changes: 5 additions & 0 deletions examples/AN00125_mass_storage_class/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
# or a valid argument for the --target option when compiling.

# In this case, the target depends on the build configuration.
ifeq ($(CONFIG),X200)
TARGET = XCORE-200-EXPLORER
else
TARGET = SLICEKIT-U16
endif

# The APP_NAME variable determines the name of the final .xe file. It should
# not include the .xe postfix. If left blank the name will default to
Expand All @@ -21,6 +25,7 @@ APP_NAME = app_mass_storage_demo
# These flags define two build configurations - one for U-series

XCC_FLAGS_U = -O3 -report -DXUD_SERIES_SUPPORT=XUD_U_SERIES -DUSE_XSCOPE=1 -fxscope -lflash
XCC_FLAGS_X200 = -O3 -report -DXUD_SERIES_SUPPORT=XUD_X200_SERIES -DUSE_XSCOPE=1 -fxscope -lflash

# The USED_MODULES variable lists other module used by the application.
USED_MODULES = lib_xud lib_logging(>=2.0.0) lib_xassert(>=3.0.0)
Expand Down
4 changes: 2 additions & 2 deletions examples/AN00125_mass_storage_class/src/endpoint0.xc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int MassStorageEndpoint0Requests(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_
}

/* Endpoint 0 Task */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;
unsigned bmRequestType;
Expand Down Expand Up @@ -183,7 +183,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0,
stringDescriptors, sizeof(stringDescriptors)/sizeof(stringDescriptors[0]),
sp, usbBusSpeed);
sp, usbBusSpeed, c_set_addr);
}

/* USB bus reset detected, reset EP and get new bus speed */
Expand Down
5 changes: 3 additions & 2 deletions examples/AN00125_mass_storage_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ void xscope_user_init(void) {
#endif

/* Prototype for Endpoint0 function in endpoint0.xc */
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in);
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_set_addr);

/* The main function runs three cores: the XUD manager, Endpoint 0, and a mass storage endpoint. An array of
channels is used for both IN and OUT endpoints */
int main()
{
chan c_ep_out[XUD_EP_COUNT_OUT], c_ep_in[XUD_EP_COUNT_IN];
chan c_set_addr;

par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on USB_TILE: massStorageClass(c_ep_out[1],c_ep_in[1],0);

Expand Down
4 changes: 2 additions & 2 deletions examples/AN00126_printer_class/src/endpoint0.xc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ XUD_Result_t PrinterInterfaceClassRequests(XUD_ep c_ep0_out, XUD_ep c_ep0_in, US
}

/* Endpoint 0 Task */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;

Expand Down Expand Up @@ -204,7 +204,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
result = USB_StandardRequests(ep0_out, ep0_in, devDesc,
sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0, stringDescriptors, sizeof(stringDescriptors)/sizeof(stringDescriptors[0]),
sp, usbBusSpeed);
sp, usbBusSpeed, c_set_addr);
}
}

Expand Down
5 changes: 3 additions & 2 deletions examples/AN00126_printer_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void xscope_user_init(void) {
#endif

/* Prototype for Endpoint0 function in endpoint0.xc */
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in);
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_set_addr);

/* Global report buffer, global since used by Endpoint0 core */
unsigned char g_reportBuffer[] = {0, 0, 0, 0};
Expand Down Expand Up @@ -78,14 +78,15 @@ void printer_main(chanend c_ep_prt_out)
int main()
{
chan c_ep_out[XUD_EP_COUNT_OUT], c_ep_in[XUD_EP_COUNT_IN];
chan c_set_addr;

par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on USB_TILE: printer_main(c_ep_out[1]);

Expand Down
3 changes: 2 additions & 1 deletion examples/AN00127_video_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ XUD_EpType epTypeTableIn[EP_COUNT_IN] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, X
int main() {

chan c_ep_out[EP_COUNT_OUT], c_ep_in[EP_COUNT_IN];
chan c_set_addr;

/* 'Par' statement to run the following tasks in parallel */
par
Expand All @@ -38,7 +39,7 @@ int main() {
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on USB_TILE: VideoEndpointsHandler(c_ep_in[1], c_ep_in[2]);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/AN00127_video_class/src/usb_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
void VideoEndpointsHandler(chanend c_epint_in, chanend c_episo_in);

/* Endpoint 0 handles both std USB requests and Video class-specific requests */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in);
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr);

#endif /* USB_VIDEO_H_ */
4 changes: 2 additions & 2 deletions examples/AN00127_video_class/src/usb_video.xc
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ unsafe{
}

/* Endpoint 0 handles both std USB requests and Video class-specific requests */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;

Expand Down Expand Up @@ -270,7 +270,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
result = USB_StandardRequests(ep0_out, ep0_in, devDesc,
sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0, stringDescriptors, sizeof(stringDescriptors)/sizeof(stringDescriptors[0]),
sp, usbBusSpeed);
sp, usbBusSpeed, c_set_addr);
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/AN00129_hid_class/src/endpoint0.xc
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ XUD_Result_t HidInterfaceClassRequests(XUD_ep c_ep0_out, XUD_ep c_ep0_in, USB_Se
}

/* Endpoint 0 Task */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;

Expand Down Expand Up @@ -315,7 +315,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
result = USB_StandardRequests(ep0_out, ep0_in, devDesc,
sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0, stringDescriptors, sizeof(stringDescriptors)/sizeof(stringDescriptors[0]),
sp, usbBusSpeed);
sp, usbBusSpeed, c_set_addr);
}
}

Expand Down
13 changes: 7 additions & 6 deletions examples/AN00129_hid_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ XUD_EpType epTypeTableOut[EP_COUNT_OUT] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE};
XUD_EpType epTypeTableIn[EP_COUNT_IN] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_BUL};

/* Prototype for Endpoint0 function in endpoint0.xc */
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in);
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_set_addr);

/* Global report buffer, global since used by Endpoint0 core */
unsigned char g_reportBuffer[4] = {0, 0, 0, 0};
Expand Down Expand Up @@ -84,16 +84,17 @@ void hid_mouse(chanend chan_ep_hid)
int main()
{
chan c_ep_out[EP_COUNT_OUT], c_ep_in[EP_COUNT_IN];
chan c_set_addr;

par
{
on tile[0]: XUD_Main(c_ep_out, EP_COUNT_OUT, c_ep_in, EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);
on USB_TILE: XUD_Main(c_ep_out, EP_COUNT_OUT, c_ep_in, EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on tile[0]: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on tile[0]: hid_mouse(c_ep_in[1]);
on USB_TILE: hid_mouse(c_ep_in[1]);

}

Expand Down
3 changes: 2 additions & 1 deletion examples/AN00131_CDC_EDC_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ XUD_EpType epTypeTableIn[XUD_EP_COUNT_IN] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABL
int main() {

chan c_ep_out[XUD_EP_COUNT_OUT], c_ep_in[XUD_EP_COUNT_IN];
chan c_set_addr;
interface usb_cdc_ecm_if cdc_ecm;

/* 'Par' statement to run the following tasks in parallel */
Expand All @@ -36,7 +37,7 @@ int main() {
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on USB_TILE: CdcEcmEndpointsHandler(c_ep_in[1], c_ep_out[1], c_ep_in[2], cdc_ecm);

Expand Down
2 changes: 1 addition & 1 deletion examples/AN00131_CDC_EDC_class/src/xud_ecm.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void CdcEcmEndpointsHandler(chanend c_epint_in, chanend c_epbulk_out, chanend c_
SERVER_INTERFACE(usb_cdc_ecm_if, cdc_ecm));

/* Endpoint 0 handles both std USB requests and CDC class specific requests */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in);
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr);


#endif /* __XUD_ECM_H__ */
4 changes: 2 additions & 2 deletions examples/AN00131_CDC_EDC_class/src/xud_ecm.xc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ XUD_Result_t ControlInterfaceClassRequests(XUD_ep ep_out, XUD_ep ep_in, USB_Setu
}

/* Endpoint 0 handling both std USB requests and CDC class specific requests */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;

Expand Down Expand Up @@ -303,7 +303,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
result = USB_StandardRequests(ep0_out, ep0_in, devDesc,
sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0, stringDescriptors, sizeof(stringDescriptors)/sizeof(stringDescriptors[0]),
sp, usbBusSpeed);
sp, usbBusSpeed, c_set_addr);
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/AN00132_image_class/src/endpoint0.xc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ XUD_Result_t StillImageClassRequests(XUD_ep c_ep0_out, XUD_ep c_ep0_in, USB_Setu


/* Endpoint 0 Task */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;
unsigned bmRequestType;
Expand Down Expand Up @@ -204,7 +204,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
* XUD_RES_ERR if request was not handled (i.e. STALLed) */
result = USB_StandardRequests(ep0_out, ep0_in, devDesc, sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0, stringDescriptors,
sizeof(stringDescriptors)/sizeof(stringDescriptors[0]), sp, usbBusSpeed);
sizeof(stringDescriptors)/sizeof(stringDescriptors[0]), sp, usbBusSpeed, c_set_addr);

/* USB bus reset detected, reset EP and get new bus speed */
if(result == XUD_RES_RST)
Expand Down
5 changes: 3 additions & 2 deletions examples/AN00132_image_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum {
#define IMG_WIDTH 250

/* Prototype for Endpoint0 function in endpoint0.xc */
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in);
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_set_addr);


/*
Expand Down Expand Up @@ -160,14 +160,15 @@ void bulk_endpoint(chanend chan_ep_from_host, chanend chan_ep_to_host)
int main()
{
chan c_ep_out[XUD_EP_COUNT_OUT], c_ep_in[XUD_EP_COUNT_IN];
chan c_set_addr;

par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on USB_TILE: bulk_endpoint(c_ep_out[1], c_ep_in[1]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ XUD_Result_t ControlEndpointClassRequests(XUD_ep ep_out, XUD_ep ep_in, USB_Setup
}

/* Endpoint 0 Task */
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in, chanend c_set_addr)
{
USB_SetupPacket_t sp;
XUD_BusSpeed_t usbBusSpeed;
Expand Down Expand Up @@ -299,7 +299,7 @@ void Endpoint0(chanend chan_ep0_out, chanend chan_ep0_in)
sizeof(devDesc), cfgDesc, sizeof(cfgDesc),
null, 0, null, 0,
stringDescriptors, sizeof(stringDescriptors)/sizeof(stringDescriptors[0]),
sp, usbBusSpeed);
sp, usbBusSpeed, c_set_addr);
}

/* USB bus reset detected, reset EP and get new bus speed */
Expand Down
5 changes: 3 additions & 2 deletions examples/AN00135_test_and_measurement_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ XUD_EpType epTypeTableIn[XUD_EP_COUNT_IN] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABL


/* Prototype for Endpoint0 function in endpoint0.xc */
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in);
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in, chanend c_set_addr);
void usbtmc_bulk_endpoints(chanend c_ep_out,chanend c_ep_in);

/* Global report buffer, global since used by Endpoint0 core */
Expand All @@ -22,14 +22,15 @@ unsigned char g_reportBuffer[] = {0, 0, 0, 0};
int main()
{
chan c_ep_out[XUD_EP_COUNT_OUT], c_ep_in[XUD_EP_COUNT_IN];
chan c_set_addr;

par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, null, -1 , XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0], c_set_addr);

on USB_TILE: usbtmc_bulk_endpoints(c_ep_out[1],c_ep_in[1]);

Expand Down
Loading