flux sdk  v01.05.00-3-gedf3296
Embedded C++ SDK
Loading...
Searching...
No Matches
flxDevAS7343 Class Reference

#include <flxDevAS7343.h>

Inheritance diagram for flxDevAS7343:
flxDeviceI2CType< flxDevAS7343 > flxDevice flxOperation flxObject _flxParameterContainer flxPersist _flxPropertyContainer flxDescriptor

Public Member Functions

 flxDevAS7343 ()
 Constructor. More...
 
bool onInitialize (TwoWire &)
 Called during the startup/initialization of the driver (after the constructor is called). More...
 
bool execute (void)
 Called right before data parameters are read - take measurements called. More...
 
- Public Member Functions inherited from flxDeviceI2CType< flxDevAS7343 >
virtual uint8_t getDefaultAddress (void)
 
bool initialize (TwoWire &wirePort)
 
bool initialize (flxBusI2C &i2cDriver)
 
bool initialize (void)
 
bool initialize (uint8_t address)
 
virtual bool onInitialize (TwoWire &)
 
flxTypeID getType (void)
 
bool isType (flxTypeID type)
 
flxDeviceKind_t getKind (void)
 
- Public Member Functions inherited from flxDevice
 flxDevice ()
 
virtual ~flxDevice ()
 
virtual bool execute (void)
 Virtual method called to run the operation - called before data is retrieved. More...
 
bool initialize ()
 
virtual bool initialize (flxBusI2C &)
 
virtual bool initialize (flxBusSPI &)
 
bool autoload (void)
 
void setAutoload ()
 
void setAddress (uint8_t address)
 
uint8_t address (void)
 
void addAddressToName ()
 
void setIsInitialized (bool isInit)
 
bool isInitialized (void)
 
virtual flxDeviceKind_t getKind (void)
 
- Public Member Functions inherited from flxOperation
virtual flxTypeID getType (void)
 
virtual bool execute (void)
 Virtual method called to run the operation - called before data is retrieved. More...
 
virtual bool onSave (flxStorageBlock *stBlk)
 
virtual bool onRestore (flxStorageBlock *stBlk)
 
- Public Member Functions inherited from flxObject
 flxObject ()
 
virtual ~flxObject ()
 
virtual size_t n_children (void)
 
void setParent (flxObject *parent)
 
void setParent (flxObject &parent)
 
flxObjectparent ()
 
void setHidden (bool bHide=true)
 
bool hidden ()
 
void setIsDirty (bool bDirty=true)
 
bool isDirty (void)
 
virtual bool onSave (flxStorageBlock *stBlk)
 
virtual bool save (flxStorage *pStorage)
 
virtual void restoreComplete (void)
 
virtual bool onRestore (flxStorageBlock *stBlk)
 
virtual bool restore (flxStorage *pStorage)
 
virtual flxTypeID getType (void)
 
virtual bool save (flxStorage *)=0
 
virtual bool restore (flxStorage *)=0
 
- Public Member Functions inherited from _flxPropertyContainer
 _flxPropertyContainer ()
 
void addProperty (flxProperty *newProperty)
 
void addProperty (flxProperty &newProperty)
 
void removeProperty (flxProperty *rmProp)
 
bool containsProperty (flxProperty *prop)
 
void removeProperty (flxProperty &rmProp)
 
flxPropertyListgetProperties (void)
 
uint nProperties (void)
 
bool saveProperties (flxStorageBlock *stBlk)
 
bool restoreProperties (flxStorageBlock *stBlk)
 
size_t propertySaveSize ()
 
void hideProperty (flxProperty &theProp)
 
- Public Member Functions inherited from flxDescriptor
 flxDescriptor ()
 
void setName (const char *new_name)
 Set the Name object - storing the pointer to the provided string No allocation is performed. If the previous name was allocated, it is freed. More...
 
void setName (const char *new_name, const char *new_desc)
 Set the Name object and the Description for the object. Both strings are constants. More...
 
void setName (char *new_name)
 Set the Name object, but makes a copy of the input string since the input is not const. If the previous name was allocated, it is freed. More...
 
const char * name ()
 Return a const char pointer to the name of the object. More...
 
