xmos-ai-tools 1.3.2.dev80__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 +74 -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 +303 -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 +150 -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 +82 -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 +47 -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/memory_parallel_transport.h +52 -0
  76. xmos_ai_tools/runtime/include/lib_tflite_micro/api/version.h +13 -0
  77. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_config.h +17 -0
  78. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_device_memory.h +62 -0
  79. xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_shared_config.h +31 -0
  80. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/conv2d_float.h +155 -0
  81. xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_common.h +19 -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 +71 -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 +64 -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 +60 -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 +652 -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.dev80.data/data/bin/xcore-opt +0 -0
  392. xmos_ai_tools-1.3.2.dev80.dist-info/METADATA +33 -0
  393. xmos_ai_tools-1.3.2.dev80.dist-info/RECORD +395 -0
  394. xmos_ai_tools-1.3.2.dev80.dist-info/WHEEL +5 -0
  395. xmos_ai_tools-1.3.2.dev80.dist-info/top_level.txt +1 -0
@@ -0,0 +1,191 @@
1
+ // Copyright 2015-2022 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+
4
+ #ifndef _USB_DESCRIPTORS_H_
5
+ #define _USB_DESCRIPTORS_H_
6
+
7
+ #if !defined (__ASSEMBLER__)
8
+ /* USB Class Codes (from usb.org) */
9
+ typedef enum
10
+ {
11
+ USB_CLASS_USE_CLASS = 0x00, /* Use class information in the interface descriptors */
12
+ USB_CLASS_AUDIO = 0x01,
13
+ USB_CLASS_COMMUNICATIONS = 0x02,
14
+ USB_CLASS_HID = 0x03,
15
+ USB_CLASS_PHYSICAL = 0x05,
16
+ USB_CLASS_IMAGE = 0x06,
17
+ USB_CLASS_PRINTER = 0x07,
18
+ USB_CLASS_MASS_STORAGE = 0x08,
19
+ USB_CLASS_HUB = 0x09,
20
+ USB_CLASS_CDC_DATA = 0x0A,
21
+ USB_CLASS_SMART_CARD = 0x0B,
22
+ USB_CLASS_RESERVED = 0x0C,
23
+ USB_CLASS_CONTENT_SECURITY = 0x0D,
24
+ USB_CLASS_VIDEO = 0x0E,
25
+ USB_CLASS_PERSONAL_HEALTHCARE = 0x0F,
26
+ USB_CLASS_AUDIO_VIDEO = 0x10,
27
+ //...
28
+ USB_CLASS_MAPPED_INDEX_END = 17,
29
+ USB_CLASS_VENDOR_SPECIFIC = 0xFF
30
+ } USB_ClassCode_t;
31
+
32
+ #endif
33
+
34
+ /* USB Standard Descriptor types (Section 9.4, table 9-5) */
35
+ enum USB_DescriptorTypes_t
36
+ {
37
+ USB_DESCTYPE_DEVICE = 0x01, /* Device descriptor */
38
+ USB_DESCTYPE_CONFIGURATION = 0x02, /* Configuration descriptor */
39
+ USB_DESCTYPE_STRING = 0x03, /* String descriptor */
40
+ USB_DESCTYPE_INTERFACE = 0x04, /* Interface descriptor */
41
+ USB_DESCTYPE_ENDPOINT = 0x05, /* Endpoint descriptor */
42
+ USB_DESCTYPE_DEVICE_QUALIFIER = 0x06, /* Device qualifier descriptor */
43
+ USB_DESCTYPE_OTHER_SPEED = 0x07,
44
+ USB_DESCTYPE_INTERFACE_POWER = 0x08, /* Interface power descriptor */
45
+ USB_DESCTYPE_OTG = 0x09,
46
+ USB_DESCTYPE_DEBUG = 0x0A,
47
+ USB_DESCTYPE_INTERFACE_ASSOCIATION = 0x0B, /* Interface association descriptor */
48
+ };
49
+
50
+ #ifdef __STDC__
51
+
52
+ /* No current support for __attribute((packed)) in XC */
53
+
54
+ /* Generic USB Descriptor Header */
55
+ typedef struct
56
+ {
57
+ unsigned char bLength; /* Size of the descriptor (bytes) */
58
+ unsigned char bDescriptorType; /* Descriptor type, either a value. See \ref USB_DescriptorTypes_t or
59
+ * a value given by the specific class */
60
+ } __attribute__((packed)) USB_Descriptor_Header_t;
61
+
62
+ /* USB Standard Device Descriptor (section 9.6.1, table 9-8) */
63
+ typedef struct
64
+ {
65
+ unsigned char bLength; /* Size of the descriptor (bytes) */
66
+ unsigned char bDescriptorType; /* Descriptor type, either a value in \ref USB_DescriptorTypes_t
67
+ * or a value given by the specific class */
68
+ unsigned short bcdUSB; /* Supported USB version */
69
+ unsigned char bDeviceClass; /* USB device class code */
70
+ unsigned char bDeviceSubClass; /* USB device subclass code */
71
+ unsigned char bDeviceProtocol; /* USB device protocol code */
72
+ unsigned char bMaxPacketSize0; /* Maximum packet size for endpoint 0 (bytes) */
73
+ unsigned short idVendor; /* Vendor ID */
74
+ unsigned short idProduct; /* Product ID */
75
+ unsigned short bcdDevice; /* Device release number in binary-coded decimal */
76
+ unsigned char iManufacturer; /* Index of string descriptor describing manufacturer */
77
+ unsigned char iProduct; /* Index of string descriptor describing product */
78
+ unsigned char iSerialNumber; /* Index of String descriptor describing the devices serial number */
79
+ unsigned char bNumConfigurations; /* Total number of configurations supported by the device */
80
+ } __attribute__((packed)) USB_Descriptor_Device_t;
81
+
82
+ /* USB Interface Association Descriptor (See IAD Engineering Change Notice) */
83
+ typedef struct
84
+ {
85
+ unsigned char bLength; /* Size of the descriptor (bytes) */
86
+ unsigned char bDescriptorType; /* Descriptor type, either a value in \ref USB_DescriptorTypes_t
87
+ or a value given by the specific class */
88
+ unsigned char bFirstInterface; /* Index of the first associated interface */
89
+ unsigned char bInterfaceCount; /* Total number of associated interfaces */
90
+ unsigned char bFunctionClass; /* Interface class ID */
91
+ unsigned char bFunctionSubClass; /* Interface subclass ID */
92
+ unsigned char bFunctionProtocol; /* Interface protocol ID */
93
+ unsigned char iFunction; /* Index of the string descriptor describing the
94
+ * interface association */
95
+ } __attribute__((packed)) USB_Descriptor_Interface_Association_t;
96
+
97
+ /* USB Standard Interface Descriptor (section 9.6.1 table 9-12) */
98
+ typedef struct
99
+ {
100
+ unsigned char bLength; /* Size of the descriptor (bytes) */
101
+ unsigned char bDescriptorType; /* Type of the descriptor, either a value in \ref USB_DescriptorTypes_t
102
+ * or a value given by the specific class */
103
+ unsigned char bInterfaceNumber; /* Index of the interface in the current config */
104
+ unsigned char bAlternateSetting; /* Alternate setting for this interface number. Multiple alternatives
105
+ * are supported per interface (with different EP configs) */
106
+ unsigned char bNumEndpoints; /* Total endpoint count in this interface */
107
+ unsigned char bInterfaceClass; /* Interface class code */
108
+
109
+ unsigned char bInterfaceSubClass; /* Interface subclass code */
110
+ unsigned char bInterfaceProtocol; /* Interface protocol code */
111
+ unsigned char iInterface; /* Index of the string descriptor in the string table */
112
+ } __attribute__((packed)) USB_Descriptor_Interface_t;
113
+
114
+ /* USB Standard Configuration Descriptor (section 9.6.1 table 9-10) */
115
+ typedef struct
116
+ {
117
+ unsigned char bLength; /* Size of the descriptor (bytes) */
118
+ unsigned char bDescriptorType; /* Type of the descriptor, either a value in \ref USB_DescriptorTypes_t or a value
119
+ * given by the specific class */
120
+ unsigned short wTotalLength; /* Size of the configuration descriptor header and all sub descriptors inside
121
+ * the configuration */
122
+ unsigned char bNumInterfaces; /* Total interface count in the configuration */
123
+ unsigned char bConfigurationValue; /* Value to use as an argument to the SetConfiguration() request to select this
124
+ * configuration */
125
+ unsigned char iConfiguration; /* Index of string descriptor describing this configuration */
126
+ unsigned char bmAttributes; /* Configuration characteristics
127
+ * D7: Reserved (set to one)
128
+ * D6: Self-powered
129
+ * D5: Remote Wakeup
130
+ * D4...0: Reserved (reset to zero)
131
+ */
132
+ unsigned char bMaxPower; /* Maximum power consumption of the USB device from the bus in this specific
133
+ * configuration when the device is fully operational. Expressed in 2 mA units
134
+ * (i.e., 50 = 100 mA) */
135
+ } __attribute__((packed)) USB_Descriptor_Configuration_Header_t;
136
+
137
+ /* USB Standard Endpoint Descriptor (section 9.6.1 table 9-13) */
138
+ typedef struct
139
+ {
140
+ unsigned char bLength; /* Size of the descriptor (bytes) */
141
+ unsigned char bDescriptorType; /* Descriptor type, either a value. See \ref USB_DescriptorTypes_t or
142
+ * a value given by the specific class */
143
+ unsigned char bEndpointAddress; /* Address of the endpoint, includes a direction mask */
144
+ unsigned char bmAttributes; /* Endpoint attributes, comprised of a mask of the endpoint type
145
+ * See EP_TYPE_ ad EP_ADDR) */
146
+ unsigned short wMaxPacketSize; /* Maximum packet size (bytes) that the endpoint can receive */
147
+ unsigned char bInterval; /* Polling interval in milliseconds for the endpoint.
148
+ * Relevant to Isochronous and Interrupt endpoints only */
149
+ } __attribute__((packed)) USB_Descriptor_Endpoint_t;
150
+
151
+ /* USB Standard Endpoint Descriptor (Section 9.6.6, table 9-13) */
152
+ enum USB_Endpoint_TransType_t
153
+ {
154
+ USB_ENDPOINT_TRANSTYPE_CTRL = 0x0,
155
+ USB_ENDPOINT_TRANSTYPE_ISO = 0x1,
156
+ USB_ENDPOINT_TRANSTYPE_BULK = 0x2,
157
+ USB_ENDPOINT_TRANSTYPE_INT = 0x3
158
+ };
159
+ #define USB_ENDPOINT_TRANSTYPE_SHIFT (0)
160
+
161
+ enum USB_Endpoint_SyncType_t
162
+ {
163
+ USB_ENDPOINT_SYNCTYPE_NONE = 0x0,
164
+ USB_ENDPOINT_SYNCTYPE_ASYNC = 0x1,
165
+ USB_ENDPOINT_SYNCTYPE_ADAPT = 0x2,
166
+ USB_ENDPOINT_SYNCTYPE_SYNC = 0x3
167
+ };
168
+ #define USB_ENDPOINT_SYNCTYPE_SHIFT (2)
169
+
170
+ enum USB_Endpoint_UsageType_t
171
+ {
172
+ USB_ENDPOINT_USAGETYPE_DATA = 0x0,
173
+ USB_ENDPOINT_USAGETYPE_FEEDBACK = 0x1,
174
+ USB_ENDPOINT_USAGETYPE_IMPLICIT = 0x2,
175
+ USB_ENDPOINT_USAGETYPE_RESERVED = 0x3
176
+ };
177
+ #define USB_ENDPOINT_USAGETYPE_SHIFT (4)
178
+
179
+
180
+
181
+ /* USB String Descriptor (Section 9.6.7 table 9-15) */
182
+ typedef struct
183
+ {
184
+ unsigned char bLength; /* Size of the descriptor (bytes) */
185
+ unsigned char bDescriptorType; /* Descriptor type, either a value in \ref USB_DescriptorTypes_t
186
+ * or a value given by the specific class */
187
+ unsigned short bString[]; /* String data, (as unicode characters) - use array of chars instead of string.
188
+ * In GCC prefix string with "L" */
189
+ } __attribute__((packed)) USB_Descriptor_String_t;
190
+ #endif
191
+ #endif
@@ -0,0 +1,120 @@
1
+ // Copyright 2015-2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+ #ifndef _USB_STD_REQUESTS_H_
4
+ #define _USB_STD_REQUESTS_H_
5
+
6
+ #include <xccompat.h>
7
+ #include "XUD_USB_Defines.h"
8
+
9
+ /* 9.3 USB Device Requests: Table 9-2 Format of Setup Data */
10
+ /* bmRequestType: */
11
+ #define USB_BM_REQTYPE_DIRECTION_H2D 0 /* Host to device */
12
+ #define USB_BM_REQTYPE_DIRECTION_D2H 1 /* Device to host */
13
+
14
+ #define USB_BM_REQTYPE_TYPE_STANDARD 0x00
15
+ #define USB_BM_REQTYPE_TYPE_CLASS 0x01
16
+ #define USB_BM_REQTYPE_TYPE_VENDOR 0x02
17
+
18
+ #define USB_BM_REQTYPE_RECIP_DEV 0x00
19
+ #define USB_BM_REQTYPE_RECIP_INTER 0x01
20
+ #define USB_BM_REQTYPE_RECIP_EP 0x02
21
+ #define USB_BM_REQTYPE_RECIP_OTHER 0x03
22
+
23
+ #define USB_BMREQ_H2D_STANDARD_DEV ((USB_BM_REQTYPE_DIRECTION_H2D << 7) | \
24
+ (USB_BM_REQTYPE_TYPE_STANDARD << 5) | \
25
+ (USB_BM_REQTYPE_RECIP_DEV))
26
+ #define USB_BMREQ_D2H_STANDARD_DEV ((USB_BM_REQTYPE_DIRECTION_D2H << 7) | \
27
+ (USB_BM_REQTYPE_TYPE_STANDARD << 5) | \
28
+ (USB_BM_REQTYPE_RECIP_DEV))
29
+ #define USB_BMREQ_H2D_STANDARD_INT ((USB_BM_REQTYPE_DIRECTION_H2D << 7) | \
30
+ (USB_BM_REQTYPE_TYPE_STANDARD << 5) | \
31
+ (USB_BM_REQTYPE_RECIP_INTER))
32
+ #define USB_BMREQ_D2H_STANDARD_INT ((USB_BM_REQTYPE_DIRECTION_D2H << 7) | \
33
+ (USB_BM_REQTYPE_TYPE_STANDARD << 5) | \
34
+ (USB_BM_REQTYPE_RECIP_INTER))
35
+ #define USB_BMREQ_H2D_STANDARD_EP ((USB_BM_REQTYPE_DIRECTION_H2D << 7) | \
36
+ (USB_BM_REQTYPE_TYPE_STANDARD << 5) | \
37
+ (USB_BM_REQTYPE_RECIP_EP))
38
+ #define USB_BMREQ_D2H_STANDARD_EP ((USB_BM_REQTYPE_DIRECTION_D2H << 7) | \
39
+ (USB_BM_REQTYPE_TYPE_STANDARD << 5) | \
40
+ (USB_BM_REQTYPE_RECIP_EP))
41
+
42
+
43
+ #define USB_BMREQ_H2D_CLASS_INT ((USB_BM_REQTYPE_DIRECTION_H2D << 7) | \
44
+ (USB_BM_REQTYPE_TYPE_CLASS << 5) | \
45
+ (USB_BM_REQTYPE_RECIP_INTER))
46
+ #define USB_BMREQ_D2H_CLASS_INT ((USB_BM_REQTYPE_DIRECTION_D2H << 7) | \
47
+ (USB_BM_REQTYPE_TYPE_CLASS << 5) | \
48
+ (USB_BM_REQTYPE_RECIP_INTER))
49
+ #define USB_BMREQ_H2D_CLASS_EP ((USB_BM_REQTYPE_DIRECTION_H2D << 7) | \
50
+ (USB_BM_REQTYPE_TYPE_CLASS << 5) | \
51
+ (USB_BM_REQTYPE_RECIP_EP))
52
+ #define USB_BMREQ_D2H_CLASS_EP ((USB_BM_REQTYPE_DIRECTION_D2H << 7) | \
53
+ (USB_BM_REQTYPE_TYPE_CLASS << 5) | \
54
+ (USB_BM_REQTYPE_RECIP_EP))
55
+
56
+ #define USB_BMREQ_H2D_VENDOR_DEV ((USB_BM_REQTYPE_DIRECTION_H2D << 7) | \
57
+ (USB_BM_REQTYPE_TYPE_VENDOR << 5) | \
58
+ (USB_BM_REQTYPE_RECIP_DEV))
59
+ #define USB_BMREQ_D2H_VENDOR_DEV ((USB_BM_REQTYPE_DIRECTION_D2H << 7) | \
60
+ (USB_BM_REQTYPE_TYPE_VENDOR << 5) | \
61
+ (USB_BM_REQTYPE_RECIP_DEV))
62
+
63
+ /* Table 9-4. Standard Request Codes */
64
+ /* bRequest */
65
+ #define USB_GET_STATUS 0x00
66
+ #define USB_CLEAR_FEATURE 0x01
67
+ #define USB_SET_FEATURE 0x03
68
+ #define USB_SET_ADDRESS 0x05
69
+ #define USB_GET_DESCRIPTOR 0x06
70
+ #define USB_SET_DESCRIPTOR 0x07
71
+ #define USB_GET_CONFIGURATION 0x08
72
+ #define USB_SET_CONFIGURATION 0x09
73
+ #define USB_GET_INTERFACE 0x0A
74
+ #define USB_SET_INTERFACE 0x0B
75
+ #define USB_SYNCH_FRAME 0x0C
76
+
77
+ /**
78
+ * \var typedef USB_BmRequestType_t
79
+ * \brief Defines the Recepient, Type and Direction of a USB request.
80
+ */
81
+ typedef struct USB_BmRequestType
82
+ {
83
+ unsigned char Recipient; // [4..0] Request directed to:
84
+ // 0b00000: Device
85
+ // 0b00001: Specific interface
86
+ // 0b00010: Specific endpoint
87
+ // 0b00011: Other element in device
88
+ unsigned char Type; // [6..5] 0b00: Standard request
89
+ // 0b01: Class specific request
90
+ // 0b10: Request by vendor specific driver
91
+ unsigned char Direction; // [7] 0 (Host->Dev)
92
+ // 1 (Dev->Host)
93
+ } USB_BmRequestType_t;
94
+
95
+ /**
96
+ * \var typedef USB_SetupPacket_t
97
+ * \brief Typedef for setup packet structure */
98
+ typedef struct USB_SetupPacket
99
+ {
100
+ USB_BmRequestType_t bmRequestType; /* (1 byte) Specifies direction of dataflow,
101
+ type of rquest and recipient */
102
+ unsigned char bRequest; /* Specifies the request */
103
+ unsigned short wValue; /* Host can use this to pass info to the
104
+ device in its own way */
105
+ unsigned short wIndex; /* Typically used to pass index/offset such
106
+ as interface or EP no */
107
+ unsigned short wLength; /* Number of data bytes in the data stage
108
+ (for Host -> Device this this is exact
109
+ count, for Dev->Host is a max. */
110
+ } USB_SetupPacket_t;
111
+
112
+ /**
113
+ * \brief Prints out passed ``USB_SetupPacket_t`` struct using debug IO
114
+ */
115
+ void USB_PrintSetupPacket(USB_SetupPacket_t sp);
116
+
117
+ void USB_ComposeSetupBuffer(USB_SetupPacket_t sp, unsigned char buffer[]);
118
+
119
+ void USB_ParseSetupPacket(unsigned char b[], REFERENCE_PARAM(USB_SetupPacket_t, p));
120
+ #endif
@@ -0,0 +1,70 @@
1
+ // Copyright 2015-2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+ /**
4
+ * @brief Defines from the Universal Serial Bus Specification Revision 2.0
5
+ **/
6
+
7
+ #ifndef _USB_DEFS_H_
8
+ #define _USB_DEFS_H_
9
+
10
+ /* Table 8-1. PID Types */
11
+ #define USB_PID_OUT 0x1 /* Tokens */
12
+ #define USB_PID_IN 0x9
13
+ #define USB_PID_SOF 0x5
14
+ #define USB_PID_SETUP 0xD
15
+ #define USB_PID_DATA0 0x3 /* Data packet PID even */
16
+ #define USB_PID_DATA1 0xB /* Data packet PID odd */
17
+ #define USB_PID_DATA2 0x7 /* Data packet PID high-speed, high bandwidth isoc transaction in a microframe */
18
+ #define USB_PID_MDATA 0xF /* Data packet PID high-speed and high bandwidth isoc transactions */
19
+ #define USB_PID_ACK 0x2 /* Receiver accepts error-free data packet */
20
+ #define USB_PID_NAK 0xA /* Receiving device cannot accept data of transmitting device cannot send data */
21
+ #define USB_PID_STALL 0xE /* Endpoint is halted or a control pipe request is not supported */
22
+ #define USB_PID_PRE 0xC
23
+ #define USB_PID_ERR 0xC
24
+ #define USB_PID_SPLIT 0x8
25
+ #define USB_PID_PING 0x4 /* Hign-speed flow control probe for bulk/control endpoint */
26
+
27
+ /* PID with error check */
28
+ #define USB_PID_NEGATE(PID) ((PID) | (((~PID) & 0xf) << 4))
29
+ #define USB_PIDn_OUT 0xe1
30
+ #define USB_PIDn_IN 0x69
31
+ #define USB_PIDn_SOF 0xa5
32
+ #define USB_PIDn_SETUP 0x2d
33
+ #define USB_PIDn_DATA0 0xc3
34
+ #define USB_PIDn_DATA1 USB_PID_NEGATE(USB_PID_DATA1)
35
+ #define USB_PIDn_DATA2 USB_PID_NEGATE(USB_PID_DATA2)
36
+ #define USB_PIDn_ACK 0xd2
37
+ #define USB_PIDn_NAK 0x5a
38
+ #define USB_PIDn_STALL 0x1e
39
+
40
+ /* Table 9-6. Standard Feature Selectors (wValue) */
41
+ #define USB_DEVICE_REMOTE_WAKEUP 0x01 /* Recipient: Device */
42
+ #define USB_ENDPOINT_HALT 0x00 /* Recipient: Endpoint */
43
+ #define USB_TEST_MODE 0x02 /* Recipient: Device */
44
+
45
+ #define USB_STANDARD_DEVICE_REQUEST 0x00
46
+ #define USB_STANDARD_INTERFACE_REQUEST 0x01
47
+ #define USB_STANDARD_ENDPOINT_REQUEST 0x02
48
+ #define USB_VENDOR_DEVICE_REQUEST 0x40
49
+ #define USB_VENDOR_ENDPOINT_REQUEST 0x42
50
+ #define USB_CLASS_INTERFACE_REQUEST 0x21
51
+ #define USB_CLASS_ENDPOINT_REQUEST 0x22
52
+
53
+ #define USB_WVAL_EP_HALT 0
54
+
55
+ // Low byte values:
56
+ //#define USB_WVALUE_GETDESC_STRING_LANGIDS 0x0
57
+ //#define USB_WVALUE_GETDESC_STRING_IPRODUCT 0x2
58
+
59
+ // Test selector defines for Test mode
60
+ #define USB_WINDEX_TEST_J (0x1<<8)
61
+ #define USB_WINDEX_TEST_K (0x2<<8)
62
+ #define USB_WINDEX_TEST_SE0_NAK (0x3<<8)
63
+ #define USB_WINDEX_TEST_PACKET (0x4<<8)
64
+ #define USB_WINDEX_TEST_FORCE_ENABLE (0x5<<8)
65
+
66
+ #define USB_MAX_NUM_EP_OUT (16)
67
+ #define USB_MAX_NUM_EP_IN (16)
68
+ #define USB_MAX_NUM_EP (32)
69
+
70
+ #endif
@@ -0,0 +1,23 @@
1
+ // Copyright 2015-2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+ /*
4
+ * @brief Defines from USB Device Class Definition for Human Interface Devices Specification
5
+ */
6
+
7
+ /* 7. Requests */
8
+
9
+ /* 7.1 Standard Requests - Class Descriptor Types - High byte of wValue
10
+ * The following defines valid types of Class descriptors */
11
+ #define HID_HID 0x2100
12
+ #define HID_REPORT 0x2200
13
+ #define HID_PHYSICAL_DESCRIPTOR 0x2300
14
+ /*0x24 - 0x2F: Reserved */
15
+
16
+ /* 7.2 Class-Specific Requests - bRequest values */
17
+ #define HID_GET_REPORT 0x01 /* Mandatory */
18
+ #define HID_GET_IDLE 0x02
19
+ #define HID_GET_PROTOCOL 0x03 /* Required only for boot devices */
20
+ /* Ox04 - 0x08 reserved */
21
+ #define HID_SET_REPORT 0x09
22
+ #define HID_SET_IDLE 0x0A
23
+ #define HID_SET_PROTOCOL 0x0B /* Required only for boot devices */
@@ -0,0 +1,30 @@
1
+ // Copyright 2017-2021 XMOS LIMITED.
2
+ // This Software is subject to the terms of the XMOS Public Licence: Version 1.
3
+
4
+ #ifndef _AUDIO10_H_
5
+ #define _AUDIO10_H_ 1
6
+ /**
7
+ * @brief Defines from the USB Audio 1.0 Specifications
8
+ * @author Ross Owen, XMOS Limited
9
+ */
10
+
11
+ /* A.9. Audio Class-Specific Request Codes */
12
+ #define UAC_B_REQ_SET_CUR 0x01
13
+ #define UAC_B_REQ_GET_CUR 0x81
14
+ #define UAC_B_REQ_SET_MIN 0x02
15
+ #define UAC_B_REQ_GET_MIN 0x82
16
+ #define UAC_B_REQ_SET_MAX 0x03
17
+ #define UAC_B_REQ_GET_MAX 0x83
18
+ #define UAC_B_REQ_SET_RES 0x04
19
+ #define UAC_B_REQ_GET_RES 0x84
20
+ #define UAC_B_REQ_SET_MEM 0x05
21
+ #define UAC_B_REQ_GET_MEM 0x85
22
+ #define UAC_B_REQ_GET_STAT 0xFF
23
+
24
+ /* A.10.5 Endpoint Control Selectors: Table A-19 */
25
+ #define EP_CONTROL_UNDEFINED 0x00
26
+ #define SAMPLING_FREQ_CONTROL 0x01
27
+ #define PITCH_CONTROL 0x02
28
+
29
+ #endif
30
+