|
| | SfeAS7331ArdI2C () |
| |
| bool | begin (const uint8_t &address=kDefaultAS7331Addr, TwoWire &wirePort=Wire) |
| | Initializes the AS7331 UV sensor with I2C communication. More...
|
| |
| bool | isConnected (void) |
| | Checks if the AS7331 UV sensor is connected and responding. More...
|
| |
| bool | setDeviceAddress (const uint8_t &deviceAddress) |
| | Sets the I2C address for communicating with the AS7331 sensor. More...
|
| |
| uint8_t | getDeviceAddress (void) |
| | Gets the currently configured I2C address of the AS7331 sensor. More...
|
| |
| bool | begin (sfTkIBus *theBus=nullptr) |
| | This method is called to initialize the AS7331 device through the specified bus. More...
|
| |
| uint8_t | getDeviceID (void) |
| | Requests the device ID from the sensor. More...
|
| |
| void | setCommunicationBus (sfTkIBus *theBus) |
| | Sets the communication bus to the specified bus. More...
|
| |
| bool | runDefaultSetup (const bool &runSoftReset=false) |
| | Helper class that sets up the sensor and state in the POR configuration. More...
|
| |
| bool | prepareMeasurement (const as7331_meas_mode_t &measMode=MEAS_MODE_CONT, const bool &startMeasure=false) |
| | Puts the sensor in the specified measurement mode. More...
|
| |
| bool | reset (void) |
| | Performs a soft reset of the sensor. More...
|
| |
| sfTkError_t | readTemp (void) |
| | Reads the sensor's temperature, converts it to a usable form, and saves it to the internal temperature variable. More...
|
| |
| sfTkError_t | readUVA (void) |
| | Reads the sensor's UVA register, converts it to a usable form, and saves it to the internal UVA variable. More...
|
| |
| sfTkError_t | readUVB (void) |
| | Reads the sensor's UVB register, converts it to a usable form, and saves it to the internal UVB variable. More...
|
| |
| sfTkError_t | readUVC (void) |
| | Reads the sensor's UVC register, converts it to a usable form, and saves it to the internal UVC variable. More...
|
| |
| sfTkError_t | readAllUV (void) |
| | Read's all three UV registers, converts them to a usable form, then saves them to their respective internal variable. More...
|
| |
| sfTkError_t | readAll (void) |
| | Read the sensor's temperature, UV, and external time conversion clock counts, converts them, and then saves them to their respective internal variable. More...
|
| |
| sfTkError_t | readOutConv (void) |
| | Read the conversion clock counts register and saves it to the internal output conversion time variable. More...
|
| |
| float | getUVA (void) |
| | Returns the last valid UVA reading. More...
|
| |
| float | getUVB (void) |
| | Returns the last valid UVB reading. More...
|
| |
| float | getUVC (void) |
| | Returns the last valid UVC reading. More...
|
| |
| float | getTemp (void) |
| | Returns the last valid Temperature reading. More...
|
| |
| uint32_t | getOutConv (void) |
| | Returns the last valid output conversion. More...
|
| |
| as7331_gain_t | getGainRaw (void) |
| | Getter for the currently configured gain. More...
|
| |
| uint16_t | getGainValue (void) |
| | Getter for the currently configured gain. More...
|
| |
| sfTkError_t | setGain (const as7331_gain_t &gain) |
| | Sets the UV sensor's gain. More...
|
| |
| as7331_conv_clk_freq_t | getCClkRaw (void) |
| | Getter for the currently configured conversion clock. More...
|
| |
| uint16_t | getCClkKHz (void) |
| | Getter for the currently configured conversion clock. More...
|
| |
| sfTkError_t | setCClk (const as7331_conv_clk_freq_t &cclk) |
| | Set the sensor's internal clock speed. More...
|
| |
| as7331_conv_time_t | getConversionTimeRaw (void) |
| | Getter for the currently configured conversion time. More...
|
| |
| uint16_t | getConversionTimeMillis (void) |
| | Getter for the currently configured conversion time. More...
|
| |
| sfTkError_t | setConversionTime (const as7331_conv_time_t &convTime) |
| | Sets the conversion time that the sensor will run to. More...
|
| |
| bool | getReadyPinMode (void) |
| | Getter for the currently configured pin mode. More...
|
| |
| sfTkError_t | setReadyPinMode (const bool &pinMode) |
| | Sets the ready pin type to push-pull or open-drain. More...
|
| |
| bool | getDigitalDividerEnabled (void) |
| | Getter for the currently configured divider status. More...
|
| |
| sfTkError_t | setDigitalDividerEnabled (const bool &isEnabled) |
| | Enables or disables the internal UV result divider. More...
|
| |
| as7331_divider_val_t | getDigitalDividerRange (void) |
| | Getter for the currently configured divider range. More...
|
| |
| sfTkError_t | setDigitalDividerRange (const as7331_divider_val_t ÷r, const bool &enableDiv=true) |
| | Sets the value of the internal UV result divider. More...
|
| |
| bool | getSyndTempConversionEnabled (void) |
| | Getter for the SYND temperature conversion status. More...
|
| |
| sfTkError_t | setSyndTempConversionEnabled (const bool &isEnabled) |
| | Enables or disables temperature conversion when in SYND mode. More...
|
| |
| bool | getIndexMode (void) |
| | Getter for the currently configured I2C compatibility mode. More...
|
| |
| sfTkError_t | setIndexMode (const bool &indexMode) |
| | Set the index mode for compatibility with I2C controllers that don't support repeated start. More...
|
| |
| uint8_t | getBreakTime (void) |
| | Getter for the currently configured minimum break time in CONT, CMD, SYNS modes. More...
|
| |
| sfTkError_t | setBreakTime (const uint8_t &breakTime) |
| | Set the minimum time between measurements in CONT, SYNS, SYND modes. More...
|
| |
| uint8_t | getNumEdges (void) |
| | Getter for the currently configured minimum number of edges to end conversion when in SYND mode. More...
|
| |
| sfTkError_t | setNumEdges (const uint8_t &numEdges) |
| | Set the minimum number of falling edges required at the SYN input until the conversion is terminated. Only operational in SYND mode. More...
|
| |
| bool | getPowerDownState (void) |
| | Getter for the current power state. More...
|
| |
| sfTkError_t | setPowerDownState (const bool &pd) |
| | Sets the power state of the sensor. More...
|
| |
| as7331_dev_op_state_t | getOperationMode (void) |
| | Getter for the current operational state. More...
|
| |
| sfTkError_t | setOperationMode (const as7331_dev_op_state_t &opMode) |
| | Set the sensor's operating mode. More...
|
| |
| as7331_meas_mode_t | getMeasurementMode (void) |
| | Getter for the current measurement state. More...
|
| |
| sfTkError_t | setMeasurementMode (const as7331_meas_mode_t &measMode) |
| | Sets the sensor's measurement mode. More...
|
| |
| bool | getStandbyState (void) |
| | Getter for the current standby state. More...
|
| |
| sfTkError_t | setStandbyState (const bool &standby) |
| | Sets the sensor's standby mode. More...
|
| |
| bool | getStartState (void) |
| | Getter for the current start state. More...
|
| |
| sfTkError_t | setStartState (const bool &startState) |
| | Sets the sensor's start state. This begins measurement. More...
|
| |
| sfTkError_t | getStatus (sfe_as7331_reg_meas_osr_status_t &statusReg) |
| | Gets the sensor's status when in measurement operation mode. More...
|
| |
| sfTkError_t | getOSR (sfe_as7331_reg_cfg_osr_t &osrReg) |
| | Gets the operational state register when in configuration operation mode. More...
|
| |
| sfTkError_t | setOSR (const sfe_as7331_reg_cfg_osr_t &osrReg) |
| | Sets the operational state register when in configuration operation mode. More...
|
| |
| sfTkError_t | getCReg1 (sfe_as7331_reg_cfg_creg1_t &creg1) |
| | Gets the configuration register #1 when in configuration operation mode. More...
|
| |
| sfTkError_t | setCReg1 (const sfe_as7331_reg_cfg_creg1_t &creg1) |
| | Sets the configuration register #1 when in configuration operation mode. More...
|
| |
| sfTkError_t | getCReg2 (sfe_as7331_reg_cfg_creg2_t &creg2) |
| | Gets the configuration register #2 when in configuration operation mode. More...
|
| |
| sfTkError_t | setCReg2 (const sfe_as7331_reg_cfg_creg2_t &creg2) |
| | Sets the configuration register #2 when in configuration operation mode. More...
|
| |
| sfTkError_t | getCReg3 (sfe_as7331_reg_cfg_creg3_t &creg3) |
| | Gets the configuration register #3 when in configuration operation mode. More...
|
| |
| sfTkError_t | setCReg3 (const sfe_as7331_reg_cfg_creg3_t &creg3) |
| | Sets the configuration register #3 when in configuration operation mode. More...
|
| |
| sfTkError_t | getBreak (uint8_t &breakReg) |
| | Gets the break register when in configuration operation mode. More...
|
| |
| sfTkError_t | setBreak (const uint8_t &breakReg) |
| | Sets the break register when in configuration operation mode. More...
|
| |
| sfTkError_t | getEdges (uint8_t &edgesReg) |
| | Gets the edges register when in configuration operation mode. More...
|
| |
| sfTkError_t | setEdges (const uint8_t &edgesReg) |
| | Sets the edges register when in configuration operation mode. More...
|
| |
| sfTkError_t | getOptIndex (sfe_as7331_reg_cfg_optreg_t &optReg) |
| | Gets the option register when in configuration operation mode. More...
|
| |
| sfTkError_t | setOptIndex (const sfe_as7331_reg_cfg_optreg_t &optReg) |
| | Sets the option register when in configuration operation mode. More...
|
| |
Arduino I2C implementation for the AS7331 UV sensor.
This class provides Arduino-specific I2C communication implementation for the AS7331 UV sensor. It inherits from the base driver class and implements the I2C interface using Arduino's Wire library. The class manages device addressing and connection verification.
Example usage:
}
Arduino I2C implementation for the AS7331 UV sensor.
Definition: SparkFun_AS7331.h:73
bool begin(const uint8_t &address=kDefaultAS7331Addr, TwoWire &wirePort=Wire)
Initializes the AS7331 UV sensor with I2C communication.
Definition: SparkFun_AS7331.h:105
- Note
- This class uses the Arduino Wire library for I2C communication
- See also
- sfDevAS7331
-
TwoWire