|
Treehopper C# API
|
Base Treehopper namespace. More...
Namespaces | |
| namespace | Libraries |
| Commonly used external peripherals, sensors, and other devices. | |
| namespace | Utilities |
| Utility classes for working with common data types | |
Classes | |
| interface | AdcPin |
| Base interface representing pins capable of reading analog values More... | |
| class | AdcValueChangedEventArgs |
| ADC value changed EventArgs More... | |
| class | AnalogValueChangedEventArgs |
| Analog value changed EventArgs More... | |
| class | AnalogVoltageChangedEventArgs |
| Analog voltage changed EventArgs More... | |
| class | ConnectionService |
| Discovers Treehopper boards attached to your device. More... | |
| interface | DigitalBase |
| Base interface that describes a pin with a DigitalValue property More... | |
| interface | DigitalIn |
| Interface for digital pins supporting input functionality More... | |
| class | DigitalInValueChangedEventArgs |
| An EventArgs that represents a digital input changing More... | |
| interface | DigitalIO |
| Helper interface to describe pins that are both inputs and outputs More... | |
| interface | DigitalOut |
| Interface for digital output pins More... | |
| class | HardwareI2C |
| Built-in I2C module. More... | |
| class | HardwarePwm |
| Built-in hardware PWM channels. More... | |
| class | HardwarePwmManager |
| Hardware PWM manager More... | |
| class | HardwareSpi |
| Built-in SPI peripheral. More... | |
| class | HardwareUart |
| Built-in UART peripheral. More... | |
| interface | I2C |
| I2c master device More... | |
| class | I2CTransferException |
| An Exception representing I2c transfer errors that may occur More... | |
| interface | IConnection |
| UsbConnection interface | |
| interface | IConnectionService |
| An interface representing connection services | |
| interface | OneWire |
| Represents a OneWire-capable host. More... | |
| class | ParallelInterface |
| This module is used to provide an 8080-style R/W parallel interface (especially useful for displays) More... | |
| class | Pin |
| Built-in I/O pins. More... | |
| interface | Pwm |
| This provides a generic interface to PWM operation. More... | |
| interface | ReadWriteParallelInterface |
| A parallel interface that can read and write data More... | |
| class | Settings |
| This class represents global settings used by the Treehopper API More... | |
| class | SoftPwmManager |
| The SoftPwmManager is used to configure soft-PWM pins on the board | |
| class | SoftPwmPinConfig |
| interface | Spi |
| An SPI interface More... | |
| interface | SpiChipSelectPin |
| A pin that can be used as an SPI chip-select More... | |
| class | TreehopperBoardEqualityComparer |
| This comparer is used to compare Treehopper boards More... | |
| class | TreehopperRuntimeException |
| A runtime exception caused in Treehopper More... | |
| class | TreehopperUsb |
| The core class for communicating with Treehopper USB boards. More... | |
| interface | Uart |
| interface | WriteOnlyParallelInterface |
| Represents an 8080-style parallel interface that can write data More... | |
Enumerations | |
| enum | AdcReferenceLevel { Vref_3V3, Vref_1V65, Vref_1V85, Vref_2V4, Vref_3V3Derived, Vref_3V7 } |
| Select the reference to use for the analog input of the pin More... | |
| enum | ChipSelectMode { SpiActiveLow, SpiActiveHigh, PulseHighAtBeginning, PulseHighAtEnd, PulseLowAtBeginning, PulseLowAtEnd } |
| Defines whether a signal is active high (rising-edge) or active low (falling-edge) More... | |
| enum | HardwarePwmFrequency { Freq732Hz, Freq183Hz, Freq61Hz } |
| Defines the PWM period options More... | |
| enum | I2CTransferError { ArbitrationLostError, NackError, UnknownError, TxunderError, Success = 255 } |
| Describes the transfer error, if not Success, that occured More... | |
| enum | PinMode { Reserved, DigitalInput, PushPullOutput, OpenDrainOutput, AnalogInput, SoftPwm, Unassigned } |
| An enumeration representing the different supported modes of this pin. More... | |
| enum | SpiBurstMode { NoBurst, BurstTx, BurstRx } |
| The SPI burst mode to use More... | |
| enum | SpiMode { Mode00 = 0x00, Mode01 = 0x20, Mode10 = 0x10, Mode11 = 0x30 } |
| Defines the clock phase and polarity used for SPI communication More... | |
| enum | UartMode { Uart, OneWire } |
| Whether to use UART or OneWire mode More... | |
Functions | |
| delegate void | TreehopperUsbAddedHandler (TreehopperUsb boardAdded) |
| An event handler for when a board is added More... | |
| delegate void | TreehopperUsbRemovedHandler (TreehopperUsb boardRemoved) |
| An event handler for when a board is removed More... | |
| delegate void | PinValuesUpdatedHandler (object sender, EventArgs e) |
| An event handler for when a new pin update report comes in More... | |
| delegate void | OnDigitalInValueChanged (object sender, DigitalInValueChangedEventArgs e) |
| This is the delegate prototype used for event-driven reading of digital pins. More... | |
| delegate void | OnAnalogVoltageChanged (object sender, AnalogVoltageChangedEventArgs e) |
| Used to send VoltageChanged events from the AnalogIn pin. More... | |
| delegate void | OnAdcValueChanged (object sender, AdcValueChangedEventArgs e) |
| Used to send ValueChanged events from the AnalogIn pin. More... | |
| delegate void | OnAnalogValueChanged (object sender, AnalogValueChangedEventArgs e) |
| Used to send ValueChanged events from the pin. More... | |
| delegate void | PinEventData (byte[] data) |
| Pin event data delegate More... | |
| delegate void | ConnectionAddedHandler (IConnection connectionAdded) |
| A delegate representing a new connection More... | |
| delegate void | ConnectionRemovedHandler (IConnection connectionRemoved) |
| A delegate representing a removed connection More... | |
Base Treehopper namespace.
|
strong |
Select the reference to use for the analog input of the pin
|
strong |
Defines whether a signal is active high (rising-edge) or active low (falling-edge)
|
strong |
|
strong |
|
strong |
An enumeration representing the different supported modes of this pin.
| Enumerator | |
|---|---|
| Reserved | Pin is reserved for other use |
| DigitalInput | Pin is a digital input |
| PushPullOutput | Pin is a push-pull output |
| OpenDrainOutput | Pin is an open-drain output |
| AnalogInput | Pin is an analog input |
| SoftPwm | Pin is a SoftPWM output |
| Unassigned | Pin is unassigned |
|
strong |
|
strong |
Defines the clock phase and polarity used for SPI communication
The left number indicates the clock polarity (CPOL), while the right number indicates the clock phase (CPHA). Consult https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Clock_polarity_and_phase for more information.
Note that the numeric values of this enum do not match the standard nomenclature, but instead match the value needed by Treehopper's MCU. Do not attempt to cast integers from/to this enum.
|
strong |
| delegate void Treehopper.TreehopperUsbAddedHandler | ( | TreehopperUsb | boardAdded | ) |
An event handler for when a board is added
| boardAdded | The new board |
| delegate void Treehopper.TreehopperUsbRemovedHandler | ( | TreehopperUsb | boardRemoved | ) |
An event handler for when a board is removed
| boardRemoved | the removed board |
| delegate void Treehopper.PinValuesUpdatedHandler | ( | object | sender, |
| EventArgs | e | ||
| ) |
An event handler for when a new pin update report comes in
| sender | The board from where it originated |
| e | A ference to the new pin update report |
| delegate void Treehopper.OnDigitalInValueChanged | ( | object | sender, |
| DigitalInValueChangedEventArgs | e | ||
| ) |
This is the delegate prototype used for event-driven reading of digital pins.
| sender | The Pin that changed |
| e | The new value of the pin |
| delegate void Treehopper.OnAnalogVoltageChanged | ( | object | sender, |
| AnalogVoltageChangedEventArgs | e | ||
| ) |
Used to send VoltageChanged events from the AnalogIn pin.
| sender | The AnalogIn pin that sent that message |
| e | The new voltage of the AnalogIn pin |
| delegate void Treehopper.OnAdcValueChanged | ( | object | sender, |
| AdcValueChangedEventArgs | e | ||
| ) |
Used to send ValueChanged events from the AnalogIn pin.
| sender | The AnalogIn pin that sent that message |
| e | The new voltage of the AnalogIn pin |
| delegate void Treehopper.OnAnalogValueChanged | ( | object | sender, |
| AnalogValueChangedEventArgs | e | ||
| ) |
Used to send ValueChanged events from the pin.
| sender | The pin that sent that message |
| e | The new normalized value of the pin |
| delegate void Treehopper.PinEventData | ( | byte [] | data | ) |
Pin event data delegate
| data | The pin event data sent by the board |
| delegate void Treehopper.ConnectionAddedHandler | ( | IConnection | connectionAdded | ) |
A delegate representing a new connection
| connectionAdded | The new connection |
| delegate void Treehopper.ConnectionRemovedHandler | ( | IConnection | connectionRemoved | ) |
A delegate representing a removed connection
| connectionRemoved | The old connection |