SparkFun Spectral Sensor - AS7343  v1.0.0-4-gd418547
Library for the SparkFun SpectralSensor - AS7343
Loading...
Searching...
No Matches
SfeAS7343ArdI2C Class Reference

Arduino I2C implementation for the AS7343 sensor. More...

#include <SparkFun_AS7343.h>

Inheritance diagram for SfeAS7343ArdI2C:

Public Member Functions

 SfeAS7343ArdI2C ()
 
bool begin (const uint8_t &address=kAS7343Addr, TwoWire &wirePort=Wire)
 Initializes the AS7343 sensor with I2C communication. More...
 
bool isConnected (void)
 Checks if the AS7343 sensor is connected and responding. More...
 
uint8_t getDeviceAddress (void)
 Gets the currently configured I2C address of the AS7343 sensor. More...
 
bool begin (sfTkIBus *theBus=nullptr)
 This method is called to initialize the AS7343 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 setRegisterBank (sfe_as7343_reg_bank_t regBank)
 Set the register bank. In order to access registers from 0x58 to 0x66, bit REG_BANK in register CFG0 (0xBF) needs to be set to “1”. For register access of registers 0x80 and above bit REG_BANK needs to be set to “0” More...
 
bool powerOn (bool power=true)
 Power on or off the device. More...
 
bool powerOff (void)
 Power off the device. More...
 
bool enableSpectralMeasurement (bool enable=true)
 Enable or Disable the Spectral Measurement. More...
 
bool disableSpectralMeasurement (void)
 Spectral Measurement Disable. More...
 
bool readSpectraDataFromSensor (void)
 Read all Spectral Data Registers. More...
 
uint8_t getData (uint16_t *data, size_t size)
 Get data from the sensor using a pointer to an array and the desired data length. More...
 
uint8_t getData (uint16_t data[ksfAS7343NumChannels])
 
bool setAutoSmux (sfe_as7343_auto_smux_channel_t auto_smux)
 Set automatic channel read-out. More...
 
bool ledOn (bool ledOn=true)
 Turn on or off the LED. More...
 
bool ledOff (void)
 Turn off the LED. More...
 
bool setLedDrive (uint8_t ledDrive)
 Set the LED drive current. More...
 
uint16_t getRed (void)
 Get Red spectrum data. (aka channel F7, 690nm) More...
 
uint16_t getGreen (void)
 Get Green spectrum data. (aka channel F5, 550nm) More...
 
uint16_t getBlue (void)
 Get Blue spectrum data. (aka channel FZ, 450nm) More...
 
uint16_t getNIR (void)
 Get NIR spectrum data. (aka channel NIR, 855nm) More...
 
uint16_t getChannelData (sfe_as7343_channel_t channel)
 Get Specific Channel of Spectrum Data. More...
 
bool setSpectralIntThresholdHigh (uint16_t spThH)
 Set the spectral interrupt threshold high. More...
 
bool setSpectralIntThresholdLow (uint16_t spThL)
 Set the spectral interrupt threshold low. More...
 
bool enableSpectralInterrupt (bool enable=true)
 Enable or Disable the spectral interrupt. More...
 
bool disableSpectralInterrupt (void)
 Disable the spectral interrupt. More...
 
bool setSpectralThresholdChannel (sfe_as7343_spectral_threshold_channel_t spThCh)
 Set the spectral threshold channel. More...
 
bool getSystemInterruptStatus (void)
 Get the System Interrupt Status. More...
 
bool getSpectralChannelInterruptStatus (void)
 Get the Spectral Channel Interrupt Status. More...
 
bool clearSpectralChannelInterrupt (void)
 Clear Spectral Channel Interrupt bit (AINT). More...
 
bool getSpectralInterruptHighStatus (void)
 Get the Spectral Interrupt High Status. More...
 
bool getSpectralTriggerErrorStatus (void)
 Get the Spectral Trigger Error Status. More...
 
bool setWaitTime (uint8_t wTime)
 Set the Spectral Measurement Wait Time. More...
 
uint8_t getWaitTime (void)
 Get the Spectral Measurement Wait Time. More...
 
bool enableWaitTime (bool enable=true)
 Enable or Disable Wait Time. More...
 
bool disableWaitTime (void)
 Disable Wait Time. More...
 
bool getSpectralValidStatus (void)
 Get the Spectral Valid Status. More...
 
uint8_t readIntEnableReg (void)
 Read the register INT Enable. More...
 
