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.
phaseTempCoffC Class Reference
Class that holds phase temperature coefficient related registers and values. More...
#include <OPT3101DesignCoefficients.h>
Public Member Functions | |
| phaseTempCoffC () | |
| initializes the members to 0 | |
| void | calculateCoff (frameData *frameData0, frameData *frameData1, bool istMainCoff=true) |
| calculates the phase temp coff | |
| void | report () |
| reports members of the instance Print the members of the class instance on screen | |
| void | storeToFile (char *fileName) |
| saves phase temp coff values to file This methods saves the phase temp coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration | |
| void | loadFromFile (char *fileName) |
| load phase temp coff values from file This methods loads the phase temp coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration | |
Data Fields | |
| double | coff |
| Coefficient stores in floating point precision.Units for this measurement is OPT3101::frameData::phase codes (16 bit level) codes change per unit of temperature sensor codes (OPT3101::registers::tmain or OPT3101::registers::tillum based on OPT3101::phaseTempCoffC::istMainCoff. | |
| uint16_t | coffReg |
| Coefficient value of OPT3101::phaseTempCoffC::coff represented as 16bit register setting. | |
| uint8_t | commonScale |
| Common scale of OPT3101::phaseTempCoffC::coffReg calculated based on various OPT3101::phaseTempCoffC class instances. This is calculated by OPT3101::calibrationC::findPhaseTempRegisterValues during production calibration. | |
| bool | istMainCoff |
| Flag which determines if the coefficient was obtained using OPT3101::registers::tmain difference or OPT3101::registers::tillum. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const phaseTempCoffC *data) |
| Operator overload to store class contents to a file Casts all the class members for file storage. | |
| std::istream & | operator>> (std::istream &is, phaseTempCoffC *data) |
| Operator overload to load class contents to from a file Retrieves all the class members from a stored file. | |
Detailed Description
Class that holds phase temperature coefficient related registers and values.
This is a class container that can hold phase/phase offset temperature coefficients and related register values. OPT3101 AFE phase measurement drifts over temperature. This drift is primarily due to change in delay in the path of the TX channels. The drift will show up in OPT3101::frameData::phase measurement which will translate to error in measurement.
OPT3101 has mechanism to compensate the output for this drift, for which phase temperature coefficient is required. Either internal temp sensor or external temperature sensor can be used to compensate for this. This class acts as a temporary storage of phase temp coefficients and related registers. Calculations have to be made on the phase offsets and frame data, coefficients to transform them to register settings. Instances of OPT3101::frameData taken at different temperature will be used to calculate these coefficients and registers.
Definition at line 131 of file OPT3101DesignCoefficients.h.
Constructor & Destructor Documentation
| phaseTempCoffC | ( | ) |
initializes the members to 0
- Returns:
- Nothing;
Algorithm of the method is as follows
* Initializes all members to 0. Sets OPT3101::phaseTempCoffC::istMainCoff to true
Definition at line 137 of file OPT3101DesignCoefficients.cpp.
Member Function Documentation
| void calculateCoff | ( | OPT3101::frameData * | frameData0, |
| OPT3101::frameData * | frameData1, | ||
| bool | istMainCoff = true |
||
| ) |
calculates the phase temp coff
- Parameters:
-
[in] frameData0; Pointer to frame data OPT3101::frameData instance measured at a lower temperature [in] frameData1; Pointer to frame data OPT3101::frameData instance measured at a higher temperature [in] istMainCoff; istMainCoff specifies if the calculation should be done with Tmain Coff
- Returns:
- Nothing;
Algorithm of the method is as follows
* Makes the data base circular to avoid errorneous high slope measurements
* Assigns OPT3101::phaseTempCoffC::istMainCoff to the value assigned by argument
* Calculates the double precision OPT3101::phaseTempCoffC::coff by finding difference between OPT3101::frameData::phase divided by delta OPT3101::frameData::tmain or OPT3101::frameData::tillum based on input flag
* Warning: Makes the OPT3101::phaseTempCoffC::coff 0 if the OPT3101::frameData::tmain or OPT3101::frameData::tillum are same for both the input arguments
Definition at line 146 of file OPT3101DesignCoefficients.cpp.
| void loadFromFile | ( | char * | fileName ) |
load phase temp coff values from file This methods loads the phase temp coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration
- Parameters:
-
[in] fileName; Path and name of the file from where to load
- Returns:
- Nothing;
Algorithm of the method is as follows
* User needs to implement file load/restore based on host.
Definition at line 201 of file OPT3101DesignCoefficients.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.
* Prints all the members and values of members on screen.
Definition at line 173 of file OPT3101DesignCoefficients.cpp.
| void storeToFile | ( | char * | fileName ) |
saves phase temp coff values to file This methods saves the phase temp coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration
- Parameters:
-
[in] fileName; Path and name of the file to store
- Returns:
- Nothing;
Algorithm of the method is as follows
* User needs to implement file storage based on host.
Definition at line 189 of file OPT3101DesignCoefficients.cpp.
Friends And Related Function Documentation
| std::ostream& operator<< | ( | std::ostream & | os, |
| const phaseTempCoffC * | data | ||
| ) | [friend] |
Operator overload to store class contents to a file Casts all the class members for file storage.
- Parameters:
-
[out] os; os is data stream to serialize data [in] data; data is pointer to the class to be serialized and stored
- Returns:
- std::ostream; Serialized std::ostream to be written to a file
| std::istream& operator>> | ( | std::istream & | is, |
| phaseTempCoffC * | data | ||
| ) | [friend] |
Operator overload to load class contents to from a file Retrieves all the class members from a stored file.
- Parameters:
-
[in] is; is input stream from where the data is loaded [out] data; data is pointer to the class to be restored
- Returns:
- std::istream; Serialized Input stream loaded from file
Field Documentation
| double coff |
Coefficient stores in floating point precision.Units for this measurement is OPT3101::frameData::phase codes (16 bit level) codes change per unit of temperature sensor codes (OPT3101::registers::tmain or OPT3101::registers::tillum based on OPT3101::phaseTempCoffC::istMainCoff.
Definition at line 133 of file OPT3101DesignCoefficients.h.
| uint16_t coffReg |
Coefficient value of OPT3101::phaseTempCoffC::coff represented as 16bit register setting.
Definition at line 134 of file OPT3101DesignCoefficients.h.
| uint8_t commonScale |
Common scale of OPT3101::phaseTempCoffC::coffReg calculated based on various OPT3101::phaseTempCoffC class instances. This is calculated by OPT3101::calibrationC::findPhaseTempRegisterValues during production calibration.
Definition at line 135 of file OPT3101DesignCoefficients.h.
| bool istMainCoff |
Flag which determines if the coefficient was obtained using OPT3101::registers::tmain difference or OPT3101::registers::tillum.
Definition at line 136 of file OPT3101DesignCoefficients.h.
Generated on Sun Jul 17 2022 05:22:03 by
1.7.2