Treehopper C# API
Mcp23008.Pin Class Reference

An MCP23008 pin, including the PullUpEnabled functionality More...

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

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

bool PullUpEnabled [get, set]
 Whether the pin's internal Pull-Up resistor is enabled or not More...
 
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

An MCP23008 pin, including the PullUpEnabled functionality

Member Function Documentation

◆ AwaitDigitalValueChangeAsync()

Task<bool> AwaitDigitalValueChangeAsync ( )
inherited

Wait for the digital input to change

Returns
The new digital value (when the wait completes)

Implements DigitalIn.

◆ MakeDigitalInAsync()

Task MakeDigitalInAsync ( )
inherited

Make the pin a digital input

Implements DigitalIn.

◆ ToggleOutputAsync()

async Task ToggleOutputAsync ( )
inherited

Toggle the pin's output value

Implements DigitalOut.

◆ MakeDigitalPushPullOutAsync()

Task MakeDigitalPushPullOutAsync ( )
inherited

Make the pin a digital output

Implements DigitalOut.

◆ ToString()

override string ToString ( )
inherited

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
protectedinherited

Pin (bit) number

◆ portExpander

IPortExpanderParent portExpander
protectedinherited

Port expander this pin belongs to

◆ PinNumber

int PinNumber => pinNumber
inherited

The pin number of this port expander pin

Property Documentation

◆ PullUpEnabled

bool PullUpEnabled
getset

Whether the pin's internal Pull-Up resistor is enabled or not

◆ Mode

PortExpanderPinMode Mode
getsetinherited

The mode of the pin

◆ DigitalValue

bool DigitalValue
getsetinherited

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
inherited

Event occurs whenever a digital input value has changed


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