NetBurner 3.5.8
PDF Version

GPIO Pin Class. More...

#include <cpu_pins.h>

Public Types

enum  pin_fn_t {
  PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 , PIN_FN_3 = 3 ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_IN = 4 , PIN_FN_OUT = 8 ,
  PIN_FN_A , PIN_FN_B , PIN_FN_C , PIN_FN_D ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 ,
  PIN_FN_2 = 2 , PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 ,
  PIN_FN_6 = 8 , PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 ,
  PIN_FN_10 = 12 , PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_13 = 15 ,
  PIN_FN_14 = 16 , PIN_FN_15 = 17 , PIN_FN_16 = 18 , PIN_FN_17 = 19 ,
  PIN_FN_18 = 20 , PIN_FN_19 = 21 , PIN_FN_20 = 22 , PIN_FN_21 = 23 ,
  PIN_FN_22 = 24 , PIN_FN_23 = 25 , PIN_FN_24 = 26 , PIN_FN_25 = 27 ,
  PIN_FN_26 = 28 , PIN_FN_27 = 29 , PIN_FN_28 = 30 , PIN_FN_29 = 31 ,
  PIN_FN_30 = 32 , PIN_FN_31 = 33 , PIN_FN_32 = 34 , PIN_FN_IN = 4 ,
  PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 ,
  PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 , PIN_FN_6 = 8 ,
  PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 , PIN_FN_10 = 12 ,
  PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_UNKNOWN =0xFE , PIN_FN_ERR =0xFF
}
 Pin Function modes to configure the managed pin(s). More...
enum  pull_t
 Pin pullup and pulldown modes to configure the managed pin(s).
enum  pin_fn_t {
  PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 , PIN_FN_3 = 3 ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_IN = 4 , PIN_FN_OUT = 8 ,
  PIN_FN_A , PIN_FN_B , PIN_FN_C , PIN_FN_D ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 ,
  PIN_FN_2 = 2 , PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 ,
  PIN_FN_6 = 8 , PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 ,
  PIN_FN_10 = 12 , PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_13 = 15 ,
  PIN_FN_14 = 16 , PIN_FN_15 = 17 , PIN_FN_16 = 18 , PIN_FN_17 = 19 ,
  PIN_FN_18 = 20 , PIN_FN_19 = 21 , PIN_FN_20 = 22 , PIN_FN_21 = 23 ,
  PIN_FN_22 = 24 , PIN_FN_23 = 25 , PIN_FN_24 = 26 , PIN_FN_25 = 27 ,
  PIN_FN_26 = 28 , PIN_FN_27 = 29 , PIN_FN_28 = 30 , PIN_FN_29 = 31 ,
  PIN_FN_30 = 32 , PIN_FN_31 = 33 , PIN_FN_32 = 34 , PIN_FN_IN = 4 ,
  PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 ,
  PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 , PIN_FN_6 = 8 ,
  PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 , PIN_FN_10 = 12 ,
  PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_UNKNOWN =0xFE , PIN_FN_ERR =0xFF
}
 Pin Function modes to configure the managed pin(s). More...
enum  pin_fn_t {
  PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 , PIN_FN_3 = 3 ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_IN = 4 , PIN_FN_OUT = 8 ,
  PIN_FN_A , PIN_FN_B , PIN_FN_C , PIN_FN_D ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 ,
  PIN_FN_2 = 2 , PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 ,
  PIN_FN_6 = 8 , PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 ,
  PIN_FN_10 = 12 , PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_13 = 15 ,
  PIN_FN_14 = 16 , PIN_FN_15 = 17 , PIN_FN_16 = 18 , PIN_FN_17 = 19 ,
  PIN_FN_18 = 20 , PIN_FN_19 = 21 , PIN_FN_20 = 22 , PIN_FN_21 = 23 ,
  PIN_FN_22 = 24 , PIN_FN_23 = 25 , PIN_FN_24 = 26 , PIN_FN_25 = 27 ,
  PIN_FN_26 = 28 , PIN_FN_27 = 29 , PIN_FN_28 = 30 , PIN_FN_29 = 31 ,
  PIN_FN_30 = 32 , PIN_FN_31 = 33 , PIN_FN_32 = 34 , PIN_FN_IN = 4 ,
  PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 ,
  PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 , PIN_FN_6 = 8 ,
  PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 , PIN_FN_10 = 12 ,
  PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_UNKNOWN =0xFE , PIN_FN_ERR =0xFF
}
 Pin Function modes to configure the managed pin(s). More...
enum  pull_t
 Pin pullup and pulldown modes to configure the managed pin(s).
enum  analogAveraging_t {
  ANALOG_AVG_NONE = 0 , ANALOG_AVG_4 = 1 , ANALOG_AVG_8 = 2 , ANALOG_AVG_16 = 3 ,
  ANALOG_AVG_32 = 4
}
 ADC hardware averaging settings for analogSetAveraging(). More...
