Skip to main content
欢迎来到PAWPAW技术文档网站,了解更多信息。

设备控制

这个例子应用演示了如何通过USB和I2C使用设备控制。

构建固件​

在xcore_sdk根目录下运行以下命令来构建固件:

cmake -G "NMake Makefiles" -B build -DCMAKE_TOOLCHAIN_FILE=xmos_cmake_toolchain/xs3a.cmake
cd build
nmake example_freertos_device_control

运行固件​

从xcore_sdk构建文件夹执行:

nmake run_example_freertos_device_control

通过xgdb调试固件​

从xcore_sdk构建文件夹执行:

nmake debug_example_freertos_device_control

构建host app​

随着固件在自己的终端中运行,在一个新的窗口中,在xcore_sdk根文件夹中运行以下命令来构建主机应用程序:

cmake -G "NMake Makefiles" -B build_host
cd build_host
nmake example_freertos_device_control_host

运行host测试app​

从xcore_sdk/build_host/examples/freertos/device_control/host文件夹运行:

example_freertos_device_control_host.exe -g test_cmd

你应该能在你的控制台看到以下输出:

Command test_cmd sent with resid 3 Bytes received are: 50462976