std::string name_ (void)
 Returns a std::string of the name of the object. More...
 
void setDescription (const char *new_desc)
 Set the Description object - the input value is constant and not copied. If the previous description was allocated, it is freed. More...
 
void setDescription (char *new_desc)
 Set the Description object - the input value is not constant and is copied. If the previous description was allocated, it is freed. More...
 
const char * description ()
 Return the constant C string pointer to the description of the object. More...
 
std::string description_ (void)
 Return the description of the object as a std::string. More...
 
void setTitle (const char *title)
 Set the Title object - the title is optional and is used mostly for UX or organizational purposes. The input value is constant and not copied. If the previous title was allocated, it is freed. More...
 
void setTitleAlloc (char *new_title)
 Set the Title of the object , but make an explict copy of the provided string. More...
 
const char * title (void)
 Return the C constant string pointer to the title of the object. More...
 
- Public Member Functions inherited from _flxParameterContainer
void addParameter (flxParameterIn *newParam, bool head=false)
 
void addParameter (flxParameterIn &newParam, bool head=false)
 
void removeParameter (flxParameterIn *rmParam)
 
void removeParameter (flxParameterIn &rmParam)
 
size_t nInputParameters ()
 
void addParameter (flxParameterOut *newParam, bool head=false)
 
void addParameter (flxParameterOut &newParam, bool head=false)
 
void removeParameter (flxParameterOut *rmParam)
 
void removeParameter (flxParameterOut &rmParam)
 
size_t nOutputParameters ()
 
flxParameterOutListgetOutputParameters (void)
 
flxParameterInListgetInputParameters (void)
 

Static Public Member Functions

static bool isConnected (flxBusI2C &i2cDriver, uint8_t address)
 Static method called to determine if device is connected. More...
 
static flxDeviceConfidence_t connectedConfidence (void)
 
static const char * getDeviceName ()
 
static const uint8_t * getDefaultAddresses ()
 
- Static Public Member Functions inherited from flxDeviceI2CType< flxDevAS7343 >
static flxTypeID type (void)
 
static flxDeviceKind_t kind (void)
 
- Static Public Member Functions inherited from flxObject
static flxTypeID type (void)
 

Public Attributes

flxPropertyBool< flxDevAS7343readWithLED = {true}
 
flxPropertyRWBool< flxDevAS7343, &flxDevAS7343::get_read_spectra, &flxDevAS7343::set_read_spectra > readSpectra
 
flxPropertyRWBool< flxDevAS7343, &flxDevAS7343::get_flicker_detect, &flxDevAS7343::set_flicker_detect > flickerDetect = {false}
 
flxPropertyRWUInt16< flxDevAS7343, &flxDevAS7343::get_gain, &flxDevAS7343::set_gain > sensorGain
 
flxPropertyRWUInt16< flxDevAS7343, &flxDevAS7343::get_led_drive, &flxDevAS7343::set_led_drive > ledDriveCurrent
 
flxParameterOutUInt16< flxDevAS7343, &flxDevAS7343::get_blue_value > blueValue
 
flxParameterOutUInt16< flxDevAS7343, &flxDevAS7343::get_green_value > greenValue
 
flxParameterOutUInt16< flxDevAS7343, &flxDevAS7343::get_red_value > redValue
 
flxParameterOutUInt16< flxDevAS7343, &flxDevAS7343::get_nir_value > nirValue
 
flxParameterOutUInt8< flxDevAS7343, &flxDevAS7343::get_flicker_value > flickerValue
 
flxParameterOutArrayUInt16< flxDevAS7343, &flxDevAS7343::get_spectral_data > spectralData
 
- Public Attributes inherited from flxDevice
flxParameterInVoid< flxDevice, &flxDevice::disable_all_parameters > disableAllParameters
 
flxParameterInVoid< flxDevice, &flxDevice::enable_all_parameters > enableAllParameters
 

Static Public Attributes

static uint8_t defaultDeviceAddress [] = {kAS7343Addr, kSparkDeviceAddressNull}
 

Additional Inherited Members

- Protected Attributes inherited from flxDescriptor
const char * _name
 
bool _nameAlloc
 
const char * _desc
 
bool _descAlloc
 
const char * _title
 
bool _titleAlloc
 

Constructor & Destructor Documentation

◆ flxDevAS7343()

flxDevAS7343::flxDevAS7343 ( )

Constructor.

Member Function Documentation

◆ connectedConfidence()

static flxDeviceConfidence_t flxDevAS7343::connectedConfidence ( void  )
inlinestatic

◆ execute()

bool flxDevAS7343::execute ( void  )
virtual

Called right before data parameters are read - take measurements called.

Reimplemented from flxDevice.

◆ getDefaultAddresses()

static const uint8_t * flxDevAS7343::getDefaultAddresses ( )
inlinestatic

◆ getDeviceName()

static const char * flxDevAS7343::getDeviceName ( )
inlinestatic

◆ isConnected()

bool flxDevAS7343::isConnected ( flxBusI2C i2cDriver,
uint8_t  address 
)
static

Static method called to determine if device is connected.

Parameters
i2cDriver- Framework i2c bus driver
address- The address to check
Returns
true if the device is connected

◆ onInitialize()

bool flxDevAS7343::onInitialize ( TwoWire &  wirePort)
virtual

Called during the startup/initialization of the driver (after the constructor is called).

Parameters
wirePort- The Arduino wire port for the I2C bus
Returns
true on success

Reimplemented from flxDeviceI2CType< flxDevAS7343 >.

Member Data Documentation

◆ blueValue

flxParameterOutUInt16<flxDevAS7343, &flxDevAS7343::get_blue_value> flxDevAS7343::blueValue

◆ defaultDeviceAddress

uint8_t flxDevAS7343::defaultDeviceAddress = {kAS7343Addr, kSparkDeviceAddressNull}
static

◆ flickerDetect

flxPropertyRWBool<flxDevAS7343, &flxDevAS7343::get_flicker_detect, &flxDevAS7343::set_flicker_detect> flxDevAS7343::flickerDetect = {false}

◆ flickerValue

flxParameterOutUInt8<flxDevAS7343, &flxDevAS7343::get_flicker_value> flxDevAS7343::flickerValue

◆ greenValue

flxParameterOutUInt16<flxDevAS7343, &flxDevAS7343::get_green_value> flxDevAS7343::greenValue

◆ ledDriveCurrent

flxPropertyRWUInt16<flxDevAS7343, &flxDevAS7343::get_led_drive, &flxDevAS7343::set_led_drive> flxDevAS7343::ledDriveCurrent
Initial value:
= {
12, 4, 258}

◆ nirValue

flxParameterOutUInt16<flxDevAS7343, &flxDevAS7343::get_nir_value> flxDevAS7343::nirValue

◆ readSpectra

flxPropertyRWBool<flxDevAS7343, &flxDevAS7343::get_read_spectra, &flxDevAS7343::set_read_spectra> flxDevAS7343::readSpectra
Initial value:
= {
true}

◆ readWithLED

flxPropertyBool<flxDevAS7343> flxDevAS7343::readWithLED = {true}

◆ redValue

flxParameterOutUInt16<flxDevAS7343, &flxDevAS7343::get_red_value> flxDevAS7343::redValue

◆ sensorGain

flxPropertyRWUInt16<flxDevAS7343, &flxDevAS7343::get_gain, &flxDevAS7343::set_gain> flxDevAS7343::sensorGain
Initial value:
= {
AGAIN_256,
{{"0.5", AGAIN_0_5},
{"1.0", AGAIN_1},
{"2.0", AGAIN_2},
{"4.0", AGAIN_4},
{"8.0", AGAIN_8},
{"16.0", AGAIN_16},
{"32.0", AGAIN_32},
{"64.0", AGAIN_64},
{"128.0", AGAIN_128},
{"256.0", AGAIN_256},
{"512.0", AGAIN_512},
{"1024.0", AGAIN_1024},
{"2048.0", AGAIN_2048}}}

◆ spectralData

flxParameterOutArrayUInt16<flxDevAS7343, &flxDevAS7343::get_spectral_data> flxDevAS7343::spectralData

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