modm API documentation
|
Classes | |
struct | modm::Gpio |
class | modm::GpioIO |
class | modm::GpioInput |
class | modm::GpioOutput |
class | modm::GpioPort |
lbuild module: modm:architecture:gpio
GPIOs are modeled as individual classes with an interface consisting out of a common set of static methods.
These classes are used to create architecture independent definitions for hardware pins which then can be used as template parameters for miscellaneous device drivers.
Example of a platform-independent blinking light:
You can use the common definitions of modm::Gpio
to express your intention for setting a pin. However, you can also use anything that casts to bool
.
Gpio::setInput()
or Gpio::setOutput()
before the first use, otherwise the GPIO state may be undefined!See the modm:platform:gpio
module for platform-specific GPIO behaviors, especially signal connections to peripherals.