Treehopper C# API
SuperNesController Class Reference

Nintendo Super NES (SNES) Controller More...

Inheritance diagram for SuperNesController:
NesController IPollable IPolledEvents IPollable

Public Member Functions

 SuperNesController (Spi spi, SpiChipSelectPin ps)
 
override async Task UpdateAsync ()
 Requests a reading from the controller and updates its data properties with the gathered values. More...
 

Protected Member Functions

void RaiseDPadChanged ()
 

Protected Attributes

SpiDevice dev
 
DPadState dpad
 

Properties

Button X [get]
 
Button Y [get]
 
Button L [get]
 
Button R [get]
 
Button A [get]
 
Button B [get]
 
Button Start [get]
 
Button Select [get]
 
DPadState DPad [get]
 
bool AutoUpdateWhenPropertyRead = true [get, set]
 
int AwaitPollingInterval = 25 [get, set]
 

Events

DPadStateEventHandler DPadStateChanged
 
PropertyChangedEventHandler PropertyChanged
 

Detailed Description

Nintendo Super NES (SNES) Controller

Constructor & Destructor Documentation

◆ SuperNesController()

Member Function Documentation

◆ UpdateAsync()

override async Task UpdateAsync ( )
virtual

Requests a reading from the controller and updates its data properties with the gathered values.

Returns
An awaitable Task

Note that when AutoUpdateWhenPropertyRead is true (which it is, by default), this method is implicitly called when any sensor data property is read from — there's no need to call this method unless you set AutoUpdateWhenPropertyRead to false.

Unless otherwise noted, this method updates all sensor data simultaneously, which can often lead to more efficient bus usage (as well as reducing USB chattiness).

Reimplemented from NesController.

◆ RaiseDPadChanged()

void RaiseDPadChanged ( )
protectedinherited

Member Data Documentation

◆ dev

SpiDevice dev
protectedinherited

◆ dpad

DPadState dpad
protectedinherited

Property Documentation

◆ X

Button X
get

◆ Y

Button Y
get

◆ L

Button L
get

◆ R

Button R
get

◆ A

Button A
getinherited

◆ B

Button B
getinherited

◆ Start

Button Start
getinherited

◆ Select

Button Select
getinherited

◆ DPad

DPadState DPad
getinherited

◆ AutoUpdateWhenPropertyRead

bool AutoUpdateWhenPropertyRead = true
getsetinherited

◆ AwaitPollingInterval

int AwaitPollingInterval = 25
getsetinherited

Event Documentation

◆ DPadStateChanged

DPadStateEventHandler DPadStateChanged
inherited

◆ PropertyChanged

PropertyChangedEventHandler PropertyChanged
inherited

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