How cpb-/spi-tools works
Project type and purpose
• This is an open‑source, command‑line toolset (written in C) for configuring and communicating with Linux SPI devices via the spidev interface.
• It provides two main user‑facing binaries—spi-config (to query/set mode, speed, bits, etc.) and spi-pipe (to send/receive raw SPI data streams).
File structure
• Top level contains:
• Build scripts/configs (Autotools: configure.ac, Makefile.am; CMake: CMakeLists.txt, Android.bp)
• License (LICENSE), version control ignore (.gitignore), README and man‐page directory (man/).
• The src/ directory holds:
• Three C sources (spi-config.c, spi-pipe.c, spi-tools.c) and one header (spi-tools.h).
• A CMake helper (config.h.cmake.in) and its own Makefile.am.
• man/ holds the installation targets for the man pages.
README for additional insights
• Confirms the two binaries and their command‑line options.
• Describes dual build workflows (Autotools vs CMake), cross‑compilation support, and usage patterns (e.g., piping data through spi-pipe).
Final recommendations
• Every layer—from build to hardware—and show how source files map to binaries.
• Code modules (e.g., “spi-tools.c: common ioctl routines”).