View Source Circuits.GPIO.Diagnostics (circuits_gpio v2.0.0-pre.1)

Runtime diagnostics

This module provides simple diagnostics to verify GPIO controller and implementation differences. Along with the device that you're using, this is super helpful for diagnosing issues since some GPIO features aren't supposed to work on some devices.

Summary

Functions

Print a summary of the GPIO diagnostics

Run GPIO tests and return a list of the results

Return the number of times a GPIO can be toggled per second

Functions

Link to this function

report(gpio_spec1, gpio_spec2)

View Source

Print a summary of the GPIO diagnostics

Connect the pins referred to by gpio_spec1 and gpio_spec2 together. When using the cdev stub implementation, any pair of GPIOs can be used. For example, run:

Circuits.GPIO.Diagnostics.report({"gpiochip0", 0}, {"gpiochip0", 1})

This function is intended for IEx prompt usage. See run/2 for programmatic use.

Link to this function

run(gpio_spec1, gpio_spec2)

View Source

Run GPIO tests and return a list of the results

@spec speed_test(Circuits.GPIO.gpio_spec()) :: float()

Return the number of times a GPIO can be toggled per second

Disclaimer: There should be a better way than relying on the Circuits.GPIO write performance on nearly every device. Write performance shouldn't be terrible, though.