Remove xua_ep0_wrapper.h and xua_ep0_wrapper.xc.

Requested by Oscar Bailey as part of github.com/xmos/lib_xua Pull Request #103.
This commit is contained in:
Michael Banther
2019-11-06 15:12:21 +00:00
parent 92019d851a
commit 28cce8b51c
2 changed files with 0 additions and 78 deletions

View File

@@ -1,27 +0,0 @@
#ifndef _EP0_WRAPPER_
#define _EP0_WRAPPER_
#include <xs1.h>
#include <safestring.h>
#include <stddef.h>
#include "xua.h"
typedef interface ep0_control_if{
void set_output_interface(unsigned num);
void set_input_interface(unsigned num);
void set_host_active(unsigned num);
}ep0_control_if;
extern "C"{
void XUA_Endpoint0_lite_init(chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
chanend ?c_mix_ctl, chanend ?c_clk_ctl, chanend ?c_EANativeTransport_ctrl, CLIENT_INTERFACE(i_dfu, ?dfuInterface) VENDOR_REQUESTS_PARAMS_DEC_);
void XUA_Endpoint0_lite_loop(XUD_Result_t result, USB_SetupPacket_t sp, chanend c_ep0_out, chanend c_ep0_in, chanend c_audioControl,
chanend ?c_mix_ctl, chanend ?c_clk_ctl, chanend ?c_EANativeTransport_ctrl, CLIENT_INTERFACE(i_dfu, ?dfuInterface) VENDOR_REQUESTS_PARAMS_DEC_, unsigned *input_interface_num, unsigned *output_interface_num);
}
#pragma select handler
void XUD_GetSetupData_Select(chanend c, XUD_ep e_out, unsigned &length, XUD_Result_t &result);
[[combinable]]
void XUA_Endpoint0_select(chanend c_ep0_out, chanend c_ep0_in, client ep0_control_if i_ep0_ctl, CLIENT_INTERFACE(i_dfu, ?dfuInterface) VENDOR_REQUESTS_PARAMS_DEC_);
#endif

View File

@@ -1,51 +0,0 @@
#include <xs1.h>
#include <safestring.h>
#include <stddef.h>
#include "xua.h"
#if XUA_USB_EN
#include "xua_ep0_wrapper.h"
#define DEBUG_UNIT EP0_WRAPPER
#define DEBUG_PRINT_ENABLE_EP0_WRAPPER 0
#include "debug_print.h"
extern XUD_ep ep0_out;
extern XUD_ep ep0_in;
[[combinable]]
void XUA_Endpoint0_select(chanend c_ep0_out, chanend c_ep0_in, client ep0_control_if i_ep0_ctl, CLIENT_INTERFACE(i_dfu, ?dfuInterface) VENDOR_REQUESTS_PARAMS_DEC_)
{
USB_SetupPacket_t sp;
XUA_Endpoint0_lite_init(c_ep0_out, c_ep0_in, null, null, null, null, dfuInterface VENDOR_REQUESTS_PARAMS_);
unsigned char sbuffer[120];
XUD_SetReady_Out(ep0_out, sbuffer);
unsigned input_interface_num = 0;
unsigned output_interface_num = 0;
XUD_Result_t result = XUD_RES_ERR;
unsigned length = 0;
while(1){
select{
case XUD_GetSetupData_Select(c_ep0_out, ep0_out, length, result):
if (result == XUD_RES_OKAY)
{
/* Parse data buffer end populate SetupPacket struct */
USB_ParseSetupPacket(sbuffer, sp);
}
debug_printf("ep0, result: %d, length: %d\n", result, length); //-1 reset, 0 ok, 1 error
XUA_Endpoint0_lite_loop(result, sp, c_ep0_out, c_ep0_in, null, null, null, null, dfuInterface
VENDOR_REQUESTS_PARAMS_, &input_interface_num, &output_interface_num);
i_ep0_ctl.set_output_interface(output_interface_num);
i_ep0_ctl.set_input_interface(input_interface_num);
XUD_SetReady_Out(ep0_out, sbuffer);
break;
}
}
}
#endif