bool setGPIOMode (sfe_as7343_gpio_mode_t gpioMode)
 Set the GPIO pin mode. More...
 
bool getGPIOInputStatus (void)
 Get the GPIO input status. More...
 
bool setGPIOOutput (sfe_as7343_gpio_output_t gpioOut)
 Set the GPIO output. More...
 
bool reset (void)
 Reset the device. More...
 
bool setSpectralIntPersistence (uint8_t apers)
 Set the Spectral Interrupt Persistence. More...
 
bool readRegisterBank (uint8_t reg, uint8_t &data)
 Read a register from the device. More...
 
bool setAgain (sfe_as7343_again_t again)
 
bool enableFlickerDetection (bool enable=true)
 Enable or Disable the Flicker Detection. More...
 
bool disableFlickerDetection (void)
 Disable Flicker Detection. More...
 
bool isFlickerDetectionValid (void)
 Get the Flicker Detection Measurement Valid Status. More...
 
bool isFlickerDetectionSaturated (void)
 Get the Flicker Detection Saturation Detected Status. More...
 
uint8_t getFlickerDetectionFrequency (void)
 Get the Flicker Detection Frequency Detected. More...
 

Detailed Description

Arduino I2C implementation for the AS7343 sensor.

This class provides Arduino-specific I2C communication implementation for the AS7343 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:

if (sensor.begin()) {
// Sensor initialized successfully
}
Arduino I2C implementation for the AS7343 sensor.
Definition: SparkFun_AS7343.h:69
bool begin(const uint8_t &address=kAS7343Addr, TwoWire &wirePort=Wire)
Initializes the AS7343 sensor with I2C communication.
Definition: SparkFun_AS7343.h:101
Note
This class uses the Arduino Wire library for I2C communication
See also
sfDevAS7343
TwoWire

Constructor & Destructor Documentation

◆ SfeAS7343ArdI2C()

SfeAS7343ArdI2C::SfeAS7343ArdI2C ( )
inline

Member Function Documentation

◆ begin() [1/2]

bool SfeAS7343ArdI2C::begin ( const uint8_t &  address = kAS7343Addr,
TwoWire &  wirePort = Wire 
)
inline

Initializes the AS7343 sensor with I2C communication.

This method performs the following initialization steps:

  1. Initializes I2C communication with device address and Wire port
  2. Enables repeat start support
  3. Sets up communication bus
  4. Verifies device connection
  5. Calls base class initialization
Parameters
addressI2C address of the device (default: kDefaultAS7343Addr)
wirePortTwoWire instance to use for I2C communication (default: Wire)
Returns
true If initialization successful
false If any initialization step fails

Example:

if (!sensor.begin()) {
Serial.println("Sensor initialization failed!");
while (1); // halt
}

◆ begin() [2/2]

bool sfDevAS7343::begin ( sfTkIBus *  theBus = nullptr)
inherited

This method is called to initialize the AS7343 device through the specified bus.

Parameters
theBusPointer to the bus object.
Returns
True if successful, false if it fails.

◆ clearSpectralChannelInterrupt()

bool sfDevAS7343::clearSpectralChannelInterrupt ( void  )
inherited

Clear Spectral Channel Interrupt bit (AINT).

This method clears the spectral channel interrupt bit by writing a 1 to the AINT bit in the STATUS register (ksfAS7343RegStatus).

Returns
True if successful, false if it fails.

◆ disableFlickerDetection()

bool sfDevAS7343::disableFlickerDetection ( void  )
inherited

Disable Flicker Detection.

This method disables flicker detection by calling the enableFlickerDetection method with false.

Returns
True if successful, false if it fails.

◆ disableSpectralInterrupt()

bool sfDevAS7343::disableSpectralInterrupt ( void  )
inherited

Disable the spectral interrupt.

This method disables the spectral interrupt by calling the enableSpectralInterrupt method with false.

Returns
True if successful, false if it fails.

◆ disableSpectralMeasurement()

bool sfDevAS7343::disableSpectralMeasurement ( void  )
inherited

Spectral Measurement Disable.

This method disables the spectral measurement by calling the enableSpectralMeasurement method with false.

Returns
True if successful, false if it fails.

◆ disableWaitTime()

bool sfDevAS7343::disableWaitTime ( void  )
inherited

Disable Wait Time.

This method disables the wait time by calling the enableWaitTime method with false.

Returns
True if successful, false if it fails.

◆ enableFlickerDetection()

bool sfDevAS7343::enableFlickerDetection ( bool  enable = true)
inherited