enum  pin_fn_t {
  PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 , PIN_FN_3 = 3 ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_IN = 4 , PIN_FN_OUT = 8 ,
  PIN_FN_A , PIN_FN_B , PIN_FN_C , PIN_FN_D ,
  PIN_FN_IN = 4 , PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 ,
  PIN_FN_2 = 2 , PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 ,
  PIN_FN_6 = 8 , PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 ,
  PIN_FN_10 = 12 , PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_13 = 15 ,
  PIN_FN_14 = 16 , PIN_FN_15 = 17 , PIN_FN_16 = 18 , PIN_FN_17 = 19 ,
  PIN_FN_18 = 20 , PIN_FN_19 = 21 , PIN_FN_20 = 22 , PIN_FN_21 = 23 ,
  PIN_FN_22 = 24 , PIN_FN_23 = 25 , PIN_FN_24 = 26 , PIN_FN_25 = 27 ,
  PIN_FN_26 = 28 , PIN_FN_27 = 29 , PIN_FN_28 = 30 , PIN_FN_29 = 31 ,
  PIN_FN_30 = 32 , PIN_FN_31 = 33 , PIN_FN_32 = 34 , PIN_FN_IN = 4 ,
  PIN_FN_OUT = 8 , PIN_FN_0 = 0 , PIN_FN_1 = 1 , PIN_FN_2 = 2 ,
  PIN_FN_3 = 3 , PIN_FN_4 = 6 , PIN_FN_5 = 7 , PIN_FN_6 = 8 ,
  PIN_FN_7 = 9 , PIN_FN_8 = 10 , PIN_FN_9 = 11 , PIN_FN_10 = 12 ,
  PIN_FN_11 = 13 , PIN_FN_12 = 14 , PIN_FN_UNKNOWN =0xFE , PIN_FN_ERR =0xFF
}
 Pin Function modes to configure the managed pin(s). More...

Public Member Functions

 PinIO (int j, int n)
 Construct a PinIO for a specific cpu pin.
void set (BOOL b=TRUE)
 Drive a value on the pin(s), forcing the pin to a GPIO Output.
BOOL read () const
 Read the line state of the pin(s).
void hiz ()
 Configure the pin(s) to a GPIO Input (high impedance / tristate); the driven value is unaffected.
void drive ()
 Configure the pin(s) to a GPIO Output, without modifying the driven value.
void function (int ft) const
 Set the pin function for the managed pin(s).
void setFn (int ft) const
 Set the pin function for the managed pin(s); alias of function().
int getFunction () const
 Get the pin function currently assigned to the managed pin(s).
PinIOoperator= (BOOL b)
 Assign a driven value to the pin(s), forcing the pin to a GPIO Output; equivalent to set(b).
PinIOoperator= (int i)
 Assign a driven value to the pin(s), forcing the pin to a GPIO Output; equivalent to set(i != 0).
 operator int ()
 Read the line state of the pin(s) as an int.
 operator BOOL ()
 Read the line state of the pin(s) as a BOOL.
void setFn (pin_fn_t fn) const
 Set the pin function for the managed pin(s).
int8_t getFn ()
 Get the pin function for the managed pin(s).
void function (pin_fn_t fn) const
 Set the pin function for the managed pin(s); alias of setFn().
void hiz () const
 Configure the pin(s) to a GPIO Input (high impedance); the driven value is unaffected and takes effect again if the pin is later returned to Output.
void drive () const
 Configure the pin(s) to a GPIO Output, without modifying the driven value.
bool readBack () const
 Read the pin(s) line state without changing the pin function or direction.
bool operator! () const
 Return the opposite of the driven value of the pin(s), after configuring the pin(s) as an Input.
void multidrv (bool enable) const
 Configure the multidrive/open-drain driver for the pin(s).
void setHighStrength (bool bHighDrive)
 Configure the drive strength of the output driver for the pin(s).
void PullUp (bool enable) const
 Configure the pad Pull Up resistor for the pin(s).
void PullDown (bool enable) const
 Configure the pad Pull Down resistor for the pin(s).
uint16_t analogRead () const
 Read the pin's analog value as a raw ADC count.
bool SamePin (PinIO &pt)
 Test whether another PinIO manages the same pin(s).
void setFn (pin_fn_t fn)
 Set the pin function for the managed pin(s).
void function (pin_fn_t fn)
 Set the pin function for the managed pin(s); alias of setFn().
bool SamePin (const PinIO &test)
 Test whether another PinIO manages the same pin(s).
void readyAnalog ()
 Prepare the pin for analog usage (ADC or ACMP) by setting it to Input and disabling the pad pull resistor.
constexpr uint32_t analogMaxValue ()
 The full-scale analog reading: 0xFFF (12-bit ADC).
uint32_t n ()
 Read the pin's analog value as a raw ADC count.
double v ()
 Read the pin's analog value as a voltage.
double volts ()
 Read the pin's analog value as a voltage; alias of v().
uint32_t analogRead ()
 Read the pin's analog value as a raw ADC count; alias of n().
void analogEnableSampleWait (bool bWaitForSample)
 Select whether analog reads of this pin wait for a fresh conversion.
 PinIO ()
 Construct an empty PinIO. Exists for bootstrap compatibility; not intended for general use.
constexpr PinIO (uint32_t port, uint32_t pin)
 Construct a PinIO for a specific cpu pin.
constexpr PinIO (const PinIO &rhs)
 Construct a copy of another PinIO.
void set ()
 Set the output latch for the pin(s) High.
void clr ()
 Set the output latch for the pin(s) Low.
bool tgl ()
 Toggle the driven value for the pin(s) with a single atomic write to the GPIO module's toggle register.
bool toggle ()
 Toggle the driven value for the pin(s); alias of tgl().
bool read ()
 Read the line state of the pin(s).
void setPull (pull_t pull)
 Configure the pad Pull resistor for the pin(s).
void PullUp ()
 Enable a medium impedance pad Pull Up resistor for the pin(s); equivalent to setPull(PULL_UP_MED).
void PullDown ()
 Enable a weak pad Pull Down resistor for the pin(s); equivalent to setPull(PULL_DOWN_WEAK).
pull_t getPull ()
 Get the configured pad Pull resistor setting for the pin(s).
void setSlew (uint8_t slew)
 Set the output pad slew rate.
void setSpeed (uint8_t speed)
 Set the output pad speed/bandwidth.
void setStrength (uint8_t strength)
 Set the output driver drive strength.
void setOpenDrain (bool enable)
 Enable/disable open-drain output for the pin(s).
void setHyst (bool enable)
 Enable/disable the input hysteresis (Schmitt trigger) for the pin(s).
uint8_t getSlew ()
 Get the configured slew rate.
uint8_t getSpeed ()
 Get the configured pad speed field.
uint8_t getStrength ()
 Get the configured drive strength.
bool getOpenDrain ()
 Get the open-drain enable state for the pin(s).
bool getHyst ()
 Get the input hysteresis (Schmitt trigger) state for the pin(s).
void setSchmidt (bool enable)
 Enable/disable the input hysteresis (Schmitt trigger); alias of setHyst().
bool getSchmidt ()
 Get the input hysteresis (Schmitt trigger) state; alias of getHyst().
void HystOn ()
 Enable the input hysteresis (Schmitt trigger); equivalent to setHyst(true).
void HystOff ()
 Disable the input hysteresis (Schmitt trigger); equivalent to setHyst(false).
void SchmidtOn ()
 Enable the input hysteresis (Schmitt trigger); equivalent to setHyst(true).
void SchmidtOff ()
 Disable the input hysteresis (Schmitt trigger); equivalent to setHyst(false).
void multidrv (bool enable)
 Configure the open-drain (multidrive) driver; alias of setOpenDrain().
void setFn (pin_fn_t fn, bool forceInput=true)
 Set the pin function for the managed pin(s).
pin_fn_t getFn ()
 Get the pin function for the managed pin(s).
void function (pin_fn_t fn, bool forceInput=true)
 Set the pin function for the managed pin(s); alias of setFn().
bool operator= (bool val)
 Assign a driven value to the pin(s), forcing the pin function to Output.
PinIOoperator= (const PinIO &rhs)
 Assign a driven value to the pin(s) based on the line state of another pin(s), forcing the pin function to Output.
 operator bool ()
 Read the line state of the pin(s).
bool operator! ()
 Return the opposite of the line state of the pin(s).

Static Public Member Functions

static void analogSetAveraging (PinIO::analogAveraging_t count)
 Configure ADC hardware averaging for analog reads.

Public Attributes

volatile Pio & pio
 Reference to the PIO hardware module that this PinIO will manage. Combines with the mask to manage one or more pins within the module.
uint32_t mask
 Bit mask selecting which pins in the given PIO hardware module the PinIO object will manage.

Static Public Attributes

static const pin_fn_t MAX_HW_FN
 The highest peripheral function number implemented by this processor's pads.

Friends

class PinIOPortAArray
class PinIOPortBArray
class PinIOPortCArray
class PinIOPortDArray
class PinIOPortEArray
class PinIOPortFArray
class PinIOPortGArray
class PinIOPortHArray
class PinIOPortIArray
class PinIOPortJArray
class PinIOPortKArray
class FastIO
class _PinVector
class _FastPinVector

Detailed Description

GPIO Pin Class.

Manages the pin function, pad configuration, and GPIO state of one or more pins within a single GPIO module. Assigning a peripheral function also programs the peripheral's input-select (daisy chain) register when one is required, so routing a signal to a pin is a single call.

Typical usage, with pins obtained from the platform pin arrays:

#include <pins.h>
#include <pinconstant.h>
P1[4] = 1; // Drive the pin High (forces Output)
P1[4] = 0; // Drive the pin Low
bool state = P1[5].read(); // Read the line state
P1[4].function(PINP1_4_FLEXCAN2_TX);// Route a peripheral signal to the pin
P1[4].setStrength(1); // High drive for a heavy load
P1[5].PullUp(); // Enable the pad pull-up
#define PINP1_4_FLEXCAN2_TX
P1[4].function(PINP1_4_FLEXCAN2_TX);.
Definition MODRT1171/include/pinconstant.h:29

State accesses use the GPIO module's set/clear/toggle registers, so each call is a single atomic write – no read-modify-write, and no risk of disturbing other pins in the same GPIO module.

Member Enumeration Documentation

◆ analogAveraging_t

ADC hardware averaging settings for analogSetAveraging().

When averaging is enabled, the ADC hardware samples each conversion the selected number of times and returns the average, trading conversion time for a quieter reading.

Note
Available on the SOMRT1061.
Enumerator
ANALOG_AVG_NONE 

No averaging; each reading is a single conversion.

ANALOG_AVG_4 

Average 4 samples per reading.

ANALOG_AVG_8 

Average 8 samples per reading.

