Skip to content

Turing-zero/Pi-IO-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tbk-IO

安装依赖

测试平台为Raspberry Pi 4 Model B,Ubuntu 22.04

  1. compile tools
sudo apt install build-essential cmake
  1. 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
  1. pip install
pip install numpy pybind11
  1. 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及设备

基本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

TODO

  • auto detect
  • support devices
    • ADC sensor(ADS1115): config register full support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published