GPIO Binary Output

Example Usage

// Create a binary output, *not a switch*
// Custom pinMode
App.make_gpio_output(GPIOOutputPin(33, OUTPUT_OPEN_DRAIN));

See Application::make_gpio_output() (and Application::make_gpio_switch()).

API Reference


class GPIOBinaryOutputComponent : public output::BinaryOutput, public Component

Simple binary output component for a GPIO pin.

This component allows you to control a GPIO pin as a switch.

Note that with this output component you actually have two ways of inverting the output: either through the GPIOOutputPin, or the BinaryOutput API. You can use either one of these.

This is only an output component, not a switch, if what you want is a switch, take a look at App.make_gpio_switch();

Public Functions

GPIOBinaryOutputComponent(GPIOPin *pin)

Construct the GPIO binary output.

  • pin: The output pin to use for this output, can be integer or GPIOOutputPin.

void setup()

Set pin mode.

void dump_config()
float get_setup_priority() const

Hardware setup priority.

void write_state(bool state)

Override the BinaryOutput method for writing values to HW.

Protected Attributes

GPIOPin *pin_