xmos-ai-tools 1.3.2.dev180__py3-none-macosx_10_15_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. xmos_ai_tools/__init__.py +7 -0
  2. xmos_ai_tools/io_server/__init__.py +151 -0
  3. xmos_ai_tools/runtime/__init__.py +0 -0
  4. xmos_ai_tools/runtime/buildfiles/aitoolslib.cmake +13 -0
  5. xmos_ai_tools/runtime/buildfiles/aitoolslib.make +8 -0
  6. xmos_ai_tools/runtime/include/flash_server.h +73 -0
  7. xmos_ai_tools/runtime/include/flatbuffers/allocator.h +68 -0
  8. xmos_ai_tools/runtime/include/flatbuffers/array.h +243 -0
  9. xmos_ai_tools/runtime/include/flatbuffers/base.h +474 -0
  10. xmos_ai_tools/runtime/include/flatbuffers/bfbs_generator.h +43 -0
  11. xmos_ai_tools/runtime/include/flatbuffers/buffer.h +142 -0
  12. xmos_ai_tools/runtime/include/flatbuffers/buffer_ref.h +53 -0
  13. xmos_ai_tools/runtime/include/flatbuffers/code_generators.h +235 -0
  14. xmos_ai_tools/runtime/include/flatbuffers/default_allocator.h +64 -0
  15. xmos_ai_tools/runtime/include/flatbuffers/detached_buffer.h +114 -0
  16. xmos_ai_tools/runtime/include/flatbuffers/flatbuffer_builder.h +1197 -0
  17. xmos_ai_tools/runtime/include/flatbuffers/flatbuffers.h +270 -0
  18. xmos_ai_tools/runtime/include/flatbuffers/flatc.h +111 -0
  19. xmos_ai_tools/runtime/include/flatbuffers/flexbuffers.h +1897 -0
  20. xmos_ai_tools/runtime/include/flatbuffers/grpc.h +300 -0
  21. xmos_ai_tools/runtime/include/flatbuffers/hash.h +127 -0
  22. xmos_ai_tools/runtime/include/flatbuffers/idl.h +1232 -0
  23. xmos_ai_tools/runtime/include/flatbuffers/minireflect.h +419 -0
  24. xmos_ai_tools/runtime/include/flatbuffers/pch/flatc_pch.h +39 -0
  25. xmos_ai_tools/runtime/include/flatbuffers/pch/pch.h +38 -0
  26. xmos_ai_tools/runtime/include/flatbuffers/reflection.h +502 -0
  27. xmos_ai_tools/runtime/include/flatbuffers/reflection_generated.h +1449 -0
  28. xmos_ai_tools/runtime/include/flatbuffers/registry.h +128 -0
  29. xmos_ai_tools/runtime/include/flatbuffers/stl_emulation.h +509 -0
  30. xmos_ai_tools/runtime/include/flatbuffers/string.h +64 -0
  31. xmos_ai_tools/runtime/include/flatbuffers/struct.h +53 -0
  32. xmos_ai_tools/runtime/include/flatbuffers/table.h +168 -0
  33. xmos_ai_tools/runtime/include/flatbuffers/util.h +690 -0
  34. xmos_ai_tools/runtime/include/flatbuffers/vector.h +370 -0
  35. xmos_ai_tools/runtime/include/flatbuffers/vector_downward.h +271 -0
  36. xmos_ai_tools/runtime/include/flatbuffers/verifier.h +283 -0
  37. xmos_ai_tools/runtime/include/ioserver.h +44 -0
  38. xmos_ai_tools/runtime/include/lib_nn/api/TransposeConv.h +24 -0
  39. xmos_ai_tools/runtime/include/lib_nn/api/add_int16.h +27 -0
  40. xmos_ai_tools/runtime/include/lib_nn/api/add_int16_transform.h +42 -0
  41. xmos_ai_tools/runtime/include/lib_nn/api/dequantize_int16.h +22 -0
  42. xmos_ai_tools/runtime/include/lib_nn/api/dequantize_int16_transform.h +34 -0
  43. xmos_ai_tools/runtime/include/lib_nn/api/expand_8_to_16.h +8 -0
  44. xmos_ai_tools/runtime/include/lib_nn/api/multiply_int16.h +42 -0
  45. xmos_ai_tools/runtime/include/lib_nn/api/multiply_int16_transform.h +71 -0
  46. xmos_ai_tools/runtime/include/lib_nn/api/nn_api.h +15 -0
  47. xmos_ai_tools/runtime/include/lib_nn/api/nn_bin_types.h +14 -0
  48. xmos_ai_tools/runtime/include/lib_nn/api/nn_config.h +287 -0
  49. xmos_ai_tools/runtime/include/lib_nn/api/nn_conv2d_structs.h +72 -0
  50. xmos_ai_tools/runtime/include/lib_nn/api/nn_image.h +26 -0
  51. xmos_ai_tools/runtime/include/lib_nn/api/nn_layers.h +307 -0
  52. xmos_ai_tools/runtime/include/lib_nn/api/nn_op_helper.h +132 -0
  53. xmos_ai_tools/runtime/include/lib_nn/api/nn_op_utils.h +153 -0
  54. xmos_ai_tools/runtime/include/lib_nn/api/nn_operator.h +18 -0
  55. xmos_ai_tools/runtime/include/lib_nn/api/nn_pooling.h +551 -0
  56. xmos_ai_tools/runtime/include/lib_nn/api/nn_types.h +83 -0
  57. xmos_ai_tools/runtime/include/lib_nn/api/nn_window_params.h +55 -0
  58. xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16.h +54 -0
  59. xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16_kernel_transform.h +37 -0
  60. xmos_ai_tools/runtime/include/lib_nn/api/output_transform_fn_int16_mappings.h +13 -0
  61. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_approximation.h +83 -0
  62. xmos_ai_tools/runtime/include/lib_nn/api/quadratic_interpolation.h +23 -0
  63. xmos_ai_tools/runtime/include/lib_nn/api/quantize_int16.h +22 -0
  64. xmos_ai_tools/runtime/include/lib_nn/api/quantize_int16_transform.h +33 -0
  65. xmos_ai_tools/runtime/include/lib_nn/api/version.h +13 -0
  66. xmos_ai_tools/runtime/include/lib_nn/api/vpu_memmove_word_aligned.h +15 -0
  67. xmos_ai_tools/runtime/include/lib_nn/api/vpu_memset_256.h +55 -0
  68. xmos_ai_tools/runtime/include/lib_nn/api/vpu_sim.h +118 -0
  69. xmos_ai_tools/runtime/include/lib_nn/api/xs3_vpu.h +216 -0
  70. xmos_ai_tools/runtime/include/lib_nn/api/xs3a_registers.h +2869 -0
  71. xmos_ai_tools/runtime/include/lib_nn/src/asm/asm_constants.h +41 -0
  72. xmos_ai_tools/runtime/include/lib_nn/src/asm/window_op_plan.h +25 -0
  73. xmos_ai_tools/runtime/include/lib_tflite_micro/api/fast_flash.h +53 -0
  74. xmos_ai_tools/runtime/include/lib_tflite_micro/api/inference_engine.h +218 -0
  75. xmos_ai_tools/runtime/include/lib_tflite_micro/api/load_weights.h +64 -0
  76. xmos_ai_tools/runtime/include/lib_tflite_micro/api/memory_parallel_transport.h +52 -0
  77. xmos_ai_tools/runtime/include/lib_tflite_micro/api/version.h +13 -0
  78. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_config.h +17 -0
  79. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_device_memory.h +62 -0
  80. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_shared_config.h +31 -0
  81. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/conv2d_float.h +155 -0
  82. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.h +28 -0
  83. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.h +32 -0
  84. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_interpreter.h +49 -0
  85. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h +79 -0
  86. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_profiler.h +49 -0
  87. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_utils.h +160 -0
  88. xmos_ai_tools/runtime/include/lib_tflite_micro/src/thread_call.h +119 -0
  89. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_defs.h +4 -0
  90. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_device.h +4 -0
  91. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_std_descriptors.h +4 -0
  92. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/legacy/usb_std_requests.h +4 -0
  93. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud.h +518 -0
  94. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_conf_default.h +11 -0
  95. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_device.h +87 -0
  96. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_std_descriptors.h +191 -0
  97. xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud_std_requests.h +120 -0
  98. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/XUD_USB_Defines.h +70 -0
  99. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/hid.h +23 -0
  100. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudio10.h +30 -0
  101. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudio20.h +357 -0
  102. xmos_ai_tools/runtime/include/lib_xud/lib_xud/src/user/class/usbaudiocommon.h +168 -0
  103. xmos_ai_tools/runtime/include/signal/micro/kernels/delay_flexbuffers_generated_data.h +25 -0
  104. xmos_ai_tools/runtime/include/signal/micro/kernels/energy_flexbuffers_generated_data.h +28 -0
  105. xmos_ai_tools/runtime/include/signal/micro/kernels/fft_flexbuffers_generated_data.h +37 -0
  106. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_flexbuffers_generated_data.h +25 -0
  107. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_log_flexbuffers_generated_data.h +27 -0
  108. xmos_ai_tools/runtime/include/signal/micro/kernels/filter_bank_spectral_subtraction_flexbuffers_generated_data.h +26 -0
  109. xmos_ai_tools/runtime/include/signal/micro/kernels/framer_flexbuffers_generated_data.h +25 -0
  110. xmos_ai_tools/runtime/include/signal/micro/kernels/irfft.h +31 -0
  111. xmos_ai_tools/runtime/include/signal/micro/kernels/overlap_add_flexbuffers_generated_data.h +25 -0
  112. xmos_ai_tools/runtime/include/signal/micro/kernels/pcan_flexbuffers_generated_data.h +7 -0
  113. xmos_ai_tools/runtime/include/signal/micro/kernels/rfft.h +31 -0
  114. xmos_ai_tools/runtime/include/signal/micro/kernels/stacker_flexbuffers_generated_data.h +25 -0
  115. xmos_ai_tools/runtime/include/signal/micro/kernels/window_flexbuffers_generated_data.h +25 -0
  116. xmos_ai_tools/runtime/include/signal/src/circular_buffer.h +118 -0
  117. xmos_ai_tools/runtime/include/signal/src/complex.h +29 -0
  118. xmos_ai_tools/runtime/include/signal/src/energy.h +38 -0
  119. xmos_ai_tools/runtime/include/signal/src/fft_auto_scale.h +35 -0
  120. xmos_ai_tools/runtime/include/signal/src/filter_bank.h +69 -0
  121. xmos_ai_tools/runtime/include/signal/src/filter_bank_log.h +38 -0
  122. xmos_ai_tools/runtime/include/signal/src/filter_bank_spectral_subtraction.h +73 -0
  123. xmos_ai_tools/runtime/include/signal/src/filter_bank_square_root.h +34 -0
  124. xmos_ai_tools/runtime/include/signal/src/irfft.h +84 -0
  125. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_common.h +49 -0
  126. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_float.h +31 -0
  127. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int16.h +30 -0
  128. xmos_ai_tools/runtime/include/signal/src/kiss_fft_wrappers/kiss_fft_int32.h +31 -0
  129. xmos_ai_tools/runtime/include/signal/src/log.h +30 -0
  130. xmos_ai_tools/runtime/include/signal/src/max_abs.h +31 -0
  131. xmos_ai_tools/runtime/include/signal/src/msb.h +32 -0
  132. xmos_ai_tools/runtime/include/signal/src/overlap_add.h +46 -0
  133. xmos_ai_tools/runtime/include/signal/src/pcan_argc_fixed.h +41 -0
  134. xmos_ai_tools/runtime/include/signal/src/rfft.h +85 -0
  135. xmos_ai_tools/runtime/include/signal/src/square_root.h +32 -0
  136. xmos_ai_tools/runtime/include/signal/src/window.h +31 -0
  137. xmos_ai_tools/runtime/include/signal/testdata/fft_test_data.h +48 -0
  138. xmos_ai_tools/runtime/include/tensorflow/lite/array.h +156 -0
  139. xmos_ai_tools/runtime/include/tensorflow/lite/builtin_op_data.h +22 -0
  140. xmos_ai_tools/runtime/include/tensorflow/lite/builtin_ops.h +241 -0
  141. xmos_ai_tools/runtime/include/tensorflow/lite/c/builtin_op_data.h +20 -0
  142. xmos_ai_tools/runtime/include/tensorflow/lite/c/c_api_types.h +26 -0
  143. xmos_ai_tools/runtime/include/tensorflow/lite/c/common.h +30 -0
  144. xmos_ai_tools/runtime/include/tensorflow/lite/context_util.h +54 -0
  145. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/error_reporter.h +72 -0
  146. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/flatbuffer_conversions.h +440 -0
  147. xmos_ai_tools/runtime/include/tensorflow/lite/core/api/tensor_utils.h +28 -0
  148. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/builtin_op_data.h +626 -0
  149. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/c_api_types.h +178 -0
  150. xmos_ai_tools/runtime/include/tensorflow/lite/core/c/common.h +1496 -0
  151. xmos_ai_tools/runtime/include/tensorflow/lite/core/macros.h +78 -0
  152. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/bits.h +102 -0
  153. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft.h +50 -0
  154. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft_io.h +34 -0
  155. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/fft_util.h +34 -0
  156. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank.h +63 -0
  157. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank_io.h +35 -0
  158. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/filterbank_util.h +50 -0
  159. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend.h +64 -0
  160. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend_io.h +31 -0
  161. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/frontend_util.h +52 -0
  162. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/kiss_fft_common.h +48 -0
  163. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/kiss_fft_int16.h +33 -0
  164. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_lut.h +40 -0
  165. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale.h +39 -0
  166. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale_io.h +33 -0
  167. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/log_scale_util.h +45 -0
  168. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction.h +46 -0
  169. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction_io.h +36 -0
  170. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/noise_reduction_util.h +50 -0
  171. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/pcan_gain_control.h +47 -0
  172. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/pcan_gain_control_util.h +57 -0
  173. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window.h +49 -0
  174. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window_io.h +34 -0
  175. xmos_ai_tools/runtime/include/tensorflow/lite/experimental/microfrontend/lib/window_util.h +45 -0
  176. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/common.h +1358 -0
  177. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/compatibility.h +122 -0
  178. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/cppmath.h +40 -0
  179. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/max.h +35 -0
  180. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/min.h +35 -0
  181. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/optimized/neon_check.h +20 -0
  182. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor.h +141 -0
  183. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/portable_tensor_utils.h +623 -0
  184. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/quantization_util.h +292 -0
  185. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add.h +561 -0
  186. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/add_n.h +86 -0
  187. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/arg_min_max.h +88 -0
  188. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/batch_matmul.h +275 -0
  189. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/batch_to_space_nd.h +101 -0
  190. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/binary_function.h +91 -0
  191. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/broadcast_args.h +56 -0
  192. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/broadcast_to.h +97 -0
  193. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/ceil.h +37 -0
  194. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/comparisons.h +271 -0
  195. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/concatenation.h +141 -0
  196. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/conv.h +289 -0
  197. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/cumsum.h +175 -0
  198. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depth_to_space.h +79 -0
  199. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depthwiseconv_float.h +100 -0
  200. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/depthwiseconv_uint8.h +319 -0
  201. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/dequantize.h +78 -0
  202. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/div.h +247 -0
  203. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/elu.h +37 -0
  204. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/exp.h +38 -0
  205. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/fill.h +38 -0
  206. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor.h +39 -0
  207. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor_div.h +35 -0
  208. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/floor_mod.h +44 -0
  209. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/fully_connected.h +323 -0
  210. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/hard_swish.h +168 -0
  211. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/add.h +250 -0
  212. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/conv.h +241 -0
  213. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/depthwise_conv.h +291 -0
  214. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/fully_connected.h +126 -0
  215. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/l2normalization.h +67 -0
  216. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/logistic.h +121 -0
  217. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h +18 -0
  218. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/mul.h +194 -0
  219. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/pooling.h +264 -0
  220. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/tanh.h +117 -0
  221. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/integer_ops/transpose_conv.h +224 -0
  222. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/l2normalization.h +90 -0
  223. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/leaky_relu.h +69 -0
  224. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/log_softmax.h +256 -0
  225. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/logistic.h +132 -0
  226. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/lstm_cell.h +422 -0
  227. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/maximum_minimum.h +64 -0
  228. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/mul.h +267 -0
  229. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/neg.h +37 -0
  230. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/pad.h +169 -0
  231. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/pooling.h +303 -0
  232. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/portable_tensor_utils.h +333 -0
  233. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/portable_tensor_utils_impl.h +244 -0
  234. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/prelu.h +111 -0
  235. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/process_broadcast_shapes.h +140 -0
  236. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/quantize.h +89 -0
  237. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/reduce.h +491 -0
  238. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/requantize.h +70 -0
  239. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_bilinear.h +233 -0
  240. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/resize_nearest_neighbor.h +102 -0
  241. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/round.h +51 -0
  242. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/select.h +151 -0
  243. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/slice.h +80 -0
  244. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/softmax.h +233 -0
  245. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/space_to_batch_nd.h +109 -0
  246. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/space_to_depth.h +80 -0
  247. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/strided_slice.h +147 -0
  248. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/sub.h +465 -0
  249. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/tanh.h +129 -0
  250. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/transpose.h +203 -0
  251. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/reference/transpose_conv.h +225 -0
  252. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/runtime_shape.h +168 -0
  253. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/strided_slice_logic.h +278 -0
  254. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/tensor_ctypes.h +42 -0
  255. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/internal/types.h +1096 -0
  256. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/kernel_util.h +341 -0
  257. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/op_macros.h +49 -0
  258. xmos_ai_tools/runtime/include/tensorflow/lite/kernels/padding.h +115 -0
  259. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/ibuffer_allocator.h +100 -0
  260. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/non_persistent_arena_buffer_allocator.h +104 -0
  261. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/persistent_arena_buffer_allocator.h +58 -0
  262. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/recording_single_arena_buffer_allocator.h +63 -0
  263. xmos_ai_tools/runtime/include/tensorflow/lite/micro/arena_allocator/single_arena_buffer_allocator.h +144 -0
  264. xmos_ai_tools/runtime/include/tensorflow/lite/micro/benchmarks/micro_benchmark.h +95 -0
  265. xmos_ai_tools/runtime/include/tensorflow/lite/micro/compatibility.h +32 -0
  266. xmos_ai_tools/runtime/include/tensorflow/lite/micro/cortex_m_generic/debug_log_callback.h +49 -0
  267. xmos_ai_tools/runtime/include/tensorflow/lite/micro/debug_log.h +38 -0
  268. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/micro_speech/micro_model_settings.h +37 -0
  269. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/expected_output_data.h +47 -0
  270. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/input_data.h +108 -0
  271. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/network_tester/network_model.h +166 -0
  272. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/detection_responder.h +32 -0
  273. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/image_provider.h +38 -0
  274. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/main_functions.h +37 -0
  275. xmos_ai_tools/runtime/include/tensorflow/lite/micro/examples/person_detection/model_settings.h +35 -0
  276. xmos_ai_tools/runtime/include/tensorflow/lite/micro/fake_micro_context.h +70 -0
  277. xmos_ai_tools/runtime/include/tensorflow/lite/micro/flatbuffer_utils.h +65 -0
  278. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/activation_utils.h +57 -0
  279. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/activations.h +68 -0
  280. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/add.h +78 -0
  281. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_function_specializations.h +141 -0
  282. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_interface.h +75 -0
  283. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_slicers.h +56 -0
  284. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/mli_tf_utils.h +310 -0
  285. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/scratch_buf_mgr.h +145 -0
  286. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/arc_mli/scratch_buffers.h +78 -0
  287. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/ceva_common.h +24 -0
  288. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/ceva_tflm_lib.h +613 -0
  289. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/mcps_macros.h +115 -0
  290. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ceva/types.h +1286 -0
  291. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer.h +45 -0
  292. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/circular_buffer_flexbuffers_generated_data.h +22 -0
  293. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv.h +117 -0
  294. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/conv_test.h +94 -0
  295. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/depthwise_conv.h +80 -0
  296. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/dequantize.h +38 -0
  297. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/detection_postprocess_flexbuffers_generated_data.h +25 -0
  298. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/ethosu.h +28 -0
  299. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/fully_connected.h +112 -0
  300. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/hard_swish.h +30 -0
  301. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_runner.h +86 -0
  302. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/kernel_util.h +150 -0
  303. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/leaky_relu.h +43 -0
  304. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/logical.h +35 -0
  305. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/logistic.h +42 -0
  306. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_eval.h +541 -0
  307. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_eval_test.h +817 -0
  308. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/lstm_shared.h +150 -0
  309. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_ops.h +158 -0
  310. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/micro_tensor_utils.h +56 -0
  311. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/mul.h +74 -0
  312. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pad.h +27 -0
  313. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/pooling.h +142 -0
  314. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/prelu.h +39 -0
  315. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/quantize.h +37 -0
  316. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reduce.h +65 -0
  317. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/reshape.h +26 -0
  318. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/softmax.h +67 -0
  319. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/strided_slice.h +40 -0
  320. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/sub.h +60 -0
  321. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/svdf.h +100 -0
  322. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/testdata/conv_test_data.h +37 -0
  323. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/testdata/lstm_test_data.h +579 -0
  324. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/unidirectional_sequence_lstm.h +47 -0
  325. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/hifimini/fixedpoint_utils.h +139 -0
  326. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/lstm_eval.h +216 -0
  327. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/lstm_shared.h +78 -0
  328. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa.h +38 -0
  329. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_add.h +48 -0
  330. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_conv.h +89 -0
  331. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_depthwise_conv.h +74 -0
  332. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_fully_connected.h +78 -0
  333. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_pad.h +49 -0
  334. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_pooling.h +76 -0
  335. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reduce.h +47 -0
  336. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_reshape.h +44 -0
  337. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_softmax.h +58 -0
  338. xmos_ai_tools/runtime/include/tensorflow/lite/micro/kernels/xtensa/xtensa_svdf.h +39 -0
  339. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_helpers.h +64 -0
  340. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/greedy_memory_planner.h +170 -0
  341. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/linear_memory_planner.h +53 -0
  342. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/memory_plan_struct.h +73 -0
  343. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/micro_memory_planner.h +95 -0
  344. xmos_ai_tools/runtime/include/tensorflow/lite/micro/memory_planner/non_persistent_buffer_planner_shim.h +133 -0
  345. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocation_info.h +138 -0
  346. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_allocator.h +351 -0
  347. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_arena_constants.h +28 -0
  348. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_common.h +38 -0
  349. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_context.h +176 -0
  350. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_graph.h +79 -0
  351. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter.h +189 -0
  352. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_context.h +125 -0
  353. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_interpreter_graph.h +110 -0
  354. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_log.h +42 -0
  355. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_mutable_op_resolver.h +708 -0
  356. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_op_resolver.h +62 -0
  357. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler.h +140 -0
  358. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_profiler_interface.h +38 -0
  359. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_resource_variable.h +89 -0
  360. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_time.h +36 -0
  361. xmos_ai_tools/runtime/include/tensorflow/lite/micro/micro_utils.h +162 -0
  362. xmos_ai_tools/runtime/include/tensorflow/lite/micro/mock_micro_graph.h +60 -0
  363. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/interpreter/src/python_ops_resolver.h +21 -0
  364. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/tflite_size/src/flatbuffer_size.h +30 -0
  365. xmos_ai_tools/runtime/include/tensorflow/lite/micro/python/tflite_size/src/flatbuffer_size_wrapper.h +33 -0
  366. xmos_ai_tools/runtime/include/tensorflow/lite/micro/recording_micro_allocator.h +125 -0
  367. xmos_ai_tools/runtime/include/tensorflow/lite/micro/recording_micro_interpreter.h +69 -0
  368. xmos_ai_tools/runtime/include/tensorflow/lite/micro/system_setup.h +27 -0
  369. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helper_custom_ops.h +49 -0
  370. xmos_ai_tools/runtime/include/tensorflow/lite/micro/test_helpers.h +334 -0
  371. xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/micro_test.h +267 -0
  372. xmos_ai_tools/runtime/include/tensorflow/lite/micro/testing/test_conv_model.h +23 -0
  373. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tflite_bridge/flatbuffer_conversions_bridge.h +45 -0
  374. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tflite_bridge/micro_error_reporter.h +36 -0
  375. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/log_utils.h +273 -0
  376. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/metrics.h +41 -0
  377. xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/op_resolver.h +127 -0
  378. xmos_ai_tools/runtime/include/tensorflow/lite/portable_type_to_tflitetype.h +75 -0
  379. xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_generated.h +24644 -0
  380. xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_utils.h +33 -0
  381. xmos_ai_tools/runtime/include/tile_ram_server.h +38 -0
  382. xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a +0 -0
  383. xmos_ai_tools/runtime/lib/libxtflitemicro.a +0 -0
  384. xmos_ai_tools/xformer/__init__.py +64 -0
  385. xmos_ai_tools/xformer/flash.py +190 -0
  386. xmos_ai_tools/xinterpreters/__init__.py +1 -0
  387. xmos_ai_tools/xinterpreters/exceptions.py +38 -0
  388. xmos_ai_tools/xinterpreters/host_interpreter.py +651 -0
  389. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib +0 -0
  390. xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib +0 -0
  391. xmos_ai_tools-1.3.2.dev180.data/data/bin/xcore-opt +0 -0
  392. xmos_ai_tools-1.3.2.dev180.dist-info/METADATA +33 -0
  393. xmos_ai_tools-1.3.2.dev180.dist-info/RECORD +395 -0
  394. xmos_ai_tools-1.3.2.dev180.dist-info/WHEEL +5 -0
  395. xmos_ai_tools-1.3.2.dev180.dist-info/top_level.txt +1 -0
@@ -0,0 +1,4 @@
1
+ // Copyright 2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+ #include "xud_std_descriptors.h"
4
+
@@ -0,0 +1,4 @@
1
+ // Copyright 2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+ #include "xud_std_requests.h"
4
+
@@ -0,0 +1,518 @@
1
+ // Copyright 2011-2023 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+
4
+ /*
5
+ * \brief User defines and functions for XMOS USB Device library
6
+ */
7
+
8
+ #ifndef _XUD_H_
9
+ #define _XUD_H_
10
+
11
+ #include <platform.h>
12
+
13
+ #if !defined(__XS2A__)
14
+ #define XUD_OPT_SOFTCRC5 (1)
15
+ #else
16
+ #define XUD_OPT_SOFTCRC5 (0)
17
+ #endif
18
+
19
+ #ifdef __xud_conf_h_exists__
20
+ #include "xud_conf.h"
21
+ #endif
22
+
23
+ #ifndef XUD_STARTUP_ADDRESS
24
+ #define XUD_STARTUP_ADDRESS (0)
25
+ #endif
26
+
27
+ #ifndef __ASSEMBLER__
28
+
29
+ #include <xs1.h>
30
+ #include <platform.h>
31
+ #include <print.h>
32
+ #include <xccompat.h>
33
+
34
+ #ifndef XUD_WEAK_API
35
+ #define XUD_WEAK_API (0)
36
+ #endif
37
+
38
+ #if defined(__STDC__) && XUD_WEAK_API
39
+ #define ATTRIB_WEAK __attribute__((weak));
40
+ #else
41
+ #define ATTRIB_WEAK
42
+ #endif
43
+
44
+ #if !defined(USB_TILE)
45
+ #define USB_TILE tile[0]
46
+ #endif
47
+
48
+ // TODO use PLATFORM_REFERENCE_MHZ from platform.h
49
+ #ifndef REF_CLK_FREQ
50
+ #define REF_CLK_FREQ (100)
51
+ #endif
52
+
53
+ #ifndef XUD_CORE_CLOCK
54
+ #ifdef __XS2A__
55
+ //#warning XUD_CORE_CLOCK not defined, using default (500MHz)
56
+ #define XUD_CORE_CLOCK (500)
57
+ #else
58
+ //#warning XUD_CORE_CLOCK not defined, using default (600MHz)
59
+ #define XUD_CORE_CLOCK (600)
60
+ #endif
61
+ #endif
62
+
63
+ #if !defined(PORT_USB_CLK)
64
+ /* Ports have not been defined in the .xn file */
65
+ #define PORT_USB_CLK on USB_TILE: XS1_PORT_1J
66
+ #define PORT_USB_TXD on USB_TILE: XS1_PORT_8A
67
+ #define PORT_USB_RXD on USB_TILE: XS1_PORT_8B
68
+ #define PORT_USB_TX_READYOUT on USB_TILE: XS1_PORT_1K
69
+ #define PORT_USB_TX_READYIN on USB_TILE: XS1_PORT_1H
70
+ #define PORT_USB_RX_READY on USB_TILE: XS1_PORT_1I
71
+ #define PORT_USB_FLAG0 on USB_TILE: XS1_PORT_1E
72
+ #define PORT_USB_FLAG1 on USB_TILE: XS1_PORT_1F
73
+ #ifdef __XS2A__
74
+ /* XS2A has an additional flag port */
75
+ #define PORT_USB_FLAG2 on USB_TILE: XS1_PORT_1G
76
+ #endif
77
+ #endif // PORT_USB_CLK
78
+
79
+ /**
80
+ * \var typedef XUD_EpTransferType
81
+ * \brief Typedef for endpoint data transfer types. Note: it is important that ISO is 0
82
+ */
83
+ typedef enum XUD_EpTransferType
84
+ {
85
+ XUD_EPTYPE_ISO = 0, /**< Isoc */
86
+ XUD_EPTYPE_INT, /**< Interrupt */
87
+ XUD_EPTYPE_BUL, /**< Bulk */
88
+ XUD_EPTYPE_CTL, /**< Control */
89
+ XUD_EPTYPE_DIS, /**< Disabled */
90
+ } XUD_EpTransferType;
91
+
92
+ /**
93
+ * \var typedef XUD_EpType
94
+ * \brief Typedef for endpoint type
95
+ */
96
+ typedef unsigned int XUD_EpType;
97
+
98
+ /**
99
+ * \var typedef XUD_ep
100
+ * \brief Typedef for endpoint identifiers
101
+ */
102
+ typedef unsigned int XUD_ep;
103
+
104
+ /* Value to be or'ed in with EpTransferType to enable bus state notifications */
105
+ #define XUD_STATUS_ENABLE 0x80000000
106
+
107
+ typedef enum XUD_BusSpeed
108
+ {
109
+ XUD_SPEED_FS = 1,
110
+ XUD_SPEED_HS = 2,
111
+ XUD_SPEED_KILL = 3
112
+ } XUD_BusSpeed_t;
113
+
114
+ typedef enum XUD_PwrConfig
115
+ {
116
+ XUD_PWR_BUS,
117
+ XUD_PWR_SELF
118
+ } XUD_PwrConfig;
119
+
120
+ typedef enum XUD_Result
121
+ {
122
+ XUD_RES_RST = -1,
123
+ XUD_RES_OKAY = 0,
124
+ //XUD_RES_CTL = 1, /* Received a control trans */
125
+ XUD_RES_ERR = 2,
126
+ } XUD_Result_t;
127
+
128
+ /** This performs the low-level USB I/O operations. Note that this
129
+ * needs to run in a thread with at least 80 MIPS worst case execution
130
+ * speed.
131
+ *
132
+ * \param c_epOut An array of channel ends, one channel end per
133
+ * output endpoint (USB OUT transaction); this includes
134
+ * a channel to obtain requests on Endpoint 0.
135
+ * \param noEpOut The number of output endpoints, should be at least 1 (for Endpoint 0).
136
+ * \param c_epIn An array of channel ends, one channel end per input endpoint (USB IN transaction);
137
+ * this includes a channel to respond to requests on Endpoint 0.
138
+ * \param noEpIn The number of input endpoints, should be at least 1 (for Endpoint 0).
139
+ * \param c_sof A channel to receive SOF tokens on. This channel must be connected to a process that
140
+ * can receive a token once every 125 ms. If tokens are not read, the USB layer will lock up.
141
+ * If no SOF tokens are required ``null`` should be used for this parameter.
142
+ *
143
+ * \param epTypeTableOut See ``epTypeTableIn``.
144
+ * \param epTypeTableIn This and ``epTypeTableOut`` are two arrays
145
+ * indicating the type of the endpoint.
146
+ * Legal types include:
147
+ * ``XUD_EPTYPE_CTL`` (Endpoint 0),
148
+ * ``XUD_EPTYPE_BUL`` (Bulk endpoint),
149
+ * ``XUD_EPTYPE_ISO`` (Isochronous endpoint),
150
+ * ``XUD_EPTYPE_INT`` (Interrupt endpoint),
151
+ * ``XUD_EPTYPE_DIS`` (Endpoint not used).
152
+ * The first array contains the
153
+ * endpoint types for each of the OUT
154
+ * endpoints, the second array contains the
155
+ * endpoint types for each of the IN
156
+ * endpoints.
157
+ * \param desiredSpeed This parameter specifies what speed the device will attempt to run at
158
+ * i.e. full-speed (ie 12Mbps) or high-speed (480Mbps) if supported
159
+ * by the host. Pass ``XUD_SPEED_HS`` if high-speed is desired or ``XUD_SPEED_FS``
160
+ * if not. Low speed USB is not supported by XUD.
161
+ * \param pwrConfig Specifies whether the device is bus or self-powered. When self-powered the XUD
162
+ * will monitor the VBUS line for host disconnections. This is required for compliance reasons.
163
+ * Valid values are XUD_PWR_SELF and XUD_PWR_BUS.
164
+ *
165
+ */
166
+ int XUD_Main(/*tileref * unsafe usbtileXUD_res_t &xudres, */
167
+ chanend c_epOut[], int noEpOut,
168
+ chanend c_epIn[], int noEpIn,
169
+ NULLABLE_RESOURCE(chanend, c_sof),
170
+ XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[],
171
+ XUD_BusSpeed_t desiredSpeed,
172
+ XUD_PwrConfig pwrConfig);
173
+
174
+ /* Legacy API support */
175
+ int XUD_Manager(chanend c_epOut[], int noEpOut,
176
+ chanend c_epIn[], int noEpIn,
177
+ NULLABLE_RESOURCE(chanend, c_sof),
178
+ XUD_EpType epTypeTableOut[], XUD_EpType epTypeTableIn[],
179
+ NULLABLE_RESOURCE(port, p_usb_rst),
180
+ NULLABLE_RESOURCE(xcore_clock_t, clk),
181
+ unsigned rstMask,
182
+ XUD_BusSpeed_t desiredSpeed,
183
+ XUD_PwrConfig pwrConfig);
184
+
185
+ /**
186
+ * \brief This function must be called by a thread that deals with an OUT endpoint.
187
+ * When the host sends data, the low-level driver will fill the buffer. It
188
+ * pauses until data is available.
189
+ * \param ep_out The OUT endpoint identifier (created by ``XUD_InitEP``).
190
+ * \param buffer The buffer in which to store data received from the host.
191
+ * The buffer is assumed to be word aligned.
192
+ * \param length The number of bytes written to the buffer
193
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`_.
194
+ **/
195
+ XUD_Result_t XUD_GetBuffer(XUD_ep ep_out, unsigned char buffer[], REFERENCE_PARAM(unsigned, length)) ATTRIB_WEAK;
196
+
197
+ /**
198
+ * \brief Request setup data from usb buffer for a specific endpoint, pauses until data is available.
199
+ * \param ep_out The OUT endpoint identifier (created by ``XUD_InitEP``).
200
+ * \param buffer A char buffer passed by ref into which data is returned.
201
+ * \param length Length of the buffer received (expect 8 bytes)
202
+ * \return XUD_RES_OKAY on success, for errors see ``Status Reporting``_.
203
+ **/
204
+ XUD_Result_t XUD_GetSetupBuffer(XUD_ep ep_out, unsigned char buffer[], REFERENCE_PARAM(unsigned, length)) ATTRIB_WEAK;
205
+
206
+ /**
207
+ * \brief This function must be called by a thread that deals with an IN endpoint.
208
+ * When the host asks for data, the low-level driver will transmit the buffer
209
+ * to the host.
210
+ * \param ep_in The endpoint identifier (created by ``XUD_InitEp``).
211
+ * \param buffer The buffer of data to transmit to the host.
212
+ * \param datalength The number of bytes in the buffer.
213
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`_.
214
+ */
215
+ XUD_Result_t XUD_SetBuffer(XUD_ep ep_in, unsigned char buffer[], unsigned datalength) ATTRIB_WEAK;
216
+
217
+ /**
218
+ * \brief Similar to XUD_SetBuffer but breaks up data transfers into smaller packets.
219
+ * This function must be called by a thread that deals with an IN endpoint.
220
+ * When the host asks for data, the low-level driver will transmit the buffer
221
+ * to the host.
222
+ * \param ep_in The IN endpoint identifier (created by ``XUD_InitEp``).
223
+ * \param buffer The buffer of data to transmit to the host.
224
+ * \param datalength The number of bytes in the buffer.
225
+ * \param epMax The maximum packet size in bytes.
226
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`_.
227
+ */
228
+ XUD_Result_t XUD_SetBuffer_EpMax(XUD_ep ep_in, unsigned char buffer[], unsigned datalength, unsigned epMax) ATTRIB_WEAK;
229
+
230
+ /**
231
+ * \brief Performs a combined ``XUD_SetBuffer`` and ``XUD_GetBuffer``.
232
+ * It transmits the buffer of the given length over the ``ep_in`` endpoint to
233
+ * answer an IN request, and then waits for a 0 length Status OUT transaction on ``ep_out``.
234
+ * This function is normally called to handle Get control requests to Endpoint 0.
235
+ *
236
+ * \param ep_out The endpoint identifier that handles Endpoint 0 OUT data in the XUD manager.
237
+ * \param ep_in The endpoint identifier that handles Endpoint 0 IN data in the XUD manager.
238
+ * \param buffer The data to send in response to the IN transaction. Note that this data
239
+ * is chopped up in fragments of at most 64 bytes.
240
+ * \param length Length of data to be sent.
241
+ * \param requested The length that the host requested, (Typically pass the value ``wLength``).
242
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`_
243
+ **/
244
+ XUD_Result_t XUD_DoGetRequest(XUD_ep ep_out, XUD_ep ep_in, unsigned char buffer[], unsigned length, unsigned requested) ATTRIB_WEAK;
245
+
246
+ /**
247
+ * \brief This function sends an empty packet back on the next IN request with
248
+ * PID1. It is normally used by Endpoint 0 to acknowledge success of a control transfer.
249
+ * \param ep_in The Endpoint 0 IN identifier to the XUD manager.
250
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`_.
251
+ **/
252
+ XUD_Result_t XUD_DoSetRequestStatus(XUD_ep ep_in) ATTRIB_WEAK;
253
+
254
+ /**
255
+ * \brief This function will complete a reset on an endpoint. Can take
256
+ * one or two ``XUD_ep`` as parameters (the second parameter can be set to ``null``).
257
+ * The return value should be inspected to find the new bus-speed.
258
+ * In Endpoint 0 typically two endpoints are reset (IN and OUT).
259
+ * In other endpoints ``null`` can be passed as the second parameter.
260
+ * \param one IN or OUT endpoint identifier to perform the reset on.
261
+ * \param two Optional second IN or OUT endpoint structure to perform a reset on.
262
+ * \return Either ``XUD_SPEED_HS`` - the host has accepted that this device can execute
263
+ * at high speed, ``XUD_SPEED_FS`` - the device is running at full speed,
264
+ * or ``XUD_SPEED_KILL`` to indicate that the USB stack has been shut down
265
+ * by another part of the user code (using XUD_Kill). If the last value is
266
+ * returned, the endpoint code should call XUD_CloseEndpoint and then
267
+ * terminate.
268
+ */
269
+ XUD_BusSpeed_t XUD_ResetEndpoint(XUD_ep one, NULLABLE_REFERENCE_PARAM(XUD_ep, two));
270
+
271
+ /**
272
+ * \brief This function closes an endpoint. It should be called when the USB stack
273
+ * is shutting down. It should be called on all endpoints, either in parallel
274
+ * or in numerical order, first all OUT and then all IN endpoints
275
+ * \param one endpoint to close.
276
+ */
277
+ void XUD_CloseEndpoint(XUD_ep one);
278
+
279
+ /**
280
+ * \brief Initialises an XUD_ep
281
+ * \param c_ep Endpoint channel to be connected to the XUD library.
282
+ * \return Endpoint identifier
283
+ */
284
+ XUD_ep XUD_InitEp(chanend c_ep);
285
+
286
+ /**
287
+ * \brief Mark an endpoint as STALL based on its EP address. Cleared automatically if a SETUP received on the endpoint.
288
+ * Note: the IN bit of the endpoint address is used.
289
+ * \param epNum Endpoint number.
290
+ * \warning Must be run on same tile as XUD core
291
+ */
292
+ void XUD_SetStallByAddr(int epNum);
293
+
294
+ /**
295
+ * \brief Mark an endpoint as NOT STALLed based on its EP address.
296
+ * Note: the IN bit of the endpoint address is used.
297
+ * \param epNum Endpoint number.
298
+ * \warning Must be run on same tile as XUD core
299
+ */
300
+ void XUD_ClearStallByAddr(int epNum);
301
+
302
+ /**
303
+ * \brief Mark an endpoint as STALLed. It is cleared automatically if a SETUP received on the endpoint.
304
+ * \param ep XUD_ep type.
305
+ * \warning Must be run on same tile as XUD core
306
+ */
307
+ void XUD_SetStall(XUD_ep ep);
308
+
309
+ /**
310
+ * \brief Mark an endpoint as NOT STALLed
311
+ * \param ep XUD_ep type.
312
+ * \warning Must be run on same tile as XUD core
313
+ */
314
+ void XUD_ClearStall(XUD_ep ep);
315
+
316
+ /* USB 2.0 Spec 9.1.1.5 states that configuring a device should cause all
317
+ * the status and configuration values associated with the endpoints in the
318
+ * affected interfaces to be set to their default values. This includes setting
319
+ * the data toggle of any endpoint using data toggles to the value DATA0 */
320
+ /**
321
+ * \brief Reset an Endpoints state including data PID toggle
322
+ * Note: the IN bit of the endpoint address is used.
323
+ * \param epNum Endpoint number (including IN bit)
324
+ * \warning Must be run on same tile as XUD core
325
+ */
326
+ void XUD_ResetEpStateByAddr(unsigned epNum);
327
+
328
+ /**
329
+ * \brief Enable a specific USB test mode in XUD
330
+ * \param ep XUD_ep type (must be endpoint 0 in or out)
331
+ * \param testMode The desired test-mode
332
+ * \warning Must be run on same tile as XUD core
333
+ */
334
+ void XUD_SetTestMode(XUD_ep ep, unsigned testMode);
335
+
336
+ /**
337
+ * \brief Terminate XUD core
338
+ * \param ep XUD_ep type (must be endpoint 0 in or out)
339
+ * \warning Must be run on same tile as XUD core
340
+ */
341
+ void XUD_Kill(XUD_ep ep);
342
+
343
+ /***********************************************************************************************/
344
+
345
+ /*
346
+ * Advanced functions for supporting multple Endpoints in a single core
347
+ */
348
+
349
+
350
+ /**
351
+ * \brief Marks an OUT endpoint as ready to receive data
352
+ * \param ep The OUT endpoint identifier (created by ``XUD_InitEp``).
353
+ * \param addr The address of the buffer in which to store data received from the host.
354
+ * The buffer is assumed to be word aligned.
355
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`.
356
+ */
357
+ static inline int XUD_SetReady_OutPtr(XUD_ep ep, unsigned addr)
358
+ {
359
+ int chan_array_ptr;
360
+ int reset;
361
+
362
+ /* Firstly check if we have missed a USB reset - endpoint may would not want receive after a reset */
363
+ asm volatile("ldw %0, %1[9]":"=r"(reset):"r"(ep));
364
+ if(reset)
365
+ {
366
+ return XUD_RES_RST;
367
+ }
368
+ asm volatile("ldw %0, %1[0]":"=r"(chan_array_ptr):"r"(ep));
369
+ asm volatile("stw %0, %1[3]"::"r"(addr),"r"(ep)); // Store buffer
370
+ asm volatile("stw %0, %1[0]"::"r"(ep),"r"(chan_array_ptr));
371
+
372
+ return XUD_RES_OKAY;
373
+ }
374
+
375
+ /**
376
+ * \brief Marks an OUT endpoint as ready to receive data
377
+ * \param ep The OUT endpoint identifier (created by ``XUD_InitEp``).
378
+ * \param buffer The buffer in which to store data received from the host.
379
+ * The buffer is assumed to be word aligned.
380
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`.
381
+ */
382
+ int XUD_SetReady_Out(XUD_ep ep, unsigned char buffer[]);
383
+
384
+
385
+ /**
386
+ * \brief Marks an IN endpoint as ready to transmit data
387
+ * \param ep The IN endpoint identifier (created by ``XUD_InitEp``).
388
+ * \param addr The address of the buffer to transmit to the host.
389
+ * The buffer is assumed be word aligned.
390
+ * \param len The length of the data to transmit.
391
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`.
392
+ */
393
+ static inline XUD_Result_t XUD_SetReady_InPtr(XUD_ep ep, unsigned addr, int len)
394
+ {
395
+ int chan_array_ptr;
396
+ int tmp, tmp2;
397
+ int wordLength;
398
+ int tailLength;
399
+
400
+ int reset;
401
+
402
+ /* Firstly check if we have missed a USB reset - endpoint may not want to send out old data after a reset */
403
+ asm volatile("ldw %0, %1[9]":"=r"(reset):"r"(ep));
404
+ if(reset)
405
+ {
406
+ return XUD_RES_RST;
407
+ }
408
+
409
+ /* Tail length bytes to bits */
410
+ #ifdef __XC__
411
+ tailLength = zext((len << 3),5);
412
+ #else
413
+ tailLength = (len << 3) & 0x1F;
414
+ #endif
415
+
416
+ /* Datalength (bytes) --> datalength (words) */
417
+ wordLength = len >> 2;
418
+
419
+ /* If tail-length is 0 and word-length not 0. Make tail-length 32 and word-length-- */
420
+ if ((tailLength == 0) && (wordLength != 0))
421
+ {
422
+ wordLength = wordLength - 1;
423
+ tailLength = 32;
424
+ }
425
+
426
+ /* Get end off buffer address */
427
+ asm volatile("add %0, %1, %2":"=r"(tmp):"r"(addr),"r"(wordLength << 2));
428
+
429
+ /* Produce negative offset from end of buffer */
430
+ asm volatile("neg %0, %1":"=r"(tmp2):"r"(wordLength));
431
+
432
+ /* Store neg index */
433
+ asm volatile("stw %0, %1[6]"::"r"(tmp2),"r"(ep));
434
+
435
+ /* Store buffer pointer */
436
+ asm volatile("stw %0, %1[3]"::"r"(tmp),"r"(ep));
437
+
438
+ /* Store tail len */
439
+ asm volatile("stw %0, %1[7]"::"r"(tailLength),"r"(ep));
440
+
441
+ /* Finally, mark ready */
442
+ asm volatile("ldw %0, %1[0]":"=r"(chan_array_ptr):"r"(ep));
443
+ asm volatile("stw %0, %1[0]"::"r"(ep),"r"(chan_array_ptr));
444
+
445
+ return XUD_RES_OKAY;
446
+ }
447
+
448
+ /**
449
+ * \brief Marks an IN endpoint as ready to transmit data
450
+ * \param ep The IN endpoint identifier (created by ``XUD_InitEp``).
451
+ * \param buffer The buffer to transmit to the host.
452
+ * The buffer is assumed be word aligned.
453
+ * \param len The length of the data to transmit.
454
+ * \return XUD_RES_OKAY on success, for errors see `Status Reporting`.
455
+ */
456
+ static inline XUD_Result_t XUD_SetReady_In(XUD_ep ep, unsigned char buffer[], int len)
457
+ {
458
+ unsigned addr;
459
+
460
+ asm volatile("mov %0, %1":"=r"(addr):"r"(buffer));
461
+
462
+ return XUD_SetReady_InPtr(ep, addr, len);
463
+ }
464
+
465
+ /**
466
+ * \brief Select handler function for receiving OUT endpoint data in a select.
467
+ * \param c The chanend related to the endpoint
468
+ * \param ep The OUT endpoint identifier (created by ``XUD_InitEp``).
469
+ * \param length Passed by reference. The number of bytes written to the buffer (that was passed into
470
+ * XUD_SetReady_Out())
471
+ * \param result XUD_Result_t passed by reference. XUD_RES_OKAY on success, for errors see `Status Reporting`.
472
+ */
473
+ #ifdef __XC__
474
+ #pragma select handler
475
+ #endif
476
+ void XUD_GetData_Select(chanend c, XUD_ep ep, REFERENCE_PARAM(unsigned, length), REFERENCE_PARAM(XUD_Result_t, result));
477
+
478
+
479
+ /**
480
+ * \brief Select handler function for transmitting IN endpoint data in a select.
481
+ * \param c The chanend related to the endpoint
482
+ * \param ep The IN endpoint identifier (created by ``XUD_InitEp``).
483
+ * \param result Passed by reference. XUD_RES_OKAY on success, for errors see `Status Reporting`.
484
+ */
485
+ #ifdef __XC__
486
+ #pragma select handler
487
+ #endif
488
+ void XUD_SetData_Select(chanend c, XUD_ep ep, REFERENCE_PARAM(XUD_Result_t, result));
489
+
490
+ /* Control token defines - used to inform EPs of bus-state types */
491
+ #define USB_RESET_TOKEN 8 /* Control token value that signals RESET */
492
+
493
+ #ifndef XUD_OSC_MHZ
494
+ #define XUD_OSC_MHZ (24)
495
+ #endif
496
+
497
+ /* TODO pack this to save mem
498
+ * TODO size of this hardcoded in ResetEpStateByAddr_
499
+ */
500
+ typedef struct XUD_ep_info
501
+ {
502
+ unsigned int array_ptr; // 0
503
+ unsigned int xud_chanend; // 1
504
+ unsigned int client_chanend; // 2
505
+ unsigned int buffer; // 3 Pointer to buffer
506
+ unsigned int pid; // 4 Expected out PID
507
+ unsigned int epType; // 5 Data
508
+ unsigned int actualPid; // 6 Actual OUT PID received for OUT, Length (words) for IN.
509
+ unsigned int tailLength; // 7 "tail" length for IN (bytes)
510
+ unsigned int epAddress; // 8 EP address assigned by XUD (Used for marking stall etc)
511
+ unsigned int resetting; // 9 Flag to indicate to EP a bus-reset occured.
512
+ unsigned int halted; // 10 NAK or STALL
513
+ unsigned int saved_array_ptr; // 11
514
+ unsigned int array_ptr_setup; // 12
515
+ } XUD_ep_info;
516
+
517
+ #endif
518
+ #endif // _XUD_H_
@@ -0,0 +1,11 @@
1
+ // Copyright 2017-2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+
4
+ #ifndef __XUD_CONF_DEFAULT_H__
5
+ #define __XUD_CONF_DEFAULT_H__
6
+
7
+ #ifdef __xud_conf_h_exists__
8
+ #include "xud_conf.h"
9
+ #endif
10
+
11
+ #endif
@@ -0,0 +1,87 @@
1
+ // Copyright 2015-2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+ /*
4
+ * @brief USB Device helper functions
5
+ */
6
+
7
+ #ifndef _USB_DEVICE_H_
8
+ #define _USB_DEVICE_H_
9
+
10
+ #include <xccompat.h>
11
+
12
+ /* Low level XUD API for USB Device */
13
+ #include "xud.h"
14
+
15
+ /* Generic USB defines */
16
+ #include "XUD_USB_Defines.h"
17
+
18
+ /* Generic USB descriptor defines */
19
+ #include "xud_std_descriptors.h"
20
+
21
+ /* Generic USB descriptor defines */
22
+ #include "xud_std_requests.h"
23
+
24
+ /**
25
+ * \brief This function deals with common requests This includes Standard Device Requests listed
26
+ * in table 9-3 of the USB 2.0 Spec all devices must respond to these requests, in some
27
+ * cases a bare minimum implementation is provided and should be extended in the devices EP0 code
28
+ * It handles the following standard requests appropriately using values passed to it:
29
+ *
30
+ * Get Device Descriptor (using devDesc_hs/devDesc_fs arguments)
31
+ *
32
+ * Get Configuration Descriptor (using cfgDesc_hs/cfgDesc_fs arguments)
33
+ *
34
+ * String requests (using strDesc argument)
35
+ *
36
+ * Get Device_Qualifier Descriptor
37
+ *
38
+ * Get Other-Speed Configuration Descriptor
39
+ *
40
+ * Set/Clear Feature (Endpoint Halt)
41
+ *
42
+ * Get/Set Interface
43
+ *
44
+ * Set Configuration
45
+ *
46
+ * If the request is not recognised the endpoint is marked STALLED
47
+ *
48
+ *
49
+ * \param ep_out Endpoint from XUD (ep 0)
50
+ * \param ep_in Endpoint from XUD (ep 0)
51
+ * \param devDesc_hs The Device descriptor to use, encoded according to the USB standard
52
+ * \param devDescLength_hs Length of device descriptor in bytes
53
+ * \param cfgDesc_hs Configuration descriptor
54
+ * \param cfgDescLength_hs Length of config descriptor in bytes
55
+ * \param devDesc_fs The Device descriptor to use, encoded according to the USB standard
56
+ * \param devDescLength_fs Length of device descriptor in bytes. If 0 the HS device descriptor is used.
57
+ * \param cfgDesc_fs Configuration descriptor
58
+ * \param cfgDescLength_fs Length of config descriptor in bytes. If 0 the HS config descriptor is used.
59
+ * \param strDescs
60
+ * \param strDescsLength
61
+ * \param sp ``USB_SetupPacket_t`` (passed by ref) in which the setup data is returned
62
+ * \param usbBusSpeed The current bus speed (XUD_SPEED_HS or XUD_SPEED_FS)
63
+ *
64
+ * \return Returns XUD_RES_OKAY on success.
65
+ */
66
+
67
+ XUD_Result_t USB_StandardRequests(XUD_ep ep_out, XUD_ep ep_in,
68
+ NULLABLE_ARRAY_OF(unsigned char, devDesc_hs), int devDescLength_hs,
69
+ NULLABLE_ARRAY_OF(unsigned char, cfgDesc_hs), int cfgDescLength_hs,
70
+ NULLABLE_ARRAY_OF(unsigned char, devDesc_fs), int devDescLength_fs,
71
+ NULLABLE_ARRAY_OF(unsigned char, cfgDesc_fs), int cfgDescLength_fs,
72
+ #ifdef __XC__
73
+ char * unsafe strDescs[],
74
+ #else
75
+ char * strDescs[],
76
+ #endif
77
+ int strDescsLength, REFERENCE_PARAM(USB_SetupPacket_t, sp), XUD_BusSpeed_t usbBusSpeed);
78
+ /**
79
+ * \brief Receives a Setup data packet and parses it into the passed USB_SetupPacket_t structure.
80
+ * \param ep_out OUT endpint from XUD
81
+ * \param ep_in IN endpoint to XUD
82
+ * \param sp SetupPacket structure to be filled in (passed by ref)
83
+ * \return Returns XUD_RES_OKAY on success, XUD_RES_RST on bus reset
84
+ */
85
+ XUD_Result_t USB_GetSetupPacket(XUD_ep ep_out, XUD_ep ep_in, REFERENCE_PARAM(USB_SetupPacket_t, sp));
86
+
87
+ #endif