Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
calibrationC Class Reference
OPT3101 systems require various calibrations for accurate measurement. More...
#include <OPT3101Calibration.h>
Public Member Functions | |
calibrationC (bool dummyFlag) | |
Dummy function for documentation This function is to just document the functionality of the constructor. | |
calibrationC () | |
Constructor for class OPT3101::calibrationC Constructor definition for which comes from the OPT3101 configurator tool. Allocates memory for all the calibration coefficient classes. Since the actual allocation depends on the configuration of the system, this is generated by the configurator tool. | |
void | findCommonCrosstalkScale (crosstalkC *illumXtalk, bool *txActiveList, bool *registerSetActiveList) |
Finds common crosstalk scale coff to be applied OPT3101 system could consist of multiple TX configuration operating together, switching between each other configurations. In such cases more than 1 illum crosstalk compensation registers needs to be applied however OPT3101 has only one common scale which this method computes. | |
void | findCrosstalkTempRegisterValues (crosstalkTempCoffC *illumXtalkCoff, bool *txActiveList, bool *registerSetActiveList, crosstalkC *illumXtalk) |
Calculates crosstalk temp coefficient registers from floating point precision coefficients OPT3101 system could consist of multiple TX configuration operating together, switching between each other configurations. In such cases more than 1 illum crosstalk temperature compensation registers needs to be applied. OPT3101 has only one common scale which this method computes along with the registers that need to be written to compensate these effects. | |
void | findPhaseTempRegisterValues (phaseTempCoffC *phaseTempCoff, bool *txActiveList, bool *registerSetActiveList, uint16_t freqCount) |
calculates the phase temp coff register values from the floating point coff OPT3101 system could consist of multiple TX configuration operating together, switching between each other configurations. In such cases more than 1 phase temperature compensation registers needs to be applied. OPT3101 has only one common scale which this method computes along with the registers that need to be written to compensate these effects. | |
void | report () |
reports members of the instance Print the members of the class instance on screen | |
Data Fields | |
crosstalkC | internalCrosstalk [1] |
Pointer to analyze and store internal crosstalk class OPT3101::crosstalkC. | |
crosstalkC | illumCrosstalk [3][2] |
Pointer to analyze and store illumination crosstalk class OPT3101::crosstalkC. | |
phaseOffsetC | phaseOffset [3][2] |
Pointer to analyze and store phase offset class OPT3101::phaseOffsetC. | |
crosstalkTempCoffC | illumCrosstalkTempCoff [3][2] |
Pointer to analyze and store crosstalk temperature coefficients OPT3101::crosstalkTempCoffC. | |
phaseTempCoffC | phaseTempCoff [3][2] |
Pointer to analyze and store phase temperature coefficients OPT3101::phaseTempCoffC. | |
phaseAmbientCoffC | phaseAmbientCoff [1] |
Pointer to analyze and store phase ambient coefficients OPT3101::phaseAmbientCoffC. | |
uint8_t | registerAddressList [64] |
List of OPT3101::registers address which needs to be stored as calibration for the system. | |
uint8_t | registerAddressListSize |
Number of OPT3101::registers address that need to be stores as calibration for the system. | |
bool | EEPROM_connected |
Flag to specify if EEPROM is connected to the OPT3101 device. | |
bool | extTempSensor_connected |
Flag to specify if external temperature sensor is connected to the OPT3101 device. | |
uint8_t | recordLength |
Specifies the length of records to be stored for calibration configurations. This is set be OPT3101 configurator tool. |
Detailed Description
OPT3101 systems require various calibrations for accurate measurement.
During the calibration process there are several coefficients which needs to be measured and analyzed. Although the calibration settings can be stored as register settings, they would not be very meaning full to understand and analyze. This class acts as an intermediate translator to measure, store and calibration values. The class also invokes methods to convert the calibration coefficients to register settings to load to the device. There are several members of this class where more than 1 instances of those members are required. The class only contain pointers for these coefficient classes. The constructor definition of this class is generated by OPT3101 configurator tool. The file generated by the tool can be directly imported to this project for a complete operation SDK.
Definition at line 57 of file OPT3101Calibration.h.
Constructor & Destructor Documentation
calibrationC | ( | bool | dummyFlag ) |
Dummy function for documentation This function is to just document the functionality of the constructor.
- Returns:
- Nothing;
Algorithm of the method is as follows Allocates memory for OPT3101::calibrationC::internalCrosstalk size based on system configuration Allocates memory for OPT3101::calibrationC::illumCrosstalk size based on system configuration Allocates memory for OPT3101::calibrationC::phaseOffset size based on system configuration Allocates memory for OPT3101::calibrationC::illumCrosstalkTempCoff size based on system configuration Allocates memory for OPT3101::calibrationC::phaseTempCoff size based on system configuration Allocates memory for OPT3101::calibrationC::phaseAmbientCoff size based on system configuration Sets the member OPT3101::calibrationC::registerAddressListSize based on number of calibration registers requires Allocates memory for OPT3101::calibrationC::registerAddressList based on OPT3101::calibrationC::registerAddressListSize Sets up the flag OPT3101::calibrationC::EEPROM_connected based on configuration Sets up the flag OPT3101::calibrationC::extTempSensor_connected based on configuration
Definition at line 1183 of file OPT3101device_Functions.cpp.
calibrationC | ( | void | ) |
Constructor for class OPT3101::calibrationC Constructor definition for which comes from the OPT3101 configurator tool. Allocates memory for all the calibration coefficient classes. Since the actual allocation depends on the configuration of the system, this is generated by the configurator tool.
Definition at line 131 of file OPT3101_configuration.cpp.
Member Function Documentation
void findCommonCrosstalkScale | ( | OPT3101::crosstalkC * | illumXtalk, |
bool * | txActiveList, | ||
bool * | registerSetActiveList | ||
) |
Finds common crosstalk scale coff to be applied OPT3101 system could consist of multiple TX configuration operating together, switching between each other configurations. In such cases more than 1 illum crosstalk compensation registers needs to be applied however OPT3101 has only one common scale which this method computes.
- Parameters:
-
[in,out] illumXtalk; illumXtalk is pointer to OPT3101::crosstalkC class which contains the list of crosstalk instances for which the common coefficient needs to be calculated. [in] txActiveList; [in] registerSetActiveList;
- Returns:
- Nothing;
Algorithm of the method is as follows
* Finds the largest scale what will fit all the input OPT3101::crosstalkC arguments
* Assigns the identified maxScale to all the input argument illum Crosstalk pointers OPT3101::crosstalkC
Definition at line 1165 of file OPT3101device_Functions.cpp.
void findCrosstalkTempRegisterValues | ( | OPT3101::crosstalkTempCoffC * | illumXtalkCoff, |
bool * | txActiveList, | ||
bool * | registerSetActiveList, | ||
OPT3101::crosstalkC * | illumXtalk | ||
) |
Calculates crosstalk temp coefficient registers from floating point precision coefficients OPT3101 system could consist of multiple TX configuration operating together, switching between each other configurations. In such cases more than 1 illum crosstalk temperature compensation registers needs to be applied. OPT3101 has only one common scale which this method computes along with the registers that need to be written to compensate these effects.
- Parameters:
-
[in,out] illumXtalkCoff; illumXtalkCoff is pointer to OPT3101::crosstalkTempCoffC class which contains the list of crosstalk temp coefficients for which the register values needs to be calculated. [in] txActiveList; [in] registerSetActiveList; [in] illumXtalk; illumXtalk is pointer to OPT3101::crosstalkTempCoffC class which contains the list of crosstalk instances for which the common coefficient needs to be calculated. This is mainly required to scale the crosstalk values with magnitude
- Returns:
- Nothing;
Definition at line 31 of file OPT3101Calibration.cpp.
void findPhaseTempRegisterValues | ( | OPT3101::phaseTempCoffC * | phaseTempCoff, |
bool * | txActiveList, | ||
bool * | registerSetActiveList, | ||
uint16_t | freqCount | ||
) |
calculates the phase temp coff register values from the floating point coff OPT3101 system could consist of multiple TX configuration operating together, switching between each other configurations. In such cases more than 1 phase temperature compensation registers needs to be applied. OPT3101 has only one common scale which this method computes along with the registers that need to be written to compensate these effects.
- Parameters:
-
[in,out] phaseTempCoff; phaseTempCoff is pointer to OPT3101::phaseTempCoffC class which contains the list of phase temp coefficients for which the register values needs to be calculated. [in] txActiveList; [in] registerSetActiveList; [in] freqCount; freqCount is frequency count register read from OPT3101::registers::freq_count_read_reg. This is used to scale the coefficients accordingly
- Returns:
- Nothing;
Algorithm of the method is as follows
* Identifies max of absolute of OPT3101::phaseTempCoffC::coff values
* scales the max coefficient with input frequencyCount
* Finds a OPT3101::phaseTempCoffC::commonScale which can fit the OPT3101::phaseTempCoffC::coff to 12 bit registers
* Finds OPT3101::phaseTempCoffC::coffReg values (12 bit register values) based on OPT3101::phaseTempCoffC::coff and OPT3101::phaseTempCoffC::commonScale
Definition at line 66 of file OPT3101Calibration.cpp.
void report | ( | ) |
reports members of the instance Print the members of the class instance on screen
- Returns:
- Nothing;
Algorithm of the method is as follows
* Prints all the members and values of members on screen.
Definition at line 93 of file OPT3101Calibration.cpp.
Field Documentation
bool EEPROM_connected |
Flag to specify if EEPROM is connected to the OPT3101 device.
Definition at line 67 of file OPT3101Calibration.h.
Flag to specify if external temperature sensor is connected to the OPT3101 device.
Definition at line 68 of file OPT3101Calibration.h.
crosstalkC illumCrosstalk[3][2] |
Pointer to analyze and store illumination crosstalk class OPT3101::crosstalkC.
Definition at line 60 of file OPT3101Calibration.h.
Pointer to analyze and store crosstalk temperature coefficients OPT3101::crosstalkTempCoffC.
Definition at line 62 of file OPT3101Calibration.h.
Pointer to analyze and store internal crosstalk class OPT3101::crosstalkC.
Definition at line 59 of file OPT3101Calibration.h.
Pointer to analyze and store phase ambient coefficients OPT3101::phaseAmbientCoffC.
Definition at line 64 of file OPT3101Calibration.h.
phaseOffsetC phaseOffset[3][2] |
Pointer to analyze and store phase offset class OPT3101::phaseOffsetC.
Definition at line 61 of file OPT3101Calibration.h.
phaseTempCoffC phaseTempCoff[3][2] |
Pointer to analyze and store phase temperature coefficients OPT3101::phaseTempCoffC.
Definition at line 63 of file OPT3101Calibration.h.
uint8_t recordLength |
Specifies the length of records to be stored for calibration configurations. This is set be OPT3101 configurator tool.
Definition at line 69 of file OPT3101Calibration.h.
uint8_t registerAddressList[64] |
List of OPT3101::registers address which needs to be stored as calibration for the system.
Definition at line 65 of file OPT3101Calibration.h.
uint8_t registerAddressListSize |
Number of OPT3101::registers address that need to be stores as calibration for the system.
Definition at line 66 of file OPT3101Calibration.h.
Generated on Sun Jul 17 2022 05:22:03 by