Enable or Disable the Flicker Detection.

This method enables or disables the flicker detection by setting or clearing the FD_EN bit in the ENABLE register (ksfAS7343RegEnable).

Parameters
enableTrue to enable the flicker detection, false to disable.
Returns
True if successful, false if it fails.

◆ enableSpectralInterrupt()

bool sfDevAS7343::enableSpectralInterrupt ( bool  enable = true)
inherited

Enable or Disable the spectral interrupt.

This method enables or disables the spectral interrupt by setting or clearing the SP_IEN bit in the INT_ENAB register (ksfAS7343RegIntEnab).

Parameters
enableTrue to enable the spectral interrupt, false to disable.
Returns
True if successful, false if it fails.

◆ enableSpectralMeasurement()

bool sfDevAS7343::enableSpectralMeasurement ( bool  enable = true)
inherited

Enable or Disable the Spectral Measurement.

This method enables or disables the spectral measurement by setting or clearing the SP_EN bit in the Enable register (ksfAS7343RegEnable).

Parameters
enableTrue to enable the spectral measurement, false to disable.
Returns
True if successful, false if it fails.

◆ enableWaitTime()

bool sfDevAS7343::enableWaitTime ( bool  enable = true)
inherited

Enable or Disable Wait Time.

This method enables or disables the wait time by setting or clearing the WEN bit in the Enable register (ksfAS7343RegEnable).

Parameters
enableTrue to enable the wait time, false to disable.
Returns
True if successful, false if it fails.

◆ getBlue()

uint16_t sfDevAS7343::getBlue ( void  )
inherited

Get Blue spectrum data. (aka channel FZ, 450nm)

Returns
The blue spectrum data.

◆ getChannelData()

uint16_t sfDevAS7343::getChannelData ( sfe_as7343_channel_t  channel)
inherited

Get Specific Channel of Spectrum Data.

Parameters
channelThe channel to get the data from. (sfe_as7343_channel_t)

Options: CH_BLUE_FZ_450NM, CH_GREEN_FY_555NM, CH_ORANGE_FXL_600NM, CH_NIR_855NM, CH_VIS_1, CH_FD_1, CH_DARK_BLUE_F2_425NM, CH_LIGHT_BLUE_F3_475NM, CH_BLUE_F4_515NM, CH_BROWN_F6_640NM, CH_VIS_2, CH_FD_2, CH_PURPLE_F1_405NM, CH_RED_F7_690NM, CH_DARK_RED_F8_745NM, CH_GREEN_F5_550NM, CH_VIS_3, CH_FD_3.

Returns
The data from the specified channel. Returns 0 on error or if the channel is invalid.

◆ getData() [1/2]

uint8_t sfDevAS7343::getData ( uint16_t *  data,
size_t  size 
)
inherited

Get data from the sensor using a pointer to an array and the desired data length.

You must call the readSpectraDataFromSensor() method before calling this method to get the most recent data from the specified channel.

Parameters
dataPointer to the array to store the data.
sizeSize of the array.
See also
readSpectraDataFromSensor()
getChannelData()
Returns
The number of channel data bytes written to the desired array pointer

◆ getData() [2/2]

uint8_t sfDevAS7343::getData ( uint16_t  data[ksfAS7343NumChannels])
inlineinherited

◆ getDeviceAddress()

uint8_t SfeAS7343ArdI2C::getDeviceAddress ( void  )
inline

Gets the currently configured I2C address of the AS7343 sensor.

Returns the I2C address currently being used to communicate with the sensor.

Returns
uint8_t The current I2C address

Example:

uint8_t address = sensor.getDeviceAddress();
Serial.print("Current I2C address: 0x");
Serial.println(address, HEX);
uint8_t getDeviceAddress(void)
Gets the currently configured I2C address of the AS7343 sensor.
Definition: SparkFun_AS7343.h:158

◆ getDeviceID()

uint8_t sfDevAS7343::getDeviceID ( void  )
inherited

Requests the device ID from the sensor.

Returns
The device ID of the sensor.

◆ getFlickerDetectionFrequency()

uint8_t sfDevAS7343::getFlickerDetectionFrequency ( void  )
inherited

Get the Flicker Detection Frequency Detected.

This method gets the flicker detection frequency detected by reading the FD_100HZ_DET and FD_120HZ_DET bits in the FD_STATUS register (ksfAS7343RegFdStatus).

Returns
The flicker detection frequency detected (100 or 120) or 0 if no frequency is detected.

◆ getGPIOInputStatus()

