cmd

package
v0.0.0-...-9a6eaac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2020 License: Apache-2.0, MIT, Apache-2.0 Imports: 0 Imported by: 0

README

periph/cmd - read-to-use executables

This directory contains directly usable tools installable via:

go get periph.io/x/periph/cmd/...

Most of the tools can optionally leverage drivers in hostextra when the build tag periphextra is defined:

go get -u -tags periphextra periph.io/x/periph/cmd/...

This permits taking advantage of drivers like FTDI's D2XX.

Push

If you prefer to build on your workstation and push the binaries to the micro computer, install push from periph.io/x/bootstrap to cross compile and efficiently push via rsync:

go get -u periph.io/x/bootstrap/cmd/push
push -host pi@raspberrypi periph.io/x/periph/cmd/...

Try first periph-info. It will print out if any driver failed to run, for example if you have to run as root to access certain drivers.

Then run headers-list to list all the headers on your board and confirm that you get the expected output. If your board is missing, you can contribute it.

Devices

  • apa102: Writes to a LED strip of APA-102 (sometimes called Dotstar). Can show an image animating on the Y axis.
  • bmxx80: Reads the temperature, pressure and humidity off a bmp180/bme280/bmp280. Humidity sensing is only supported on bme280.
  • cap1xxx: Reads the capacitive sensor family.
  • ir: Reads codes (button presses) on an InfraRed remote sensor.
  • led: Reads the state of on-board LEDs.
  • ssd1306: Writes text, an image or an animated GIF to an OLED display.
  • tm1637: Writes to a segment digits display.

Buses

  • gpio-list: Looking for the GPIO pins per functionality? Prints the state of each GPIO pin.
  • gpio-read: Read the input value of a GPIO pin and change input resistor.
  • gpio-write: Change the output value of a GPIO pin.
  • headers-list: Pinrts the location of the pin on the header to connect your GPIO. This is the perfect tool to know where to connect the wires.
  • i2c-io: Reads and/or writes to an I²C device.
  • i2c-list: Lists which I²C buses are enabled and where the pins are.
  • spi-io: Reads and/or writes to an SPI device.
  • spi-list: Lists which SPI ports are enabled and where the pins are.

Other

  • periph-info: Lists which periph drivers loaded and which failed.
  • periph-smoketest: Runs one of the smoke test for the drivers. The smoke test differs from unit tests as they require real hardware to confirm that the driver being tested works.

Troubleshooting

Having trouble getting the tools to run? File an issue or better visit the Slack channel. You can get an invite here.

Documentation

Overview

Package cmd contains tools.

Visit https://github.com/google/periph/blob/master/cmd/README.md for more information about how to use the tools provided.

Directories

Path Synopsis
apa102 writes to a strip of APA102 LED.
apa102 writes to a strip of APA102 LED.
bmxx80 reads environmental data from a BMP180/BME280/BMP280.
bmxx80 reads environmental data from a BMP180/BME280/BMP280.
cap1xxx sense touches.
cap1xxx sense touches.
gpio-list prints out the function of each GPIO pin.
gpio-list prints out the function of each GPIO pin.
gpio-read reads a GPIO pin.
gpio-read reads a GPIO pin.
gpio-write sets a GPIO pin to low or high.
gpio-write sets a GPIO pin to low or high.
headers-list prints out the headers as found on the computer and print the functionality of each pin.
headers-list prints out the headers as found on the computer and print the functionality of each pin.
i2c-io communicates to an I²C device.
i2c-io communicates to an I²C device.
i2c-list lists all I²C buses.
i2c-list lists all I²C buses.
ir reads from an IR receiver via LIRC.
ir reads from an IR receiver via LIRC.
led reads the state of a LED or change it.
led reads the state of a LED or change it.
lepton captures a single image, prints metadata about the camera state or triggers a calibration.
lepton captures a single image, prints metadata about the camera state or triggers a calibration.
onewire-list lists all onewire buses and devices.
onewire-list lists all onewire buses and devices.
periph-info prints out information about the loaded periph drivers.
periph-info prints out information about the loaded periph drivers.
periph-smoketest runs all known smoke tests.
periph-smoketest runs all known smoke tests.
gpiosmoketest
Package gpiosmoketest is leveraged by periph-smoketest to verify that basic GPIO pin functionality work.
Package gpiosmoketest is leveraged by periph-smoketest to verify that basic GPIO pin functionality work.
i2csmoketest
Package i2csmoketest is leveraged by periph-smoketest to verify that an I²C EEPROM device and a DS2483 device can be accessed on an I²C bus.
Package i2csmoketest is leveraged by periph-smoketest to verify that an I²C EEPROM device and a DS2483 device can be accessed on an I²C bus.
onewiresmoketest
Package onewiresmoketest is leveraged by periph-smoketest to verify that a 1-wire bus search returns two devices, that a ds18b20 temperature sensor can be read, and that a ds2431 eeprom can be written and read.
Package onewiresmoketest is leveraged by periph-smoketest to verify that a 1-wire bus search returns two devices, that a ds18b20 temperature sensor can be read, and that a ds2431 eeprom can be written and read.
spismoketest
Package spismoketest is leveraged by periph-smoketest to verify that an EEPROM device can be accessed on a SPI port.
Package spismoketest is leveraged by periph-smoketest to verify that an EEPROM device can be accessed on a SPI port.
spi-io writes to an SPI port data from stdin and outputs to stdout or writes arguments and outputs hex encoded output.
spi-io writes to an SPI port data from stdin and outputs to stdout or writes arguments and outputs hex encoded output.
spi-list lists all SPI ports.
spi-list lists all SPI ports.
ssd1306 writes to a display driven by a ssd1306 controler.
ssd1306 writes to a display driven by a ssd1306 controler.
thermal reads the state of thermal sensors exposed via sysfs.
thermal reads the state of thermal sensors exposed via sysfs.
tm1637 writes to a digits LED display.
tm1637 writes to a digits LED display.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL