Skip to content
dekienginePublic

About

GPIO for the Deki Engine: drive, read and count pin edges; a boot step that drives a pin

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Deki GPIO

Digital pins for the Deki Engine: drive a pin, read a pin, and count a pin's edges by interrupt. The last is for devices that pulse - a trackball, a rotary encoder - which a game polling once a frame would otherwise miss steps from.

This package is the interface. The platform package supplies the pins: deki-esp32-integration for ESP-IDF. On the desktop there is no backend and DekiGPIO::GetCurrent() is null.

Part of Deki Engine.

Use

#include "DekiGPIO.h"  // from deki-gpio

if (auto* gpio = DekiGpio::DekiGPIO::GetCurrent())
{
    gpio->CountEdges(3, DekiGpio::Edge::Falling, DekiGpio::Pull::Up);
    // each frame:
    uint32_t steps = gpio->TakeEdges(3);
}

deki-input's trackball is the first user.

Boot pins

GpioPinSetup drives one pin high or low during boot, with an optional wait afterwards. Boards gate things behind a pin: the rail feeding the display, or the chip select of another device on the display's SPI bus. Add one per pin to the platform's boot scene and list it in setupComponents ahead of the step that needs it.

Install

Package Manager in the Deki Editor, or DekiEditor --packages-add deki-gpio <project>.

Dependencies

None.

Community

Questions, ideas and what you made with Deki: the Deki Discord.

License

Apache 2.0. See LICENSE.

About

GPIO for the Deki Engine: drive, read and count pin edges; a boot step that drives a pin

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages