Ted Grosch / Mbed 2 deprecated Nucleo_TOF_I2C

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

phaseOffsetC Class Reference

phaseOffsetC Class Reference

Class that holds phase offset register data. More...

#include <OPT3101PhaseOffset.h>

Public Member Functions

 phaseOffsetC ()
 initializes the members to 0
void report ()
 reports members of the instance Print the members of the class instance on screen
void printHeader ()
 print header Print the members of the class instance on screen
void print ()
 prints the contents of the class Print the members of the class instance on screen
void storeToFile (char *fileName)
 store phase offset values to file This methods stores the phase offset values to a non-volatile memory. Storage to non-volatile memory is important to be able to calculate temperature coefficient OPT3101::crosstalkTempCoffC
void loadFromFile (char *fileName)
 load phase offset values from file This methods loads the phase offset values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important to be able to calculate temperature coefficient OPT3101::crosstalkTempCoffC

Data Fields

uint16_t phaseOffset
 This it the 16 bit phase offset register value to be written to the device registers for correcting the delays and offsets.
uint16_t referenceDistanceInCodes
 Captures a snapshot of the distances measured in OPT3101::frameData::phase codes used during calibration.
uint8_t illumScale
 Captures the illumination scale used during phase offset measurement.
uint8_t illumDac
 Captures the illumination current setting used during phase offset measurement.
uint8_t illumDCdac
 Captures the illumination DC current setting used during phase offset measurement.
uint16_t freqCount
 Captures the frequency Count register OPT3101::registers::freq_count_read_reg during phase offset measurement.
uint8_t shiftIllumPhase
 Captures the register OPT3101::registers::shift_illum_phase during phase offset measurement.
frameData data
 Captures the OPT3101::frameData used to calculate the OPT3101::phaseOffsetC::phaseOffset register.

Friends

std::ostream & operator<< (std::ostream &os, const phaseOffsetC *data)
 Operator overload to store class contents to a file Casts all the class members for file storage.
std::istream & operator>> (std::istream &is, phaseOffsetC *data)
 Operator overload to load class contents to from a file Retreives all the class members from a stored file.

Detailed Description

Class that holds phase offset register data.

The class contains the phase offset calibration registers and related snapshot from the device settings. Phase offset calibration is an important factory calibration that needs to be performed on every unit. The calibration is important to remove all the offsets and delays and read accurate distance or phase. The calibration involves having a target at a known distance and setting up offset register so that the device reads distance as expected. This class besides capturing the register settings also holds critical snapshot from device for analysis and debug.

Definition at line 52 of file OPT3101PhaseOffset.h.


Constructor & Destructor Documentation

phaseOffsetC (  )

initializes the members to 0

Returns:
Nothing;

Algorithm of the method is as follows

* Initializes all members to 0

Definition at line 32 of file OPT3101PhaseOffset.cpp.


Member Function Documentation

void loadFromFile ( char *  fileName )

load phase offset values from file This methods loads the phase offset values to a non-volatile memory. Storage/Restoration to/from non-volatile memory is important to be able to calculate temperature coefficient OPT3101::crosstalkTempCoffC

Parameters:
[in]fileName;Path and name of the file from where the crosstalk values are loaded
Returns:
Nothing;

Algorithm of the method is as follows

* User needs to implement file load/restore based on host.

Definition at line 98 of file OPT3101PhaseOffset.cpp.

void print (  )

prints the contents of the class Print the members of the class instance on screen

Returns:
Nothing;

Definition at line 71 of file OPT3101PhaseOffset.cpp.

void printHeader (  )

print header Print the members of the class instance on screen

Returns:
Nothing;

Definition at line 61 of file OPT3101PhaseOffset.cpp.

void report (  )

reports members of the instance Print the members of the class instance on screen

Returns:
Nothing;

* Prints all the members and values of members on screen.

* Prints all the members and values of members on screen.

Definition at line 44 of file OPT3101PhaseOffset.cpp.

void storeToFile ( char *  fileName )

store phase offset values to file This methods stores the phase offset values to a non-volatile memory. Storage to non-volatile memory is important to be able to calculate temperature coefficient OPT3101::crosstalkTempCoffC

Parameters:
[in]fileName;Path and name of the file to capture the crosstalk values to
Returns:
Nothing;

Algorithm of the method is as follows

* User needs to implement file storage based on host.

Definition at line 86 of file OPT3101PhaseOffset.cpp.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const phaseOffsetC 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,
phaseOffsetC data 
) [friend]

Operator overload to load class contents to from a file Retreives 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

Captures the OPT3101::frameData used to calculate the OPT3101::phaseOffsetC::phaseOffset register.

Definition at line 61 of file OPT3101PhaseOffset.h.

uint16_t freqCount

Captures the frequency Count register OPT3101::registers::freq_count_read_reg during phase offset measurement.

Definition at line 59 of file OPT3101PhaseOffset.h.

uint8_t illumDac

Captures the illumination current setting used during phase offset measurement.

Definition at line 57 of file OPT3101PhaseOffset.h.

uint8_t illumDCdac

Captures the illumination DC current setting used during phase offset measurement.

Definition at line 58 of file OPT3101PhaseOffset.h.

uint8_t illumScale

Captures the illumination scale used during phase offset measurement.

Definition at line 56 of file OPT3101PhaseOffset.h.

uint16_t phaseOffset

This it the 16 bit phase offset register value to be written to the device registers for correcting the delays and offsets.

Definition at line 54 of file OPT3101PhaseOffset.h.

Captures a snapshot of the distances measured in OPT3101::frameData::phase codes used during calibration.

Definition at line 55 of file OPT3101PhaseOffset.h.

uint8_t shiftIllumPhase

Captures the register OPT3101::registers::shift_illum_phase during phase offset measurement.

Definition at line 60 of file OPT3101PhaseOffset.h.