cedargrove_nau7802

A CircuitPython driver class for the NAU7802 24-bit ADC. Supports dual analog inputs.

  • Author(s): JG

Implementation Notes

Hardware:

Software and Dependencies:

class cedargrove_nau7802.CalibrationMode

Calibration mode state settings.

class cedargrove_nau7802.ConversionRate

ADC conversion rate settings.

class cedargrove_nau7802.Gain

Analog differential amplifier gain settings.

class cedargrove_nau7802.LDOVoltage

Internal low-dropout voltage regulator settings.

class cedargrove_nau7802.NAU7802(i2c_bus, address=42, active_channels=1)

The primary NAU7802 class.

available()

Read the ADC data-ready status. True when data is available; False when ADC data is unavailable.

calibrate(mode='INTERNAL')

Perform the calibration procedure. Valid calibration modes are ‘INTERNAL’, ‘OFFSET’, and ‘GAIN’. True if successful.

property channel

Selected channel number (1 or 2).

property chip_revision

The chip revision code.

enable(power=True)

Enable(start) or disable(stop) the internal analog and digital systems power. Enable = True; Disable (low power) = False. Returns True when enabled; False when disabled.

property gain

The programmable amplifier (PGA) gain factor.

property ldo_voltage

Representation of the LDO voltage value.

property poll_rate

ADC conversion/polling rate.

read()

Reads the 24-bit ADC data. Returns a signed integer value with 24-bit resolution. Assumes that the ADC data-ready bit was checked to be True.

reset()

Resets all device registers and enables digital system power. Returns the power ready status bit value: True when system is ready; False when system not ready for use.