Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO > Class Template Reference

Defines a GPIO output pin. More...

#include <Esp8266Gpio.hxx>

Static Public Member Functions

static void set_gpio ()
 Chooses GPIO on the pinmux.
 
static void set_output ()
 Sets pin to output.
 
static void set_input ()
 Sets pin to input.
 
static void set_pullup_on ()
 Turns on pullup.
 
static void set_pullup_off ()
 Turns off pullup.
 
static void set_pulldown_on ()
 Turns on pulldown (does not work).
 
static void set_pulldown_off ()
 Turns off pulldown (does not work).
 
static void set_on ()
 Sets output to HIGH.
 
static void set_off ()
 Sets output to LOW.
 
static bool get ()
 
static void set (bool value)
 Set output pin level.
 
static void toggle ()
 Toggles output pin value.
 
static bool is_output ()
 

Static Public Attributes

static constexpr const uint32_t PIN = PIN_NUM
 Number of pin (0..15).
 
static constexpr const uint32_t PIN_BIT = (1 << PIN_NUM)
 Bit in a 16-bit register that is assigned to this pin.
 
static constexpr const uint32_t PIN_MUX_REG = MUXREG
 Address of the pinmux register that belongs to this pin.
 
static constexpr const uint32_t PIN_MUX_FUNC_GPIO = FUNC_GPIO
 Number of the GPIO function in this specific pinmux register.
 

Detailed Description

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
class Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >

Defines a GPIO output pin.

Writes to this structure will change the output level of the pin. Reads will return the pin's current level.

The pin is set to output at initialization time, with the level defined by ‘SAFE_VALUE’.

Do not use this class directly. Use GPIO_PIN instead.

Definition at line 109 of file Esp8266Gpio.hxx.

Member Function Documentation

◆ get()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static bool Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::get ( )
inlinestatic
Returns
input pin level.

Definition at line 180 of file Esp8266Gpio.hxx.

◆ is_output()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static bool Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::is_output ( )
inlinestatic
Returns
true if pin is configured as an output pin.

Definition at line 205 of file Esp8266Gpio.hxx.

◆ set()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set ( bool  value)
inlinestatic

Set output pin level.

Parameters
valueis the level to set to.

Definition at line 186 of file Esp8266Gpio.hxx.

◆ set_gpio()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_gpio ( )
inlinestatic

Chooses GPIO on the pinmux.

Definition at line 122 of file Esp8266Gpio.hxx.

◆ set_input()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_input ( )
inlinestatic

Sets pin to input.

Definition at line 134 of file Esp8266Gpio.hxx.

◆ set_off()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_off ( )
inlinestatic

Sets output to LOW.

Definition at line 174 of file Esp8266Gpio.hxx.

◆ set_on()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_on ( )
inlinestatic

Sets output to HIGH.

Definition at line 168 of file Esp8266Gpio.hxx.

◆ set_output()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_output ( )
inlinestatic

Sets pin to output.

Definition at line 128 of file Esp8266Gpio.hxx.

◆ set_pulldown_off()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_pulldown_off ( )
inlinestatic

Turns off pulldown (does not work).

Definition at line 161 of file Esp8266Gpio.hxx.

◆ set_pulldown_on()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_pulldown_on ( )
inlinestatic

Turns on pulldown (does not work).

Definition at line 154 of file Esp8266Gpio.hxx.

◆ set_pullup_off()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_pullup_off ( )
inlinestatic

Turns off pullup.

Definition at line 147 of file Esp8266Gpio.hxx.

◆ set_pullup_on()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::set_pullup_on ( )
inlinestatic

Turns on pullup.

Definition at line 140 of file Esp8266Gpio.hxx.

◆ toggle()

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
static void Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::toggle ( )
inlinestatic

Toggles output pin value.

Definition at line 199 of file Esp8266Gpio.hxx.

Member Data Documentation

◆ PIN

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
constexpr const uint32_t Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::PIN = PIN_NUM
staticconstexpr

Number of pin (0..15).

Definition at line 113 of file Esp8266Gpio.hxx.

◆ PIN_BIT

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
constexpr const uint32_t Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::PIN_BIT = (1 << PIN_NUM)
staticconstexpr

Bit in a 16-bit register that is assigned to this pin.

Definition at line 115 of file Esp8266Gpio.hxx.

◆ PIN_MUX_FUNC_GPIO

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
constexpr const uint32_t Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::PIN_MUX_FUNC_GPIO = FUNC_GPIO
staticconstexpr

Number of the GPIO function in this specific pinmux register.

Definition at line 119 of file Esp8266Gpio.hxx.

◆ PIN_MUX_REG

template<int PIN_NUM, uint32_t MUXREG, uint32_t FUNC_GPIO>
constexpr const uint32_t Esp8266StaticGpio< PIN_NUM, MUXREG, FUNC_GPIO >::PIN_MUX_REG = MUXREG
staticconstexpr

Address of the pinmux register that belongs to this pin.

Definition at line 117 of file Esp8266Gpio.hxx.


The documentation for this class was generated from the following file: