Export to MBED Studio for DISCO Board

Dependencies:   mbed

Committer:
tgrosch
Date:
Sun Oct 25 10:43:09 2020 +0000
Revision:
3:4e641a32e087
Parent:
0:62b846b3988a
New Version with OS5

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tgrosch 0:62b846b3988a 1 /*!
tgrosch 0:62b846b3988a 2 * \file OPT3101DesignCoefficients.h
tgrosch 0:62b846b3988a 3 * \author Karthik Rajagopal <krthik@ti.com>
tgrosch 0:62b846b3988a 4 * \version 0.9.1
tgrosch 0:62b846b3988a 5 *
tgrosch 0:62b846b3988a 6 * \section COPYRIGHT
tgrosch 0:62b846b3988a 7 * TEXAS INSTRUMENTS TEXT FILE LICENSE
tgrosch 0:62b846b3988a 8 * Copyright (c) 2018 Texas Instruments Incorporated
tgrosch 0:62b846b3988a 9 * All rights reserved not granted herein.
tgrosch 0:62b846b3988a 10 * Limited License.
tgrosch 0:62b846b3988a 11 * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive license under copyrights and patents it now or hereafter owns or controls to make, have made, use, import, offer to sell and sell ("Utilize") this software subject to the terms herein. With respect to the foregoing patent license, such license is granted solely to the extent that any such patent is necessary to Utilize the software alone. The patent license shall not apply to any combinations which include this software, other than combinations with devices manufactured by or for TI ("TI Devices"). No hardware patent is licensed hereunder.
tgrosch 0:62b846b3988a 12 * Redistributions must preserve existing copyright notices and reproduce this license (including the above copyright notice and the disclaimer and (if applicable) source code license limitations below) in the documentation and/or other materials provided with the distribution
tgrosch 0:62b846b3988a 13 * Redistribution and use in binary form, without modification, are permitted provided that the following conditions are met:
tgrosch 0:62b846b3988a 14 * * No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any software provided in binary form.
tgrosch 0:62b846b3988a 15 * * any redistribution and use are licensed by TI for use only with TI Devices.
tgrosch 0:62b846b3988a 16 * * Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.
tgrosch 0:62b846b3988a 17 * If software source code is provided to you, modification and redistribution of the source code are permitted provided that the following conditions are met:
tgrosch 0:62b846b3988a 18 * * any redistribution and use of the source code, including any resulting derivative works, are licensed by TI for use only with TI Devices.
tgrosch 0:62b846b3988a 19 * * any redistribution and use of any object code compiled from the source code and any resulting derivative works, are licensed by TI for use only with TI Devices.
tgrosch 0:62b846b3988a 20 * Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or promote products derived from this software without specific prior written permission.
tgrosch 0:62b846b3988a 21 * DISCLAIMER.
tgrosch 0:62b846b3988a 22 * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
tgrosch 0:62b846b3988a 23 *
tgrosch 0:62b846b3988a 24 * \section DESCRIPTION
tgrosch 0:62b846b3988a 25 * This file contains class declarations OPT3101::crosstalkTempCoffC OPT3101::phaseTempCoffC OPT3101::phaseAmbientCoffC . These are design coefficients required for various calibration steps.
tgrosch 0:62b846b3988a 26 */
tgrosch 0:62b846b3988a 27
tgrosch 0:62b846b3988a 28 #ifndef OPT3101DESIGNCOEFFICIENTS_H_
tgrosch 0:62b846b3988a 29 #define OPT3101DESIGNCOEFFICIENTS_H_
tgrosch 0:62b846b3988a 30
tgrosch 0:62b846b3988a 31 #include <stdint.h>
tgrosch 0:62b846b3988a 32 //#include "OPT3101device.h"
tgrosch 0:62b846b3988a 33 #include "OPT3101Crosstalk.h"
tgrosch 0:62b846b3988a 34 #include "OPT3101PhaseOffset.h"
tgrosch 0:62b846b3988a 35
tgrosch 0:62b846b3988a 36 #ifdef OPT3101_USE_STREAMLIB
tgrosch 0:62b846b3988a 37 #include <fstream>
tgrosch 0:62b846b3988a 38 #include <iostream>
tgrosch 0:62b846b3988a 39 #include <istream>
tgrosch 0:62b846b3988a 40 #include <string>
tgrosch 0:62b846b3988a 41 #endif
tgrosch 0:62b846b3988a 42
tgrosch 0:62b846b3988a 43 /** \brief OPT3101::device declaration
tgrosch 0:62b846b3988a 44 This is declared here to avoid cyclic reference of classes
tgrosch 0:62b846b3988a 45 */
tgrosch 0:62b846b3988a 46 //class OPT3101::;
tgrosch 0:62b846b3988a 47
tgrosch 0:62b846b3988a 48
tgrosch 0:62b846b3988a 49 namespace OPT3101 {
tgrosch 0:62b846b3988a 50 /** \brief Class that holds crosstalk temperature coefficient related registers and values.
tgrosch 0:62b846b3988a 51
tgrosch 0:62b846b3988a 52 This is a class container that can hold crosstalk temperature coefficients and related register values. OPT3101 device has different crosstalk phenomenon which needs to be calibrated and compensated<br>
tgrosch 0:62b846b3988a 53 Refer to documentation for OPT3101::crosstalkC class documentation<br>
tgrosch 0:62b846b3988a 54 Crosstalk varies with temperature which needs to be calibration and compensated to improve the system performance.
tgrosch 0:62b846b3988a 55 Illum crosstalk temperature variation needs to be evaluated and a compensation coefficients have to be calculated.
tgrosch 0:62b846b3988a 56 OPT3101 device has internal registers to correct and compensate for illum crosstalk temperature variation. This class acts as a temporary storage of crosstalk temp coefficients and related registers.
tgrosch 0:62b846b3988a 57 Calculations have to be made on the crosstalk values, coefficients to transform them to register settings. Instances of OPT3101::crosstalkC taken at different temperate will be used to calculate these coefficients and registers.
tgrosch 0:62b846b3988a 58 */
tgrosch 0:62b846b3988a 59 class crosstalkTempCoffC {
tgrosch 0:62b846b3988a 60 public:
tgrosch 0:62b846b3988a 61 double coffI; ///< Coefficient for I Component with floating point precision.Units for this measurement is crosstalk OPT3101::crosstalkC::I (24 bit level) codes change per unit of temperature sensor codes (OPT3101::registers::tmain) per OPT3101::crosstalkC::magnitude() of crosstalk
tgrosch 0:62b846b3988a 62 double coffQ; ///< Coefficient for Q Component with floating point precision.Units for this measurement is crosstalk OPT3101::crosstalkC::Q (24 bit level) codes change per unit of temperature sensor codes (OPT3101::registers::tmain) per OPT3101::crosstalkC::magnitude() of crosstalk
tgrosch 0:62b846b3988a 63 uint8_t coffIReg; ///< Value of OPT3101::crosstalkTempCoffC::coffI represented as a 8 bit number to be written to illum crosstalk temp compensation registers
tgrosch 0:62b846b3988a 64 uint8_t coffQReg; ///< Value of OPT3101::crosstalkTempCoffC::coffQ represented as a 8 bit number to be written to illum crosstalk temp compensation registers
tgrosch 0:62b846b3988a 65 uint8_t commonScale; ///< Value of common scale for register coefficients achieved using different instances of OPT3101::crosstalkTempCoffC. Calculated by OPT3101::calibration::findCrosstalkTempRegisterValues during production calibration. Used while loading a set of TX and current configurations to the OPT3101 device during production calibration
tgrosch 0:62b846b3988a 66 /*!
tgrosch 0:62b846b3988a 67 * \brief initializes the members to 0
tgrosch 0:62b846b3988a 68 *
tgrosch 0:62b846b3988a 69 * \returns Nothing;
tgrosch 0:62b846b3988a 70 */
tgrosch 0:62b846b3988a 71 crosstalkTempCoffC();
tgrosch 0:62b846b3988a 72 /*!
tgrosch 0:62b846b3988a 73 * \brief calculates the crosstalk temp coff
tgrosch 0:62b846b3988a 74 *
tgrosch 0:62b846b3988a 75 * \param[in] illumXtalk0; Pointer to illum crosstalk OPT3101::crosstalkC instance measured at a lower temperature
tgrosch 0:62b846b3988a 76 * \param[in] illumXtalk1; Pointer to illum crosstalk OPT3101::crosstalkC instance measured at a higher temperature
tgrosch 0:62b846b3988a 77 * \returns Nothing;
tgrosch 0:62b846b3988a 78 */
tgrosch 0:62b846b3988a 79 void calculateCoff(crosstalkC *illumXtalk0,crosstalkC *illumXtalk1);
tgrosch 0:62b846b3988a 80 /*!
tgrosch 0:62b846b3988a 81 * \brief reports members of the instance
tgrosch 0:62b846b3988a 82 * Print the members of the class instance on screen
tgrosch 0:62b846b3988a 83 * \returns Nothing;
tgrosch 0:62b846b3988a 84 */
tgrosch 0:62b846b3988a 85 void report();
tgrosch 0:62b846b3988a 86 #ifdef OPT3101_USE_STDIOLIB
tgrosch 0:62b846b3988a 87 /*!
tgrosch 0:62b846b3988a 88 * \brief saves crosstalk temp coff values to file
tgrosch 0:62b846b3988a 89 * This methods saves the crosstalk temp coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration
tgrosch 0:62b846b3988a 90 * \param[in] fileName; Path and name of the file to store
tgrosch 0:62b846b3988a 91 * \returns Nothing;
tgrosch 0:62b846b3988a 92 */
tgrosch 0:62b846b3988a 93 void storeToFile(char *fileName);
tgrosch 0:62b846b3988a 94 /*!
tgrosch 0:62b846b3988a 95 * \brief load crosstalk temp coff values from file
tgrosch 0:62b846b3988a 96 * This methods loads the crosstalk temp coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration
tgrosch 0:62b846b3988a 97 * \param[in] fileName; Path and name of the file from where to load
tgrosch 0:62b846b3988a 98 * \returns Nothing;
tgrosch 0:62b846b3988a 99 */
tgrosch 0:62b846b3988a 100 void loadFromFile(char *fileName);
tgrosch 0:62b846b3988a 101 #endif
tgrosch 0:62b846b3988a 102 #ifdef OPT3101_USE_STREAMLIB
tgrosch 0:62b846b3988a 103 /*!
tgrosch 0:62b846b3988a 104 * \brief Operator overload to store class contents to a file
tgrosch 0:62b846b3988a 105 * Casts all the class members for file storage
tgrosch 0:62b846b3988a 106 * \param[out] os; os is data stream to serialize data
tgrosch 0:62b846b3988a 107 * \param[in] data; data is pointer to the class to be serialized and stored
tgrosch 0:62b846b3988a 108 * \returns std::ostream; Serialized std::ostream to be written to a file
tgrosch 0:62b846b3988a 109 */
tgrosch 0:62b846b3988a 110 friend std::ostream& operator<<(std::ostream& os, const crosstalkTempCoffC *data);
tgrosch 0:62b846b3988a 111 /*!
tgrosch 0:62b846b3988a 112 * \brief Operator overload to load class contents to from a file
tgrosch 0:62b846b3988a 113 * Retrieves all the class members from a stored file
tgrosch 0:62b846b3988a 114 * \param[in] is; is input stream from where the data is loaded
tgrosch 0:62b846b3988a 115 * \param[out] data; data is pointer to the class to be restored
tgrosch 0:62b846b3988a 116 * \returns std::istream; Serialized Input stream loaded from file
tgrosch 0:62b846b3988a 117 */
tgrosch 0:62b846b3988a 118 friend std::istream& operator>>(std::istream& is, crosstalkTempCoffC *data);
tgrosch 0:62b846b3988a 119 #endif
tgrosch 0:62b846b3988a 120 };
tgrosch 0:62b846b3988a 121 /*! \class OPT3101::phaseTempCoffC
tgrosch 0:62b846b3988a 122 \brief Class that holds phase temperature coefficient related registers and values.
tgrosch 0:62b846b3988a 123
tgrosch 0:62b846b3988a 124 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.
tgrosch 0:62b846b3988a 125 The drift will show up in OPT3101::frameData::phase measurement which will translate to error in measurement.<br>
tgrosch 0:62b846b3988a 126 OPT3101 has mechanism to compensate the output for this drift, for which phase temperature coefficient is required.
tgrosch 0:62b846b3988a 127 Either internal temp sensor or external temperature sensor can be used to compensate for this.
tgrosch 0:62b846b3988a 128 This class acts as a temporary storage of phase temp coefficients and related registers.
tgrosch 0:62b846b3988a 129 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.
tgrosch 0:62b846b3988a 130 */
tgrosch 0:62b846b3988a 131 class phaseTempCoffC {
tgrosch 0:62b846b3988a 132 public:
tgrosch 0:62b846b3988a 133 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
tgrosch 0:62b846b3988a 134 uint16_t coffReg; ///< Coefficient value of OPT3101::phaseTempCoffC::coff represented as 16bit register setting
tgrosch 0:62b846b3988a 135 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
tgrosch 0:62b846b3988a 136 bool istMainCoff; ///< Flag which determines if the coefficient was obtained using OPT3101::registers::tmain difference or OPT3101::registers::tillum
tgrosch 0:62b846b3988a 137 /*!
tgrosch 0:62b846b3988a 138 * \brief initializes the members to 0
tgrosch 0:62b846b3988a 139 *
tgrosch 0:62b846b3988a 140 * \returns Nothing;
tgrosch 0:62b846b3988a 141 */
tgrosch 0:62b846b3988a 142 phaseTempCoffC();
tgrosch 0:62b846b3988a 143 /*!
tgrosch 0:62b846b3988a 144 * \brief calculates the phase temp coff
tgrosch 0:62b846b3988a 145 *
tgrosch 0:62b846b3988a 146 * \param[in] frameData0; Pointer to frame data OPT3101::frameData instance measured at a lower temperature
tgrosch 0:62b846b3988a 147 * \param[in] frameData1; Pointer to frame data OPT3101::frameData instance measured at a higher temperature
tgrosch 0:62b846b3988a 148 * \param[in] istMainCoff; istMainCoff specifies if the calculation should be done with Tmain Coff
tgrosch 0:62b846b3988a 149 * \returns Nothing;
tgrosch 0:62b846b3988a 150 */
tgrosch 0:62b846b3988a 151 void calculateCoff(frameData *frameData0,frameData *frameData1,bool istMainCoff=true);
tgrosch 0:62b846b3988a 152 /*!
tgrosch 0:62b846b3988a 153 * \brief reports members of the instance
tgrosch 0:62b846b3988a 154 * Print the members of the class instance on screen
tgrosch 0:62b846b3988a 155 * \returns Nothing;
tgrosch 0:62b846b3988a 156 */
tgrosch 0:62b846b3988a 157 void report();
tgrosch 0:62b846b3988a 158 #ifdef OPT3101_USE_STDIOLIB
tgrosch 0:62b846b3988a 159 /*!
tgrosch 0:62b846b3988a 160 * \brief saves phase temp coff values to file
tgrosch 0:62b846b3988a 161 * 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
tgrosch 0:62b846b3988a 162 * \param[in] fileName; Path and name of the file to store
tgrosch 0:62b846b3988a 163 * \returns Nothing;
tgrosch 0:62b846b3988a 164 */
tgrosch 0:62b846b3988a 165 void storeToFile(char *fileName);
tgrosch 0:62b846b3988a 166 /*!
tgrosch 0:62b846b3988a 167 * \brief load phase temp coff values from file
tgrosch 0:62b846b3988a 168 * 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
tgrosch 0:62b846b3988a 169 * \param[in] fileName; Path and name of the file from where to load
tgrosch 0:62b846b3988a 170 * \returns Nothing;
tgrosch 0:62b846b3988a 171 */
tgrosch 0:62b846b3988a 172 void loadFromFile(char *fileName);
tgrosch 0:62b846b3988a 173 /*!
tgrosch 0:62b846b3988a 174 * \brief Operator overload to store class contents to a file
tgrosch 0:62b846b3988a 175 * Casts all the class members for file storage
tgrosch 0:62b846b3988a 176 * \param[out] os; os is data stream to serialize data
tgrosch 0:62b846b3988a 177 * \param[in] data; data is pointer to the class to be serialized and stored
tgrosch 0:62b846b3988a 178 * \returns std::ostream; Serialized std::ostream to be written to a file
tgrosch 0:62b846b3988a 179 */
tgrosch 0:62b846b3988a 180 #endif
tgrosch 0:62b846b3988a 181 #ifdef OPT3101_USE_STREAMLIB
tgrosch 0:62b846b3988a 182 friend std::ostream& operator<<(std::ostream& os, const phaseTempCoffC *data);
tgrosch 0:62b846b3988a 183 /*!
tgrosch 0:62b846b3988a 184 * \brief Operator overload to load class contents to from a file
tgrosch 0:62b846b3988a 185 * Retrieves all the class members from a stored file
tgrosch 0:62b846b3988a 186 * \param[in] is; is input stream from where the data is loaded
tgrosch 0:62b846b3988a 187 * \param[out] data; data is pointer to the class to be restored
tgrosch 0:62b846b3988a 188 * \returns std::istream; Serialized Input stream loaded from file
tgrosch 0:62b846b3988a 189 */
tgrosch 0:62b846b3988a 190 friend std::istream& operator>>(std::istream& is, phaseTempCoffC *data);
tgrosch 0:62b846b3988a 191 #endif
tgrosch 0:62b846b3988a 192 };
tgrosch 0:62b846b3988a 193 /*! \class OPT3101::phaseAmbientCoffC
tgrosch 0:62b846b3988a 194 \brief Class that holds ambient phase coefficient related registers and values.
tgrosch 0:62b846b3988a 195
tgrosch 0:62b846b3988a 196 This is a class container that can hold phase offset ambient coefficients and related registers.
tgrosch 0:62b846b3988a 197 Photo diodes has a phenomenon where the phase delay of modulated current generated by photo diode is dependent on the amount of ambient light falling on the photo diode.
tgrosch 0:62b846b3988a 198 The effect observed on the system is that the phase reported by the system will be dependent on the amount of ambient light of the environment. <br>
tgrosch 0:62b846b3988a 199 OPT3101 has compensation block for the same, which needs coefficients to be programmed. OPT3101 has a look up table based correction since the phenomenon in non-linear.
tgrosch 0:62b846b3988a 200 The look-up table is a 4 way split PWL correction with 4 independent coefficients. The PWL correlation is between ambient ADC output and phase measured<br>
tgrosch 0:62b846b3988a 201 This class has members to contain the coefficients and the split points.
tgrosch 0:62b846b3988a 202 */
tgrosch 0:62b846b3988a 203 class phaseAmbientCoffC {
tgrosch 0:62b846b3988a 204 public:
tgrosch 0:62b846b3988a 205 double coff[4]; ///< Coefficients stored in floating point precision. Since there are 4 sections the OPT3101::phaseAmbientCoffC::coff is array of 4 elements. Units for this is OPT3101::frameData::phase codes per unit OPT3101::frameData::ambient codes
tgrosch 0:62b846b3988a 206 uint8_t coffReg[4]; ///< Coefficients value of OPT3101::phaseAmbientCoffC::coff represented as 8 bit register values calculated by OPT3101::phaseAmbientCoffC::calculateCoff
tgrosch 0:62b846b3988a 207 uint16_t splitsReg[3]; ///< Register entries for the split point for the PWL. Since there are 4 sections where are 3 split points to be set. Units for this is OPT3101::frameData::ambient codes
tgrosch 0:62b846b3988a 208 uint8_t commonScale; ///< Since there are 4 OPT3101::phaseAmbientCoffC::coff to represent them as 8 bit register values a common scaling factor is required. This is calculated by method OPT3101::phaseAmbientCoffC::calculateCoff
tgrosch 0:62b846b3988a 209 /*!
tgrosch 0:62b846b3988a 210 * \brief initializes the members to 0
tgrosch 0:62b846b3988a 211 *
tgrosch 0:62b846b3988a 212 * \returns Nothing;
tgrosch 0:62b846b3988a 213 */
tgrosch 0:62b846b3988a 214 phaseAmbientCoffC();
tgrosch 0:62b846b3988a 215 /*!
tgrosch 0:62b846b3988a 216 * \brief Calculates the register settings for the phase ambient coefficient
tgrosch 0:62b846b3988a 217 * Calculates OPT3101::phaseAmbientCoffC::coffReg and OPT3101::phaseAmbientCoffC::commonScale based on OPT3101::phaseAmbientCoffC::coff
tgrosch 0:62b846b3988a 218 * \param[in] freqCounter; freqCounter is the count which represents the frequency from the Frequency correction block. This is read from register OPT3101::registers::freq_count_read_reg
tgrosch 0:62b846b3988a 219 * \returns Nothing;
tgrosch 0:62b846b3988a 220 */
tgrosch 0:62b846b3988a 221 void calculateCoff(uint16_t freqCounter);
tgrosch 0:62b846b3988a 222 /*!
tgrosch 0:62b846b3988a 223 * \brief reports members of the instance
tgrosch 0:62b846b3988a 224 * Print the members of the class instance on screen
tgrosch 0:62b846b3988a 225 * \returns Nothing;
tgrosch 0:62b846b3988a 226 */
tgrosch 0:62b846b3988a 227 void report();
tgrosch 0:62b846b3988a 228 #ifdef OPT3101_USE_STDIOLIB
tgrosch 0:62b846b3988a 229 /*!
tgrosch 0:62b846b3988a 230 * \brief saves phase ambient coff values to file
tgrosch 0:62b846b3988a 231 * This methods saves the phase ambient coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration
tgrosch 0:62b846b3988a 232 * \param[in] fileName; Path and name of the file to store
tgrosch 0:62b846b3988a 233 * \returns Nothing;
tgrosch 0:62b846b3988a 234 */
tgrosch 0:62b846b3988a 235 void storeToFile(char *fileName);
tgrosch 0:62b846b3988a 236 /*!
tgrosch 0:62b846b3988a 237 * \brief load phase ambient coff values from file
tgrosch 0:62b846b3988a 238 * This methods loads the phase ambient coff values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important for factory calibration
tgrosch 0:62b846b3988a 239 * \param[in] fileName; Path and name of the file from where to load
tgrosch 0:62b846b3988a 240 * \returns Nothing;
tgrosch 0:62b846b3988a 241 */
tgrosch 0:62b846b3988a 242 void loadFromFile(char *fileName);
tgrosch 0:62b846b3988a 243 /*!
tgrosch 0:62b846b3988a 244 * \brief Operator overload to store class contents to a file
tgrosch 0:62b846b3988a 245 * Casts all the class members for file storage
tgrosch 0:62b846b3988a 246 * \param[out] os; os is data stream to serialize data
tgrosch 0:62b846b3988a 247 * \param[in] data; data is pointer to the class to be serialized and stored
tgrosch 0:62b846b3988a 248 * \returns std::ostream; Serialized std::ostream to be written to a file
tgrosch 0:62b846b3988a 249 */
tgrosch 0:62b846b3988a 250 #endif
tgrosch 0:62b846b3988a 251 #ifdef OPT3101_USE_STREAMLIB
tgrosch 0:62b846b3988a 252 friend std::ostream& operator<<(std::ostream& os, const phaseAmbientCoffC *data);
tgrosch 0:62b846b3988a 253 /*!
tgrosch 0:62b846b3988a 254 * \brief Operator overload to load class contents to from a file
tgrosch 0:62b846b3988a 255 * Retrieves all the class members from a stored file
tgrosch 0:62b846b3988a 256 * \param[in] is; is input stream from where the data is loaded
tgrosch 0:62b846b3988a 257 * \param[out] data; data is pointer to the class to be restored
tgrosch 0:62b846b3988a 258 * \returns std::istream; Serialized Input stream loaded from file
tgrosch 0:62b846b3988a 259 */
tgrosch 0:62b846b3988a 260 friend std::istream& operator>>(std::istream& is, phaseAmbientCoffC *data);
tgrosch 0:62b846b3988a 261 #endif
tgrosch 0:62b846b3988a 262 };
tgrosch 0:62b846b3988a 263 }
tgrosch 0:62b846b3988a 264
tgrosch 0:62b846b3988a 265 #endif /* OPT3101DESIGNCOEFFICIENTS_H_ */
tgrosch 0:62b846b3988a 266