Treehopper C++ API
Treehopper Namespace Reference

Namespaces

 Libraries
 

Classes

class  AdcPin
 
struct  AdcValueChangedEventArgs
 
struct  AnalogValueChangedEventArgs
 
struct  AnalogVoltageChangedEventArgs
 
class  ConnectionService
 Provides TreehopperUsb discovery and factory duties. More...
 
class  DigitalIn
 digital input pin abstract class. More...
 
class  DigitalOut
 Digital output pin abstract class. More...
 
class  Event
 Provides a simple C#-style observer pattern event queue. 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...
 
class  I2c
 Base I2c interface. More...
 
class  I2cTransferException
 
class  LibUsbConnection
 
class  MacUsbConnection
 
class  OneWire
 
class  Pin
 Built-in I/O pins. More...
 
struct  PinChangedEventArgs
 
class  Pwm
 
class  Settings
 
class  SMBusDevice
 
class  Spi
 An SPI port. More...
 
class  SpiChipSelectPin
 
class  SpiDevice
 Represents a peripheral on the SPI bus. More...
 
class  TreehopperUsb
 The core class for communicating with Treehopper USB boards. More...
 
class  Uart
 
class  UsbConnection
 
class  Utility
 
class  WinUsbConnection
 

Enumerations

enum  ChipSelectMode {
  SpiActiveLow, SpiActiveHigh, PulseHighAtBeginning, PulseHighAtEnd,
  PulseLowAtBeginning, PulseLowAtEnd
}
 
enum  UartMode { Uart, OneWire }
 
enum  I2cTransferError {
  ArbitrationLostError, NackError, UnknownError, TxunderError,
  Success = 255
}
 Describes the transfer error, if not Success, that occured More...
 
enum  AdcReferenceLevel {
  VREF_3V3, VREF_1V65, VREF_1V8, VREF_2V4,
  VREF_3V3_DERIVED, VREF_3V6
}
 
enum  PinMode {
  Reserved, DigitalInput, PushPullOutput, OpenDrainOutput,
  AnalogInput, Unassigned
}
 
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...
 

Variables

enum TREEHOPPER_API HardwarePwmFrequency
 Frequencies supported by HardwarePwm. More...
 
enum TREEHOPPER_API Freq_183Hz
 183 Hz frequency More...
 
enum TREEHOPPER_API Freq_61Hz
 61 Hz frequency More...
 

Enumeration Type Documentation

◆ AdcReferenceLevel

enum AdcReferenceLevel
strong
Enumerator
VREF_3V3 
VREF_1V65 
VREF_1V8 
VREF_2V4 
VREF_3V3_DERIVED 
VREF_3V6 

◆ ChipSelectMode

enum ChipSelectMode
strong
Enumerator
SpiActiveLow 

CS is asserted low, the SPI transaction takes place, and then the signal is returned high.

SpiActiveHigh 

CS is asserted high, the SPI transaction takes place, and then the signal is returned low.

PulseHighAtBeginning 

CS is pulsed high, and then the SPI transaction takes place.

PulseHighAtEnd 

The SPI transaction takes place, and once finished, CS is pulsed high.

PulseLowAtBeginning 

CS is pulsed low, and then the SPI transaction takes place.

PulseLowAtEnd 

The SPI transaction takes place, and once finished, CS is pulsed low.

◆ I2cTransferError

enum I2cTransferError
strong
Enumerator
ArbitrationLostError 

Bus arbitration was lost

NackError 

The slave board failed to Nack back.

UnknownError 

Unknown error

TxunderError 

Tx buffer underrun error

Success 

Successful transaction

◆ PinMode

enum PinMode
strong
Enumerator
Reserved 
DigitalInput 
PushPullOutput 
OpenDrainOutput 
AnalogInput 
Unassigned 

◆ SpiBurstMode

enum SpiBurstMode
strong
Enumerator
NoBurst 

No burst – always read the same number of bytes as transmitted.

BurstTx 

Transmit burst – don't return any data read from the bus.

BurstRx 

Receive burst – ignore transmitted data above 53 bytes long, but receive the full number of bytes specified.

◆ SpiMode

enum SpiMode
strong

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.

Enumerator
Mode00 

Clock is initially low; data is valid on the rising edge of the clock

Mode01 

Clock is initially low; data is valid on the falling edge of the clock

Mode10 

Clock is initially high; data is valid on the rising edge of the clock

Mode11 

Clock is initially high; data is valid on the falling edge of the clock

◆ UartMode

enum UartMode
strong
Enumerator
Uart 

The module is operating in UART mode.

OneWire 

The module is operating in OneWire mode.

Only the TX pin is used.

Variable Documentation

◆ Freq_183Hz

enum TREEHOPPER_API Freq_183Hz
strong

◆ Freq_61Hz

enum TREEHOPPER_API Freq_61Hz
strong

◆ HardwarePwmFrequency

enum TREEHOPPER_API HardwarePwmFrequency
strong