ANALOG_AVG_16 

Average 16 samples per reading.

ANALOG_AVG_32 

Average 32 samples per reading.

◆ pin_fn_t [1/4]

Pin Function modes to configure the managed pin(s).

PIN_FN_0 through PIN_FN_3 select among the pin's up to four multiplexed pad functions; PIN_FN_IN and PIN_FN_OUT select GPIO input/output operation. Use the named function constants from <pinconstant.h>, which document the available functions for every module pin by name.

Enumerator
PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_A 

Peripheral A.

PIN_FN_B 

Peripheral B.

PIN_FN_C 

Peripheral C.

PIN_FN_D 

Peripheral D.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_13 

Peripheral 13.

PIN_FN_14 

Peripheral 14.

PIN_FN_15 

Peripheral 15.

PIN_FN_16 

Peripheral 16.

PIN_FN_17 

Peripheral 17.

PIN_FN_18 

Peripheral 18.

PIN_FN_19 

Peripheral 19.

PIN_FN_20 

Peripheral 20.

PIN_FN_21 

Peripheral 21.

PIN_FN_22 

Peripheral 22.

PIN_FN_23 

Peripheral 23.

PIN_FN_24 

Peripheral 24.

PIN_FN_25 

Peripheral 25.

PIN_FN_26 

Peripheral 26.

PIN_FN_27 

Peripheral 27.

PIN_FN_28 

Peripheral 28.

PIN_FN_29 

Peripheral 29.

PIN_FN_30 

Peripheral 30.

PIN_FN_31 

Peripheral 31.

PIN_FN_32 

Peripheral 32.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_UNKNOWN 

Pin function could not be determined.

PIN_FN_ERR 

Pin is not a valid I/O pin.

◆ pin_fn_t [2/4]

Pin Function modes to configure the managed pin(s).

Enumerator
PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_A 

Peripheral A.

PIN_FN_B 

Peripheral B.

PIN_FN_C 

Peripheral C.

PIN_FN_D 

Peripheral D.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_13 

Peripheral 13.

PIN_FN_14 

Peripheral 14.

PIN_FN_15 

Peripheral 15.

PIN_FN_16 

Peripheral 16.

PIN_FN_17 

Peripheral 17.

PIN_FN_18 

Peripheral 18.

PIN_FN_19 

Peripheral 19.

PIN_FN_20 

Peripheral 20.

PIN_FN_21 

Peripheral 21.

PIN_FN_22 

Peripheral 22.

PIN_FN_23 

Peripheral 23.

PIN_FN_24 

Peripheral 24.

PIN_FN_25 

Peripheral 25.

PIN_FN_26 

Peripheral 26.

PIN_FN_27 

Peripheral 27.

PIN_FN_28 

Peripheral 28.

PIN_FN_29 

Peripheral 29.

PIN_FN_30 

Peripheral 30.

PIN_FN_31 

Peripheral 31.

PIN_FN_32 

Peripheral 32.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_UNKNOWN 

Pin function could not be determined.

PIN_FN_ERR 

Pin is not a valid I/O pin.

◆ pin_fn_t [3/4]

Pin Function modes to configure the managed pin(s).

PIN_FN_IN and PIN_FN_OUT select GPIO operation. PIN_FN_0 through PIN_FN_12 select one of the processor's peripheral (alternate) functions for the pad; which peripheral each number routes to is specific to the individual pin. Rather than using the raw PIN_FN_n values, use the named constants from <pinconstant.h> (e.g. PINP1_4_FLEXCAN2_TX), which document the available functions for every module pin by name.

Enumerator
PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_A 

Peripheral A.

PIN_FN_B 

Peripheral B.

PIN_FN_C 

Peripheral C.

PIN_FN_D 

Peripheral D.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_13 

Peripheral 13.

PIN_FN_14 

Peripheral 14.

PIN_FN_15 

Peripheral 15.

PIN_FN_16 

Peripheral 16.

PIN_FN_17 

Peripheral 17.

PIN_FN_18 

Peripheral 18.

PIN_FN_19 

Peripheral 19.

PIN_FN_20 

Peripheral 20.

PIN_FN_21 

Peripheral 21.

PIN_FN_22 

Peripheral 22.

PIN_FN_23 

Peripheral 23.

PIN_FN_24 

Peripheral 24.

PIN_FN_25 

Peripheral 25.

PIN_FN_26 

Peripheral 26.

PIN_FN_27 

Peripheral 27.

PIN_FN_28 

Peripheral 28.

PIN_FN_29 

Peripheral 29.

PIN_FN_30 

Peripheral 30.

PIN_FN_31 

Peripheral 31.

PIN_FN_32 

Peripheral 32.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_UNKNOWN 

Pin function could not be determined.

PIN_FN_ERR 

Pin is not a valid I/O pin.

◆ pin_fn_t [4/4]

Pin Function modes to configure the managed pin(s).

Enumerator
PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_A 

Peripheral A.

PIN_FN_B 

Peripheral B.

PIN_FN_C 

Peripheral C.

PIN_FN_D 

Peripheral D.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_13 

Peripheral 13.

PIN_FN_14 

Peripheral 14.

PIN_FN_15 

Peripheral 15.

PIN_FN_16 

Peripheral 16.

PIN_FN_17 

Peripheral 17.

PIN_FN_18 

Peripheral 18.

PIN_FN_19 

Peripheral 19.

PIN_FN_20 

Peripheral 20.

PIN_FN_21 

Peripheral 21.

PIN_FN_22 

Peripheral 22.

PIN_FN_23 

Peripheral 23.

PIN_FN_24 

Peripheral 24.

PIN_FN_25 

Peripheral 25.

PIN_FN_26 

Peripheral 26.

PIN_FN_27 

Peripheral 27.

PIN_FN_28 

Peripheral 28.

PIN_FN_29 

Peripheral 29.

PIN_FN_30 

Peripheral 30.

PIN_FN_31 

Peripheral 31.

PIN_FN_32 

Peripheral 32.

PIN_FN_IN 

Input.

PIN_FN_OUT 

Output.

PIN_FN_0 

Peripheral 0.

PIN_FN_1 

Peripheral 1.

PIN_FN_2 

Peripheral 2.

PIN_FN_3 

Peripheral 3.

PIN_FN_4 

Peripheral 4.

PIN_FN_5 

Peripheral 5.

PIN_FN_6 

Peripheral 6.

PIN_FN_7 

Peripheral 7.

PIN_FN_8 

Peripheral 8.

PIN_FN_9 

Peripheral 9.

PIN_FN_10 

Peripheral 10.

PIN_FN_11 

Peripheral 11.

PIN_FN_12 

Peripheral 12.

PIN_FN_UNKNOWN 

Pin function could not be determined.

PIN_FN_ERR 

Pin is not a valid I/O pin.

Constructor & Destructor Documentation

◆ PinIO() [1/3]

PinIO::PinIO ( int j,
int n )
inline

Construct a PinIO for a specific cpu pin.

Parameters
jThe zero-indexed GPIO port number: Port A=0 through Port K=10.
nThe zero-indexed pin number within the requested port.

Most applications should instead use the platform Pins[] array from <pins.h> or the PortA-PortK accessor objects, which select the correct port and pin automatically.

◆ PinIO() [2/3]

PinIO::PinIO ( uint32_t port,
uint32_t pin )
inlineconstexpr

Construct a PinIO for a specific cpu pin.

Parameters
portThe numeric instance number of the desired GPIO module. One-indexed on i.MX RT platforms (GPIO1=1 through GPIO13=13); zero-indexed on the MODM7AE70 / SBE70LC (PIOA=0, PIOB=1, etc.).
pinThe zero-indexed pin number within the requested port that the new PinIO is to manage.

Example usage for processor pad 'GPIO4_IO13':

PinIO LED1(4, 13);
PinIO(int j, int n)
Construct a PinIO for a specific cpu pin.
Definition coldfire/cpu/MCF5441X/include/cpu_pins.h:115

Most applications should instead use the platform pin arrays from <pins.h>, which map module connector pin numbers to the correct GPIO port and pin automatically.

◆ PinIO() [3/3]

PinIO::PinIO ( const PinIO & rhs)
inlineconstexpr

Construct a copy of another PinIO.

Parameters
rhsThe PinIO to construct a copy of.

Member Function Documentation

◆ analogEnableSampleWait()

void PinIO::analogEnableSampleWait ( bool bWaitForSample)

Select whether analog reads of this pin wait for a fresh conversion.

Parameters
bWaitForSampletrue: every analog read waits for a new conversion to complete before returning (slower, but the value is always current). false (default): reads return the most recent result from the continuously running conversions.

◆ analogRead()

uint16_t PinIO::analogRead ( ) const

Read the pin's analog value as a raw ADC count.

Only available for pins connected to the ADC (AFEC); see the platform pin reference for which module pins have analog channels.

Returns
The conversion result as a raw ADC count.
Note
This uint16_t form is the MODM7AE70 / SBE70LC (SAME70) interface; the SOMRT1061 returns uint32_t.

◆ analogSetAveraging()

void PinIO::analogSetAveraging ( PinIO::analogAveraging_t count)
static

Configure ADC hardware averaging for analog reads.

Applies to the ADC as a whole (all analog pins).

Parameters
countThe number of samples averaged per reading, as an analogAveraging_t.

◆ clr()

void PinIO::clr ( )
inline

Set the output latch for the pin(s) Low.

Writes the GPIO module's clear register, so the update is a single atomic write that cannot disturb other pins in the module. The value takes effect on the pin whenever the pin is configured as a GPIO Output.

Note
On the MODRT1171, clr() does not change the pin function – assign with operator=() to both drive a value and force the pin to Output in one step. On the SOMRT1061, MODM7AE70/SBE70LC, and MOD5441X family, clr() also forces the pin function to GPIO Output.

◆ function() [1/4]

void PinIO::function ( int ft) const

Set the pin function for the managed pin(s).

Programs the pin's Pin Assignment Register (PAR) to route the selected pad function to the pin. Use the named function constants from <pinconstant.h> for the ft argument.

Parameters
ftThe pin function to assign, as a pin_fn_t value.
Note
This int form is the MOD5441X family interface.

◆ function() [2/4]

void PinIO::function ( pin_fn_t fn)
inline

Set the pin function for the managed pin(s); alias of setFn().

Parameters
fnThe pin function to be assigned to the managed pin(s).

◆ function() [3/4]

