|
Treehopper C# API
|
Nuvoton NAU7802 24-bit dual-channel ADC for bridge sensors More...
Classes | |
| class | Nau7802Registers |
Public Types | |
| enum | Gains { x1 = 0, x4 = 1, x2 = 2, x8 = 3, x16 = 4, x32 = 5, x64 = 6, x128 = 7 } |
| enum | Vldoes { mV_4500 = 0, mV_4200 = 1, mV_3900 = 2, mV_3600 = 3, mV_3300 = 4, mV_3000 = 5, mV_2700 = 6, mV_2400 = 7 } |
| enum | CalMods { OffsetCalibrationInternal = 0, Reserved = 1, OffsetCalibrationSystem = 2, GainCalibrationSystem = 3 } |
| enum | ConversionRates { Sps_10 = 0, Sps_20 = 1, Sps_40 = 2, Sps_80 = 3, Sps_320 = 7 } |
Public Member Functions | |
| Nau7802 (I2C i2c, DigitalIn drdy=null) | |
| async Task | UpdateAsync () |
| Requests a reading from the sensor and updates its data properties with the gathered values. More... | |
| async Task< bool > | CalibrateAsync () |
| async Task | SetChannelAsync (int channel) |
| Task | MakeAnalogInAsync () |
| Make the pin an analog input. More... | |
Public Attributes | |
| double | AnalogValue => analogValueFromAdc(AdcValue) |
| The analog value (from 0-1) of the ADC pin More... | |
| double | AnalogVoltage => analogVoltageFromAdc(AdcValue) |
| The analog voltage of the pin More... | |
Protected Attributes | |
| IAdcPeripheral | parent |
Properties | |
| bool | AutoUpdateWhenPropertyRead [get, set] |
| Gains | Gain [get, set] |
| bool | Cfilter [get, set] |
| ConversionRates | ConversionRate [get, set] |
| double | ReferenceVoltage [get, set] |
| The reference voltage used for calculating analog voltage More... | |
| int | AdcValueChangedThreshold [get, set] |
| The amount the ADC value should change before triggering an event More... | |
| int | AdcValue [get, set] |
| The raw ADC value More... | |
| double | AnalogValueChangedThreshold [get, set] |
| The amount that the analog value (0-1) should change before triggering an event More... | |
| double | AnalogVoltageChangedThreshold [get, set] |
| The change in voltage required to trigger an event More... | |
Events | |
| OnAdcValueChanged | AdcValueChanged |
| Fires whenever the ADC value changes by the specified threshold More... | |
| OnAnalogValueChanged | AnalogValueChanged |
| Fires whenever the analog value changes by the specified threshold More... | |
| OnAnalogVoltageChanged | AnalogVoltageChanged |
| Fires whenever the analog voltage changes by the specified threshold More... | |
| PropertyChangedEventHandler | PropertyChanged |
Nuvoton NAU7802 24-bit dual-channel ADC for bridge sensors
|
strong |
|
strong |
|
strong |
|
strong |
| async Task UpdateAsync | ( | ) |
Requests a reading from the sensor and updates its data properties with the gathered values.
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).
Implements IPollable.
| async Task<bool> CalibrateAsync | ( | ) |
| async Task SetChannelAsync | ( | int | channel | ) |
|
inherited |
|
protectedinherited |
|
inherited |
The analog value (from 0-1) of the ADC pin
|
inherited |
The analog voltage of the pin
|
getset |
|
getset |
|
getset |
|
getset |
|
getsetinherited |
The reference voltage used for calculating analog voltage
|
getsetinherited |
The amount the ADC value should change before triggering an event
|
getsetinherited |
The raw ADC value
|
getsetinherited |
The amount that the analog value (0-1) should change before triggering an event
|
getsetinherited |
The change in voltage required to trigger an event
|
inherited |
Fires whenever the ADC value changes by the specified threshold
|
inherited |
Fires whenever the analog value changes by the specified threshold
|
inherited |
Fires whenever the analog voltage changes by the specified threshold
|
inherited |