Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
ArduinoGpio.hxx File Reference
#include "os/Gpio.hxx"
#include "GpioWrapper.hxx"
#include <Arduino.h>

Go to the source code of this file.

Classes

class  ArduinoStaticGpio< PIN_NUM >
 Defines a GPIO output pin. More...
 
struct  GpioOutputPin< Base, SAFE_VALUE, INVERT >
 Parametric GPIO output class. More...
 
struct  GpioOutputSafeLow< Defs >
 Defines a GPIO output pin, initialized to be an output pin with low level. More...
 
struct  GpioOutputSafeLowInvert< Defs >
 Defines a GPIO output pin, initialized to be an output pin with low level. More...
 
struct  GpioOutputSafeHigh< Defs >
 Defines a GPIO output pin, initialized to be an output pin with high level. More...
 
struct  GpioOutputSafeHighInvert< Defs >
 Defines a GPIO output pin, initialized to be an output pin with high level. More...
 
struct  GpioInputPar< Base, PUEN >
 Parametric GPIO input class. More...
 
struct  GpioInputNP< Defs >
 Defines a GPIO input pin. More...
 
struct  GpioInputPU< Defs >
 Defines a GPIO input pin with pull-up. More...
 

Macros

#define GPIO_PIN(NAME, BaseClass, NUM)    typedef BaseClass<ArduinoStaticGpio<NUM>> NAME##_Pin
 Helper macro for defining GPIO pins with Arduino.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Helper declarations for using GPIO pins via the Arduino APIs.

Author
Mike Dunston
Date
14 January 2019

Definition in file ArduinoGpio.hxx.

Macro Definition Documentation

◆ GPIO_PIN

#define GPIO_PIN (   NAME,
  BaseClass,
  NUM 
)     typedef BaseClass<ArduinoStaticGpio<NUM>> NAME##_Pin

Helper macro for defining GPIO pins with Arduino.

Parameters
NAMEis the basename of the declaration. For NAME==FOO the macro declared FOO_Pin as a structure on which the read-write functions will be available.
BaseClassis the initialization structure, such as LedPin, or GpioOutputSafeHigh or GpioOutputSafeLow.
NUMis the pin number, such as 3 (range: 0..15; GPIO16 is not supported)

Example: GPIO_PIN(FOO, GpioOutputSafeLow, 3); ... FOO_Pin::set(true);

Definition at line 269 of file ArduinoGpio.hxx.