void PinIO::function ( pin_fn_t fn) const
inline

Set the pin function for the managed pin(s); alias of setFn().

Parameters
fnThe pin function to be assigned to the managed pin(s).

◆ function() [4/4]

void PinIO::function ( pin_fn_t fn,
bool forceInput = true )
inline

Set the pin function for the managed pin(s); alias of setFn().

Parameters
fnThe pin function to be assigned to the managed pin(s).
forceInputWhen true (default), also sets the pad's SION (Software Input On) bit so the line state remains readable (see setFn()).

◆ getFn() [1/2]

pin_fn_t PinIO::getFn ( )

Get the pin function for the managed pin(s).

Returns
The pin function as a pin_fn_t of the managed pin(s). Returns PIN_FN_ERR if the pin is not a valid I/O (ex: GND, VCC).

◆ getFn() [2/2]

int8_t PinIO::getFn ( )
inline

Get the pin function for the managed pin(s).

Returns
The pin function as a pin_fn_t of the managed pin(s). Returns -1 if the pin is not an I/O (ex: GND, VCC).

◆ getFunction()

int PinIO::getFunction ( ) const

Get the pin function currently assigned to the managed pin(s).

Returns
The pin function as a pin_fn_t value.

◆ getHyst()

bool PinIO::getHyst ( )

Get the input hysteresis (Schmitt trigger) state for the pin(s).

Returns
The hysteresis state on platforms with a hysteresis control. Returns false on the MODRT1171 (see setHyst()).

◆ getOpenDrain()

bool PinIO::getOpenDrain ( )

Get the open-drain enable state for the pin(s).

Returns
true = open-drain, false = push-pull.

◆ getPull()

pull_t PinIO::getPull ( )

Get the configured pad Pull resistor setting for the pin(s).

Returns
The pull configuration currently programmed in the pad control register, as a pull_t.

◆ getSlew()

uint8_t PinIO::getSlew ( )

Get the configured slew rate.

Returns
0 = slow, 1 = fast. Returns 0 on pads without slew control.

◆ getSpeed()

uint8_t PinIO::getSpeed ( )

Get the configured pad speed field.

Returns
On the SOMRT1061: 0 = 50MHz, 1/2 = 100MHz, 3 = 200MHz. Returns 0 on the MODRT1171 (no speed field).

◆ getStrength()

uint8_t PinIO::getStrength ( )

Get the configured drive strength.

Returns
On the MODRT1171: 0 = standard drive, 1 = high drive. On the SOMRT1061: the DSE field value 0..7 (see setStrength()).

◆ multidrv()

void PinIO::multidrv ( bool enable) const
inline

Configure the multidrive/open-drain driver for the pin(s).

In multidrive (open-drain) mode the pad only drives Low; a High is produced by an external (or pad) pull-up. This allows multiple devices to safely share one line, as used by I2C-style buses and wired-AND signals.

Parameters
enableTrue: configure the output driver as Open Drain. False: configure the output driver as Push-Pull.

◆ n()

uint32_t PinIO::n ( )

Read the pin's analog value as a raw ADC count.

The first analog read of a pin automatically enables its ADC channel and configures continuous hardware conversions; that first call waits for a fresh conversion, and subsequent calls return the most recent hardware result immediately (see analogEnableSampleWait() to instead wait for a fresh sample on every read).

Returns
The conversion result, 0 to analogMaxValue(). On a pin without an ADC channel, returns the digital line state scaled to full scale (0 or analogMaxValue()).

◆ operator bool()

PinIO::operator bool ( )
inline

Read the line state of the pin(s).

Returns
The line state of the pin(s): true = High, false = Low
Note
On the SOMRT1061 and MODM7AE70/SBE70LC, this also sets the pin function to GPIO Input (see read()).

◆ operator!() [1/2]

bool PinIO::operator! ( )
inline

Return the opposite of the line state of the pin(s).

Returns
The opposite of the line state of the pin(s).
Note
On the SOMRT1061 and MODM7AE70/SBE70LC, this also sets the pin function to GPIO Input (see read()).

◆ operator!() [2/2]

bool PinIO::operator! ( ) const
inline

Return the opposite of the driven value of the pin(s), after configuring the pin(s) as an Input.

Returns
The opposite of the driven value of the pin(s).
Note
MODM7AE70 / SBE70LC (SAME70) behavior; on i.MX RT platforms operator!() returns the opposite of the line state.

◆ operator=() [1/2]

bool PinIO::operator= ( bool val)
inline

Assign a driven value to the pin(s), forcing the pin function to Output.

Parameters
valThe value to be driven on the pin(s): true = High, false = Low
Returns
The driven value for the pin(s).

◆ operator=() [2/2]

PinIO & PinIO::operator= ( const PinIO & rhs)
inline

Assign a driven value to the pin(s) based on the line state of another pin(s), forcing the pin function to Output.

Parameters
rhsThe pin(s) whose line state will be assigned to this pin.
Returns
A copy of the PinIO being assigned to.

◆ PullDown()

void PinIO::PullDown ( bool enable) const
inline

Configure the pad Pull Down resistor for the pin(s).

Parameters
enableTrue: enable the pad Pull Down. False: disable the pad Pull Down.
Note
Available on MODM7AE70 / SBE70LC (SAME70) only.

◆ PullUp()

void PinIO::PullUp ( bool enable) const
inline

Configure the pad Pull Up resistor for the pin(s).

Parameters
enableTrue: enable the pad Pull Up. False: disable the pad Pull Up.
Note
Available on MODM7AE70 / SBE70LC (SAME70) only.

◆ read() [1/2]

bool PinIO::read ( )
inline

Read the line state of the pin(s).

Samples the pad through the GPIO module's pad status register, which reflects the actual voltage on the pin – including when the pin is driven as an output or assigned to a peripheral.

Returns
The line state of the pin(s): true = High, false = Low
Note
On the MODRT1171, the pin function is left unchanged; the pad's input path must be enabled for the status register to track the pin, which setFn() does by default (see the forceInput parameter). On the SOMRT1061 and MODM7AE70/SBE70LC, read() first sets the pin function to GPIO Input.

◆ read() [2/2]

BOOL PinIO::read ( ) const

Read the line state of the pin(s).

Returns
The line state of the pin(s): non-zero = High, 0 = Low.
Note
On the MOD5441X family, this configures the pin as a GPIO Input first. On i.MX RT platforms, the pad is sampled without changing the pin function.

◆ readBack()

bool PinIO::readBack ( ) const
inline

Read the pin(s) line state without changing the pin function or direction.

Samples the PIO pin data status register, which reflects the actual voltage on the pin – including when the pin is driven as an output or assigned to a peripheral. Use this instead of read() when the pin must stay in its current mode.

Returns
The line state of the pin(s): true = High, false = Low
Note
Available on MODM7AE70 / SBE70LC (SAME70) only; on i.MX RT platforms read() already samples without changing the pin mode.

◆ readyAnalog()

void PinIO::readyAnalog ( )

Prepare the pin for analog usage (ADC or ACMP) by setting it to Input and disabling the pad pull resistor.

Note
Analog input is available on the SOMRT1061 for pins with ADC channels.

◆ SamePin() [1/2]

bool PinIO::SamePin ( const PinIO & test)
inline

Test whether another PinIO manages the same pin(s).

Returns
true if test refers to the same GPIO module and pin mask.

◆ SamePin() [2/2]

bool PinIO::SamePin ( PinIO & pt)
inline

Test whether another PinIO manages the same pin(s).

Returns
true if pt refers to the same PIO module and pin mask.

◆ set() [1/2]

void PinIO::set ( )
inline

Set the output latch for the pin(s) High.

Writes the GPIO module's set register, so the update is a single atomic write that cannot disturb other pins in the module. The value takes effect on the pin whenever the pin is configured as a GPIO Output.

Note
On the MODRT1171, set() does not change the pin function – assign with operator=() to both drive a value and force the pin to Output in one step. On the SOMRT1061 and MODM7AE70/SBE70LC, set() also forces the pin function to GPIO Output.

◆ set() [2/2]

void PinIO::set ( BOOL b = TRUE)

Drive a value on the pin(s), forcing the pin to a GPIO Output.

Parameters
bThe value to drive: TRUE (default) = High, FALSE = Low.
Note
MOD5441X family interface. When the pin is in (emulated) open-drain mode, a High releases the pin to a high-impedance input instead of driving it.

◆ setFn() [1/4]

void PinIO::setFn ( int ft) const
inline

Set the pin function for the managed pin(s); alias of function().

Parameters
ftThe pin function to assign, as a pin_fn_t value.

◆ setFn() [2/4]

void PinIO::setFn ( pin_fn_t fn)

Set the pin function for the managed pin(s).

Programs the pin's IOMUXC mux register to route the requested signal to the pad, and programs the peripheral's input-select (daisy chain) register automatically when one is required. The pad's SION (Software Input On) bit is always enabled, so read() reflects the actual line state regardless of the assigned function. Use the named function constants from <pinconstant.h> for the fn argument.

Parameters
fnThe pin function to be assigned to the managed pin(s).
Note
This one-argument form is the SOMRT1061 interface; the MODRT1171 adds a forceInput parameter.

◆ setFn() [3/4]

void PinIO::setFn ( pin_fn_t fn) const

Set the pin function for the managed pin(s).

For PIN_FN_IN / PIN_FN_OUT, hands the pin to the PIO controller as a GPIO and sets its direction. For PIN_FN_A through PIN_FN_D, programs the PIO ABCDSR peripheral-select registers and hands the pin to the selected peripheral. Use the named function constants from <pinconstant.h> for the fn argument.

Parameters
fnThe pin function to be assigned to the managed pin(s).
Note
This is the MODM7AE70 / SBE70LC (SAME70) interface; peripheral functions are lettered A-D on this processor.

◆ setFn() [4/4]

void PinIO::setFn ( pin_fn_t fn,
bool forceInput = true )

Set the pin function for the managed pin(s).

Programs the pin's IOMUXC mux register to route the requested signal to the pad. When a peripheral function requires it, the peripheral's input-select (daisy chain) register is programmed automatically as well, so selecting a function is a single call. Use the named function constants from <pinconstant.h> for the fn argument.

Parameters
fnThe pin function to be assigned to the managed pin(s).
forceInputWhen true (default), also sets the pad's SION (Software Input On) bit, which keeps the input path enabled so read() reflects the actual line state regardless of the assigned function. Pass false to leave the input path under the control of the selected function alone.

