测试平台为Raspberry Pi 4 Model B,Ubuntu 22.04
- compile tools
sudo apt install build-essential cmake
- MRAA lib
git clone https://github.com/eclipse/mraa
cd mraa
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig
# test
mraa-gpio version
# xxx on Raspberry Pi 4 Model B
- pip install
pip install numpy pybind11
- other drivers
# CAN controller driver
sudo apt install can-utils
编译生成cpp test和python依赖库(.so文件)
mkdir build
cd build
cmake .. -DBUILD_IO_TEST=OFF -DBUILD_DEVICE_TEST=ON # default
make
# test
sudo ./test/test_debugger
sudo python3 test_basic_io.py
基本IO的c++库位于include/lib_io.h,其python接口的定义位于src/py_module.cpp中。
- GPIO basic
- UART basic
- IMU
- RS485 basic
- dynamixel servo 1.0 (cpp✓py ing)
- dynamixel servo 2.0 (cpp✓)
- powerboard
- I2C basic
- ADC sensor (cpp✓)
- SSD1306 display (cpp✓)
- touch board (cpp✓)
- SPI basic
- ST7735 display (cpp✓)
- ST7789 display (cpp✓)
- ADC sensor (cpp✓)
- encoder
- nrf24l01
- CAN basic (cpp✗py✓)
- VESC
- others(集成在debugger中)(cpp✓py ing)
- rocker
- button
├── external # submodule dir
├── include
│ ├── lib_io.h # basic io lib header
├── src
│ ├── py_module.cpp # generate python module
│ ├── lib_*.cpp # basic io libs
│ ├── other cpp # specific devices libs
├── test
│ ├── basic_io
│ ├── CMakeLists.txt
│ ├── test_*.cpp # cpp test files
├── pytest
│ ├── src
├── basic_io
│ ├── test_*.py # python test files
├── CMakeLists.txt
├── config.ini # config file
└── README.md
- auto detect
- support devices
- ADC sensor(ADS1115): config register full support