Skip to main content

Crate gallo

Crate gallo 

Source
Expand description

Command-line interface for the Pico de Gallo USB bridge.

The gallo CLI provides direct access to I2C, SPI, UART, GPIO, PWM, ADC, and 1-Wire peripherals connected through a Pico de Gallo device. It is built with clap and supports:

  • I2C: bus scanning, read, write, and write-then-read operations
  • SPI: read, write, full-duplex transfer, and write-then-read
  • UART: read, write, flush, and baud rate configuration
  • PWM: duty cycle control, enable/disable, frequency/phase configuration
  • ADC: single-shot reads, configuration queries
  • 1-Wire: reset, read, write, strong-pullup write, ROM search
  • GPIO: read/write pins, edge event monitoring with subscribe/unsubscribe
  • Configuration: set I2C/SPI/UART bus frequencies and SPI mode
  • Device management: list connected devices, query firmware version

§Examples

$ gallo list
$ gallo version
$ gallo i2c scan
$ gallo i2c read -a 0x48 -c 2
$ gallo i2c write -a 0x50 -b 0xDE 0xAD
$ gallo spi transfer -b 0x01 0x02 0x03
$ gallo set-config --i2c-frequency 400000 --spi-frequency 1000000

§Output Formats

Read data can be displayed in three formats via the -f / --format flag:

  • hex (default): hexadecimal byte dump
  • binary: raw bytes written to stdout
  • ascii: printable characters shown, non-printable replaced with .

Structs§

Cli
Top-level CLI argument parser.

Enums§

GpioDirectionArg
GPIO pin direction for CLI argument parsing.
GpioEdgeArg
GPIO edge detection mode for CLI argument parsing.
GpioPullArg
GPIO pull resistor configuration for CLI argument parsing.
I2cFrequencyArg
I2C bus clock frequency for CLI argument parsing.
OutputFormat
Output format for data display.