设备控制
这个例子应用演示了如何通过USB和I2C使用设备控制。
构建固件
在xcore_sdk根目录下运行以下命令来构建固件:
- Windows
- Linux and Mac
cmake -G "NMake Makefiles" -B build -DCMAKE_TOOLCHAIN_FILE=xmos_cmake_toolchain/xs3a.cmake
cd build
nmake example_freertos_device_control
cmake -B build -DCMAKE_TOOLCHAIN_FILE=xmos_cmake_toolchain/xs3a.cmake
cd build
make example_freertos_device_control
运行固件
从xcore_sdk构建文件夹执行:
- Windows
- Linux and Mac
nmake run_example_freertos_device_control
make run_example_freertos_device_control
通过xgdb调试固件
从xcore_sdk构建文件夹执行:
- Windows
- Linux and Mac
nmake debug_example_freertos_device_control
make debug_example_freertos_device_control
构建host app
随着固件在自己的终端中运行,在一个新的窗口中,在xcore_sdk根文件夹中运行以下命令来构建主机应用程序:
- Windows
- Linux and Mac
cmake -G "NMake Makefiles" -B build_host
cd build_host
nmake example_freertos_device_control_host
cmake -B build_host
cd build_host
make example_freertos_device_control_host
运行host测试app
从xcore_sdk/build_host/examples/freertos/device_control/host文件夹运行:
- Windows
- Linux and Mac
example_freertos_device_control_host.exe -g test_cmd
./example_freertos_device_control_host -g test_cmd
你应该能在你的控制台看到以下输出:
Command test_cmd sent with resid 3 Bytes received are: 50462976