get-saturation-status

wayland/as7343-spectrometer/get-saturation-status

Checks for analog and digital saturation.
get-saturation-status
@/get-saturation-status
Checks for analog and digital saturation.
DEV@/as7343-device
An as7343-device.
UPDpulse
Update.
get-saturation-status
DEV
UPD
Analog
Digital
DONE
DONEpulse
Pulse on read.
Digitalboolean
True indicates that the maximum counter value has been reached. Maximum counter value depends on integration time set in the ATIME register.
Analogboolean
True indicates that the intensity of ambient light has exceeded the maximum integration level for the spectral analog circuit.
To use the node in your project you should have the wayland/as7343-spectrometer library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {
   void evaluate(Context ctx) {
       // The node responds only if there is an input pulse
       if (!isInputDirty<input_UPD>(ctx))
           return;

       auto sensor = getValue<input_DEV>(ctx);

       emitValue<output_Analog>(ctx, sensor->analogSaturation());
       emitValue<output_Digital>(ctx, sensor->digitalSaturation());

       emitValue<output_DONE>(ctx, 1);

    }
}