bool sfDevAS7343::getGPIOInputStatus ( void  )
inherited

Get the GPIO input status.

This method gets the GPIO input status by reading the GPIO_IN bit in the GPIO register (ksfAS7343RegGpio).

Returns
True if the GPIO input is reading HIGH, false if it is reading LOW.

◆ getGreen()

uint16_t sfDevAS7343::getGreen ( void  )
inherited

Get Green spectrum data. (aka channel F5, 550nm)

Returns
The green spectrum data.

◆ getNIR()

uint16_t sfDevAS7343::getNIR ( void  )
inherited

Get NIR spectrum data. (aka channel NIR, 855nm)

Returns
The NIR spectrum data.

◆ getRed()

uint16_t sfDevAS7343::getRed ( void  )
inherited

Get Red spectrum data. (aka channel F7, 690nm)

Returns
The red spectrum data.

◆ getSpectralChannelInterruptStatus()

bool sfDevAS7343::getSpectralChannelInterruptStatus ( void  )
inherited

Get the Spectral Channel Interrupt Status.

This method gets the spectral channel interrupt status by reading the AINT bit in the STATUS register (ksfAS7343RegStatus).

Returns
True if the spectral channel interrupt is set, false if it is not set.

◆ getSpectralInterruptHighStatus()

bool sfDevAS7343::getSpectralInterruptHighStatus ( void  )
inherited

Get the Spectral Interrupt High Status.

This method gets the spectral interrupt high status by reading the INT_PS_H bit in the STATUS3 register (ksfAS7343RegStatus3).

Returns
True if the spectral interrupt high is set, false if it is not set.

◆ getSpectralTriggerErrorStatus()

bool sfDevAS7343::getSpectralTriggerErrorStatus ( void  )
inherited

Get the Spectral Trigger Error Status.

This method gets the spectral trigger error status by reading the SP_TRIG bit in the STATUS4 register (ksfAS7343RegStatus4).

Returns
True if the spectral trigger error is set, false if it is not set.

◆ getSpectralValidStatus()

bool sfDevAS7343::getSpectralValidStatus ( void  )
inherited

Get the Spectral Valid Status.

This method gets the spectral valid status by reading the AVALID bit in the STATUS2 register (ksfAS7343RegStatus2).

Returns
True if the spectral valid status is set, false if it is not set.

◆ getSystemInterruptStatus()

bool sfDevAS7343::getSystemInterruptStatus ( void  )
inherited

Get the System Interrupt Status.

This method gets the system interrupt status by reading the SINT bit in the STATUS register (ksfAS7343RegStatus).

Returns
True if the system interrupt is set, false if it is not set.

◆ getWaitTime()

uint8_t sfDevAS7343::getWaitTime ( void  )
inherited

Get the Spectral Measurement Wait Time.

This method gets the spectral measurement wait time by reading the WTIME register (ksfAS7343RegWTime).

Returns
The spectral measurement wait time.

The value is in units of 2.78ms. The default value is 0x00.

◆ isConnected()

bool SfeAS7343ArdI2C::isConnected ( void  )
inline

Checks if the AS7343 sensor is connected and responding.

This method performs two checks:

  1. Attempts to ping the device at the current I2C address
  2. Verifies the device ID matches the expected AS7343 ID
Returns
true If device responds to ping and returns correct device ID
false If communication fails or device ID is incorrect

Example:

if (!sensor.isConnected()) {
Serial.println("Device not found or incorrect ID!");
return;
}
bool isConnected(void)
Checks if the AS7343 sensor is connected and responding.
Definition: SparkFun_AS7343.h:133

◆ isFlickerDetectionSaturated()

bool sfDevAS7343::isFlickerDetectionSaturated ( void  )
inherited

Get the Flicker Detection Saturation Detected Status.

This method gets the flicker detection saturation detected status by reading the FD_SATURATION bit in the FD_STATUS register (ksfAS7343RegFdStatus).

Returns
True if the flicker detection saturation is detected, false if it is not detected.

◆ isFlickerDetectionValid()

bool sfDevAS7343::isFlickerDetectionValid ( void  )
inherited

Get the Flicker Detection Measurement Valid Status.

This method gets the flicker detection measurement valid status by reading the FD_MEAS_VALID bit in the FD_STATUS register (ksfAS7343RegFdStatus).

Returns
True if the flicker detection measurement is valid, false if it is not valid.

◆ ledOff()

bool sfDevAS7343::ledOff ( void  )
inherited

