ADC
8.0
Analog to Digital Conversor library for the Teensy 3.5 microprocessor
|
Controls the Teensy internal voltage reference module (VREFV1) More...
Functions | |
void | start (uint8_t mode=VREF_SC_MODE_LV_HIGHPOWERBUF, uint8_t trim=0x20) |
Start the 1.2V internal reference (if present) More... | |
void | trim (uint8_t trim) |
Set the trim. More... | |
void | stop () |
Stops the internal reference. More... | |
volatile bool | isStable () |
Check if the internal reference has stabilized. More... | |
volatile bool | isOn () |
Check if the internal reference is on. More... | |
void | waitUntilStable () |
Wait for the internal reference to stabilize. More... | |
Controls the Teensy internal voltage reference module (VREFV1)
|
inline |
Check if the internal reference is on.
|
inline |
Check if the internal reference has stabilized.
NOTE: This is valid only when the chop oscillator is not being used. By default the chop oscillator IS used, so wait the maximum start-up time of 35 ms (as per datasheet). waitUntilStable waits 35 us. This should be polled after enabling the reference after reset, after changing its buffer mode from VREF_SC_MODE_LV_BANDGAPONLY to any of the buffered modes, or after changing the trim.
|
inline |
Start the 1.2V internal reference (if present)
This is called automatically by ADC_Module::setReference(ADC_REFERENCE::REF_1V2) Use it to switch on the internal reference on the VREF_OUT pin. You can measure it with adc->analogRead(ADC_INTERNAL_SOURCE::VREF_OUT).
mode | can be (these are defined in kinetis.h) VREF_SC_MODE_LV_BANDGAPONLY (0) for stand-by VREF_SC_MODE_LV_HIGHPOWERBUF (1) for high power buffer and VREF_SC_MODE_LV_LOWPOWERBUF (2) for low power buffer. |
trim | adjusts the reference value, from 0 to 0x3F (63). Default is 32. |
|
inline |
Stops the internal reference.
This is called automatically by ADC_Module::setReference(ref) when ref is any other than REF_1V2
|
inline |
Set the trim.
Set the trim, the change in the reference is about 0.5 mV per step.
trim | adjusts the reference value, from 0 to 0x3F (63). |
|
inline |
Wait for the internal reference to stabilize.
This function can be called to wait for the internal reference to stabilize. It will block until the reference has stabilized, or return immediately if the reference is not enabled in the first place.