Treehopper C# API
PortExpanderPin Class Reference

Construct a new Port Expander pin More...

Inheritance diagram for PortExpanderPin:
IPortExpanderPin DigitalIO DigitalIn DigitalOut DigitalBase DigitalBase Mcp23008.Pin

Public Member Functions

Task< bool > AwaitDigitalValueChangeAsync ()
 Wait for the digital input to change More...
 
Task MakeDigitalInAsync ()
 Make the pin a digital input More...
 
async Task ToggleOutputAsync ()
 Toggle the pin's output value More...
 
Task MakeDigitalPushPullOutAsync ()
 Make the pin a digital output More...
 
override string ToString ()
 Gets a string representation of the pin's current state More...
 

Public Attributes

int PinNumber => pinNumber
 The pin number of this port expander pin More...
 

Protected Attributes

PortExpanderPinMode mode = PortExpanderPinMode.DigitalInput
 Pin mode for this pin More...
 
int pinNumber
 Pin (bit) number More...
 
IPortExpanderParent portExpander
 Port expander this pin belongs to More...
 

Properties

PortExpanderPinMode Mode [get, set]
 The mode of the pin More...
 
bool DigitalValue [get, set]
 Gets or sets the output value of the pin when an output, or get the current value of the pin when an input More...
 

Events

OnDigitalInValueChanged DigitalValueChanged
 Event occurs whenever a digital input value has changed More...
 

Detailed Description

Construct a new Port Expander pin

Member Function Documentation

◆ AwaitDigitalValueChangeAsync()

Task<bool> AwaitDigitalValueChangeAsync ( )

Wait for the digital input to change

Returns
The new digital value (when the wait completes)

Implements DigitalIn.

◆ MakeDigitalInAsync()

Task MakeDigitalInAsync ( )

Make the pin a digital input

Implements DigitalIn.

◆ ToggleOutputAsync()

async Task ToggleOutputAsync ( )

Toggle the pin's output value

Implements DigitalOut.

◆ MakeDigitalPushPullOutAsync()

Task MakeDigitalPushPullOutAsync ( )

Make the pin a digital output

Implements DigitalOut.

◆ ToString()

override string ToString ( )

Gets a string representation of the pin's current state

Returns
the pin's current state

Member Data Documentation

◆ mode

Pin mode for this pin

◆ pinNumber

int pinNumber
protected

Pin (bit) number

◆ portExpander

IPortExpanderParent portExpander
protected

Port expander this pin belongs to

◆ PinNumber

int PinNumber => pinNumber

The pin number of this port expander pin

Property Documentation

◆ Mode

PortExpanderPinMode Mode
getset

The mode of the pin

◆ DigitalValue

bool DigitalValue
getset

Gets or sets the output value of the pin when an output, or get the current value of the pin when an input

Event Documentation

◆ DigitalValueChanged

OnDigitalInValueChanged DigitalValueChanged

Event occurs whenever a digital input value has changed


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