Turn off the LED.

This method turns off the LED by calling the ledOn method with false.

Returns
True if successful, false if it fails.

◆ ledOn()

bool sfDevAS7343::ledOn ( bool  ledOn = true)
inherited

Turn on or off the LED.

This method turns on or off the LED by setting or clearing the LED_ACT bit in the LED register (ksfAS7343RegLed).

Parameters
ledOnTrue to turn on the LED, false to turn off.
Returns
True if successful, false if it fails.

◆ powerOff()

bool sfDevAS7343::powerOff ( void  )
inherited

Power off the device.

This method powers off the device by clearing the PON bit in the Enable register (ksfAS7343RegEnable).

Returns
True if successful, false if it fails.

◆ powerOn()

bool sfDevAS7343::powerOn ( bool  power = true)
inherited

Power on or off the device.

This method powers on or off the device by setting or clearing the PON bit in the Enable register (ksfAS7343RegEnable).

Parameters
powerTrue to power on the device, false to power off.
Returns
True if successful, false if it fails.

◆ readIntEnableReg()

uint8_t sfDevAS7343::readIntEnableReg ( void  )
inherited

Read the register INT Enable.

This method reads the INT Enable register (ksfAS7343RegIntEnab).

Returns
The INT Enable register value.

The INT Enable register is a bit field that enables or disables the spectral interrupt, FIFO interrupt, and AGC interrupt.

Returns
The INT Enable register value.

◆ readRegisterBank()

bool sfDevAS7343::readRegisterBank ( uint8_t  reg,
uint8_t &  data 
)
inherited

Read a register from the device.

This method reads a register from the device

Parameters
regThe register to read.
dataPointer to the register data to read into.
Returns
True if successful, false if it fails.

◆ readSpectraDataFromSensor()

bool sfDevAS7343::readSpectraDataFromSensor ( void  )
inherited

Read all Spectral Data Registers.

This method reads all the spectral data registers from the AS7343 device. The data is stored in this drivers private struct variables.

The data is stored in the _data array in the class. You can access the data using the getData() method, which returns the data from the specified channel. Another option is to use the getRed(), getGreen(), getBlue(), and getNIR() methods to get only those channels.

Returns
True if successful, false if it fails.

◆ reset()

bool sfDevAS7343::reset ( void  )
inherited

Reset the device.

This method resets the device by writing to the SW_RESET bit in the CONTROL register (ksfAS7343RegControl).

Returns
True if successful, false if it fails.

◆ setAgain()

bool sfDevAS7343::setAgain ( sfe_as7343_again_t  again)
inherited

Brief Set AGAIN value

This method sets the AGAIN value by writing to the AGAIN bits in the CFG1 register (ksfAS7343RegCfg1).

Parameters
againThe AGAIN value to set.

Options: AGAIN_0_5X (default), AGAIN_1X, AGAIN_2X, AGAIN_4X, AGAIN_8X, AGAIN_16X, AGAIN_32X, AGAIN_64X.

Returns
True if successful, false if it fails.

◆ setAutoSmux()

bool sfDevAS7343::setAutoSmux ( sfe_as7343_auto_smux_channel_t  auto_smux)
inherited

Set automatic channel read-out.

This method sets the automatic channel read-out mode. The auto_smux setting in the CFG20 register (0xD6) can be set to 6, 12, or 18 channels. The default is 6 channels.

Parameters
auto_smuxThe automatic channel read-out setting.

Options: AUTOSMUX_6_CH (default), AUTOSMUX_12_CH, AUTOSMUX_18_CHANNELS.

Returns
True if successful, false if it fails.

◆ setCommunicationBus()

void sfDevAS7343::setCommunicationBus ( sfTkIBus *  theBus)
inherited

Sets the communication bus to the specified bus.

Parameters
theBusBus to set as the communication device.

◆ setGPIOMode()

bool sfDevAS7343::setGPIOMode ( sfe_as7343_gpio_mode_t  gpioMode)
inherited

Set the GPIO pin mode.

This method sets the GPIO pin mode by writing to the GPIO_IN_EN and GPIO_OUT bits in the GPIO register (ksfAS7343RegGpio).

Parameters
gpioModeThe GPIO pin mode to set.

Options: AS7343_GPIO_MODE_INPUT (default), AS7343_GPIO_MODE_OUTPUT.

Returns
True if successful, false if it fails.

◆ setGPIOOutput()

bool sfDevAS7343::setGPIOOutput ( sfe_as7343_gpio_output_t  gpioOut)
inherited