◆ setHighStrength()

void PinIO::setHighStrength ( bool bHighDrive)
inline

Configure the drive strength of the output driver for the pin(s).

Use High Drive for heavy loads or fast edges into long traces; use Low Drive to reduce overshoot and EMI on light loads.

Parameters
bHighDriveTrue: configure the output driver for High Drive strength. False: configure the output driver for Low Drive strength.
Note
Available on MODM7AE70 / SBE70LC (SAME70) only; on i.MX RT platforms use setStrength().

◆ setHyst()

void PinIO::setHyst ( bool enable)

Enable/disable the input hysteresis (Schmitt trigger) for the pin(s).

Hysteresis separates the rising and falling input thresholds so slow or noisy edges produce one clean transition instead of chatter.

Note
Configurable on the SOMRT1061 (i.MX RT1060). The MODRT1171 (i.MX RT1171) and MOD5441X pads do not expose a hysteresis control, so this call has no effect there; it is provided for source compatibility.

◆ setOpenDrain()

void PinIO::setOpenDrain ( bool enable)

Enable/disable open-drain output for the pin(s).

In open-drain mode the pad only drives Low; a High is produced by an external (or pad) pull-up. This allows multiple devices to safely share one line, as used by I2C-style buses and wired-AND signals.

Parameters
enabletrue = open-drain, false = push-pull (drives both levels).
Note
On the MOD5441X family, open-drain is emulated using the pin direction: Low is actively driven, and High releases the pin to a high-impedance input (an external pull-up is required).

◆ setPull()

void PinIO::setPull ( pull_t pull)

Configure the pad Pull resistor for the pin(s).

The pad's internal pull keeps an undriven line at a defined level – use a pull-up for idle-high signals (buttons to ground, open-drain buses) and a pull-down for idle-low signals.

Parameters
pullThe pull direction and strength for the given pin.
Note
Available pull strengths vary by platform. The MODRT1171, MODM7AE70/SBE70LC, and MOD5441X pads provide one pull strength per direction, so PULL_UP_WEAK, PULL_UP_MED, and PULL_UP_STRONG all select the same pull-up; the distinct values exist for source compatibility across platforms. The SOMRT1061 pad provides three pull-up strengths (47K, 100K, 22K). PULL_KEEP is ignored on the MOD5441X family.

◆ setSlew()

void PinIO::setSlew ( uint8_t slew)

Set the output pad slew rate.

The slew rate controls how quickly the output driver switches between levels. Slow slew produces gentler edges with less overshoot, ringing, and EMI; fast slew is for signals whose timing requires sharp edges. Start slow and only go fast if edge timing demands it.

Parameters
slew0 = slow (lower EMI), 1 = fast.
Note
Slew rate control is available on the pads that implement a slew field; on MODRT1171 pads without one the call has no effect.

◆ setSpeed()

void PinIO::setSpeed ( uint8_t speed)

Set the output pad speed/bandwidth.

On pads that implement a speed field, this tunes the output driver's bandwidth to the range of signal frequencies the pin will carry – a signal-integrity setting, not the signal frequency itself.

Parameters
speedOn the SOMRT1061: 0 = 50MHz, 1/2 = 100MHz, 3 = 200MHz.
Note
Effective on the SOMRT1061 (i.MX RT1060). The MODRT1171 (i.MX RT1171) and MOD5441X pads have no speed field, so this call has no effect there; it is provided for source compatibility.

◆ setStrength()

void PinIO::setStrength ( uint8_t strength)

Set the output driver drive strength.

Drive strength sets the output driver's impedance – how much current the pad can source/sink and how hard it drives the line. Use higher drive for heavy loads or fast edges into long traces; use lower drive to reduce overshoot and EMI on light loads.

Parameters
strengthPlatform-specific scale:
  • MODRT1171 (i.MX RT1171): two levels – 0 = standard drive, any non-zero value = high drive. (The underlying pad-control bit polarity differs between the RT1171's pad domains; this call handles that automatically.)
  • SOMRT1061 (i.MX RT1060): 0 = output driver disabled, then 1 = R0 (150 ohm) through 7 = R0/7 (~21 ohm, strongest).
Note
No effect on the MOD5441X family (fixed drive strength).

◆ tgl()

bool PinIO::tgl ( )
inline

Toggle the driven value for the pin(s) with a single atomic write to the GPIO module's toggle register.

Returns
The new driven value for the pin(s).
Note
On the SOMRT1061 and MODM7AE70/SBE70LC, tgl() also forces the pin function to GPIO Output; on the MODRT1171 the pin function is left unchanged. On the MODM7AE70/SBE70LC, tgl() returns the previously driven value rather than the new one.

◆ toggle()

bool PinIO::toggle ( )
inline

Toggle the driven value for the pin(s); alias of tgl().

Returns
The new driven value for the pin(s).

◆ v()

double PinIO::v ( )
inline

Read the pin's analog value as a voltage.

Returns
The analog reading converted to volts using the analog reference voltage.

Member Data Documentation

◆ mask

uint32_t PinIO::mask

Bit mask selecting which pins in the given PIO hardware module the PinIO object will manage.

Bit mask setting which pins in the given GPIO hardware module the PinIO object will manage.


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