Set the GPIO output.

This method sets the GPIO output by writing to the GPIO_OUT bit in the GPIO register (ksfAS7343RegGpio).

Parameters
gpioOutThe GPIO output to set.

Options: AS7343_GPIO_OUTPUT_LOW (default), AS7343_GPIO_OUTPUT_HIGH.

Returns
True if successful, false if it fails.

◆ setLedDrive()

bool sfDevAS7343::setLedDrive ( uint8_t  ledDrive)
inherited

Set the LED drive current.

This method sets the LED drive current by writing to the LED register (ksfAS7343RegLed). The LED drive current is set by writing to the LED_DRIVE bits in the LED register.

Parameters
ledDriveThe LED drive current to set.

Options: 0-127. (4-258mA) The drive current can be set to values of 0-127 (0-258 mA). 0 = 4mA, 1 = 6mA, 2 = 8mA, ... 127 = 258mA. default is 12mA.

Returns
True if successful, false if it fails.

◆ setRegisterBank()

bool sfDevAS7343::setRegisterBank ( sfe_as7343_reg_bank_t  regBank)
inherited

Set the register bank. In order to access registers from 0x58 to 0x66, bit REG_BANK in register CFG0 (0xBF) needs to be set to “1”. For register access of registers 0x80 and above bit REG_BANK needs to be set to “0”

Parameters
regBankThe register bank to set.

Options: REG_BANK_0 (default), REG_BANK_1.

Returns
True if successful, false if it fails.

◆ setSpectralIntPersistence()

bool sfDevAS7343::setSpectralIntPersistence ( uint8_t  apers)
inherited

Set the Spectral Interrupt Persistence.

This method sets the spectral interrupt persistence by writing to the PERS bits in the PERS register (ksfAS7343RegPers).

Parameters
apersThe spectral interrupt persistence to set.

Options: 0 = Every spectral cycle generates an interrupt. 1 = 1 2 = 2 3 = 3 4 = 5 5 = 10 ... 5*(APERS - 3) 14 = 55 15 = 60

The default value is 0x00.

Returns
True if successful, false if it fails.

◆ setSpectralIntThresholdHigh()

bool sfDevAS7343::setSpectralIntThresholdHigh ( uint16_t  spThH)
inherited

Set the spectral interrupt threshold high.

This method sets the spectral threshold high by writing to the SP_TH_H register (ksfAS7343RegSpThH). The spectral threshold high is set by writing to the SP_TH_H_LSB Register and SP_TH_H_MSB Register.

Parameters
spThHThe spectral threshold high to set.
Returns
True if successful, false if it fails.

◆ setSpectralIntThresholdLow()

bool sfDevAS7343::setSpectralIntThresholdLow ( uint16_t  spThL)
inherited

Set the spectral interrupt threshold low.

This method sets the spectral threshold low by writing to the SP_TH_L register (ksfAS7343RegSpThL). The spectral threshold low is set by writing to the SP_TH_L_LSB Register and SP_TH_L_MSB Register.

Parameters
spThLThe spectral threshold low to set.
Returns
True if successful, false if it fails.

◆ setSpectralThresholdChannel()

bool sfDevAS7343::setSpectralThresholdChannel ( sfe_as7343_spectral_threshold_channel_t  spThCh)
inherited

Set the spectral threshold channel.

This method sets the spectral threshold channel by writing to the SP_TH_CH bits [2:0] in the CFG12 register, ksfAS7343RegCfg12 (0x66).

Parameters
spThChThe spectral threshold channel to set.

Options: SPECTRAL_THRESHOLD_CHANNEL_0 (default), SPECTRAL_THRESHOLD_CHANNEL_1, SPECTRAL_THRESHOLD_CHANNEL_2, SPECTRAL_THRESHOLD_CHANNEL_3, SPECTRAL_THRESHOLD_CHANNEL_4, SPECTRAL_THRESHOLD_CHANNEL_5.

Returns
True if successful, false if it fails.

◆ setWaitTime()

bool sfDevAS7343::setWaitTime ( uint8_t  wTime)
inherited

Set the Spectral Measurement Wait Time.

This method sets the spectral measurement wait time by writing to the WTIME register (ksfAS7343RegWTime).

Parameters
wTimeThe spectral measurement wait time to set.

8-bit value to specify the delay between two consecutive spectral measurements. The value is in units of 2.78ms. The default value is 0x00.

Returns
True if successful, false if it fails.

The documentation for this class was generated from the following file: