MSP430UltrasonicLibrary  02_20_00_16
Functions
Algorithm_api

Functions

USS_message_code USS_initAlgorithms (USS_SW_Library_configuration *config)
 The following API initializes USS_Algorithms_Handle based on user USS_Algorithms_User_Configuration, USS_System_Configuration, USS_Meter_Configuration and USS_Measurement_Configuration structs. Currently this API does not perform any parameter checks. More...
 
USS_message_code USS_runAlgorithmsFixedPoint (USS_SW_Library_configuration *config, USS_Algorithms_Results_fixed_point *results)
 The following API calculates Absolute ToF Upstream, Absolute ToF Downstream, Delta ToF, Volume Flow Rate using fixed point math. //!

IMPORTANT: It is recommend to use this version of the API to reduce power consumption numbers. More...
 
USS_message_code USS_runAlgorithms (USS_SW_Library_configuration *config, USS_Algorithms_Results *results)
 The following API calculates Absolute ToF Upstream, Absolute ToF Downstream, Delta ToF, Volume Flow Rate.

Note1: USS_initAlgorithms must be called prior to calling this function. The API expects to have a Up stream (UPS) and Down stream (DNS) of size "sampleSize" in contiguous LEA memory where the first capture is assumed to be UPS capture and the second capture is assumed to be DNS capture. Therefore, UPS and DNS capture depends on the type of capture the user select via sequenceSelection member in USS_Measurement_Configuration structure For example: if sequenceSelection == USS_measurement_capture_sequence_ch0_ch1 then USS CH0 is assumed to be UPS capture and CH1 is assumed to be DNS capture and vice versa for USS_measurement_capture_sequence_ch1_ch0 If API return message code USS_message_code_valid_results, then algorithms result are valid. More...
 
USS_message_code USS_generateMonoDualToneBinaryPattern (USS_SW_Library_configuration *config)
 The following API is used to generate the binary pattern used by USS_Alg_AbsToF_Calculation_Option_lobeWide and USS_Alg_AbsToF_Calculation_Option_hilbertWide computation options. Use this when AbsTof computation option is set to USS_Alg_AbsToF_Calculation_Option_lobeWide or USS_Alg_AbsToF_Calculation_Option_hilbertWide and pulse generation is single or dual mode. More...
 
USS_message_code USS_generateMultiToneBinaryPattern (USS_SW_Library_configuration *config)
 The following API is used to generate the binary pattern used by USS_Alg_AbsToF_Calculation_Option_lobeWide and USS_Alg_AbsToF_Calculation_Option_hilbertWide computation options. Use this when AbsTof computation option is set to USS_Alg_AbsToF_Calculation_Option_lobeWide or USS_Alg_AbsToF_Calculation_Option_hilbertWide and pulse generation is multi tone mode. More...
 
USS_message_code USS_updateABSTOFCalculationIteration (USS_SW_Library_configuration *config)
 The following API allows user to update the frequency at which the Absolute Time of Flight is calculated in the algorithms. The iteration value is set via the "absTOFIteration" parameter in the USS_Algorithm_User_Configuration structure. More...
 
USS_message_code USS_updateClockRelativeError (USS_SW_Library_configuration *config)
 The following API allows user to update clockRelativeError parameter during runtime. The clockRelativeError parameter is used to by USS_runAlgorithms and USS_runAlgorithmsFixedPoint APIs. The clockRelativeError parameter is used to correct the UPS and DNS AbsTOF calculations. Refere to clockRelativeError description for for guidance on how to estimate this parameter using USS_verifyHSPLLFrequency API. More...
 
USS_message_code USS_getResultsInFloat (USS_Algorithms_Results_fixed_point *pFixedResults, USS_Algorithms_Results *pFloatResults)
 The following API allows user to convert the fixed point Algorithm results to floating point representation. More...
 
USS_message_code USS_swapAlgorithmsCaptureBuffers (USS_SW_Library_configuration *config)
 This function allows user to swap capture buffers. It is highly recommended to call this function after calling USS_swapCaptureChannels. More...
 
bool USS_isAlgorithmChannelsSwapped (void)
 This function allows users to query current status Algorithm Capture buffers. More...
 
USS_message_code USS_updateAdditionalCaptureDelay (USS_SW_Library_configuration *config, float additionalCaptureDelay)
 This function allows users to update Additional Capture Delay with with minimal algorithm reconfiguration. More...
 
USS_message_code USS_updateDtoFOffset (USS_SW_Library_configuration *config, float dTofOffset)
 This function allows users to update Delta Time Of Flight Offset with with minimal algorithm reconfiguration. More...
 

Detailed Description

Function Documentation

§ USS_initAlgorithms()

USS_message_code USS_initAlgorithms ( USS_SW_Library_configuration config)

The following API initializes USS_Algorithms_Handle based on user USS_Algorithms_User_Configuration, USS_System_Configuration, USS_Meter_Configuration and USS_Measurement_Configuration structs. Currently this API does not perform any parameter checks.

Parameters
[in]configis a pointer to the USS SW Library user configuration
Returns
USS_message_code

§ USS_runAlgorithmsFixedPoint()

USS_message_code USS_runAlgorithmsFixedPoint ( USS_SW_Library_configuration config,
USS_Algorithms_Results_fixed_point results 
)

The following API calculates Absolute ToF Upstream, Absolute ToF Downstream, Delta ToF, Volume Flow Rate using fixed point math. //!

IMPORTANT: It is recommend to use this version of the API to reduce power consumption numbers.



Note1: USS_initAlgorithms must be called prior to calling this function.

The API expects to have a Up stream (UPS) and Down stream (DNS) of size "sampleSize" in contiguous LEA memory where the first capture is assumed to be UPS capture and the second capture is assumed to be DNS capture. Therefore, UPS and DNS capture depends on the type of capture the user select via sequenceSelection member in USS_Measurement_Configuration structure For example: if sequenceSelection == USS_measurement_capture_sequence_ch0_ch1 then USS CH0 is assumed to be UPS capture and CH1 is assumed to be DNS capture and vice versa for USS_measurement_capture_sequence_ch1_ch0 If API return message code USS_message_code_valid_results, then algorithms result are valid.

Parameters
[in]configis a pointer to the USS SW Library user configuration
[in]resultsis a pointer to the USS Algoriithms Result structure
Returns
USS_message_code

§ USS_runAlgorithms()

USS_message_code USS_runAlgorithms ( USS_SW_Library_configuration config,
USS_Algorithms_Results results 
)

The following API calculates Absolute ToF Upstream, Absolute ToF Downstream, Delta ToF, Volume Flow Rate.

Note1: USS_initAlgorithms must be called prior to calling this function. The API expects to have a Up stream (UPS) and Down stream (DNS) of size "sampleSize" in contiguous LEA memory where the first capture is assumed to be UPS capture and the second capture is assumed to be DNS capture. Therefore, UPS and DNS capture depends on the type of capture the user select via sequenceSelection member in USS_Measurement_Configuration structure For example: if sequenceSelection == USS_measurement_capture_sequence_ch0_ch1 then USS CH0 is assumed to be UPS capture and CH1 is assumed to be DNS capture and vice versa for USS_measurement_capture_sequence_ch1_ch0 If API return message code USS_message_code_valid_results, then algorithms result are valid.

Parameters
[in]configis a pointer to the USS SW Library user configuration
[in]resultsis a pointer to the USS Algorithms Result structure
Returns
USS_message_code

Referenced by USS_calculateOffsets().

§ USS_generateMonoDualToneBinaryPattern()

USS_message_code USS_generateMonoDualToneBinaryPattern ( USS_SW_Library_configuration config)

The following API is used to generate the binary pattern used by USS_Alg_AbsToF_Calculation_Option_lobeWide and USS_Alg_AbsToF_Calculation_Option_hilbertWide computation options. Use this when AbsTof computation option is set to USS_Alg_AbsToF_Calculation_Option_lobeWide or USS_Alg_AbsToF_Calculation_Option_hilbertWide and pulse generation is single or dual mode.

Parameters
[in]configis a pointer to the USS SW Library user configuration
Returns
USS_message_code

§ USS_generateMultiToneBinaryPattern()

USS_message_code USS_generateMultiToneBinaryPattern ( USS_SW_Library_configuration config)

The following API is used to generate the binary pattern used by USS_Alg_AbsToF_Calculation_Option_lobeWide and USS_Alg_AbsToF_Calculation_Option_hilbertWide computation options. Use this when AbsTof computation option is set to USS_Alg_AbsToF_Calculation_Option_lobeWide or USS_Alg_AbsToF_Calculation_Option_hilbertWide and pulse generation is multi tone mode.

Parameters
[in]configis a pointer to the USS SW Library user configuration
Returns
USS_message_code

§ USS_updateABSTOFCalculationIteration()

USS_message_code USS_updateABSTOFCalculationIteration ( USS_SW_Library_configuration config)

The following API allows user to update the frequency at which the Absolute Time of Flight is calculated in the algorithms. The iteration value is set via the "absTOFIteration" parameter in the USS_Algorithm_User_Configuration structure.



Increasing the value for "absTOFIteration" reduces the average consumption of the application.



Note1: Calling this API will cause that USS_runAlgorithmsFixedPoint or USS_runAlgorithm API computes the Absolute Time of Flight next time they are called.



Note2: USS_initAlgorithms must be called prior to calling this function.

Parameters
[in]configis a pointer to the USS SW Library user configuration
Returns
USS_message_code

§ USS_updateClockRelativeError()

USS_message_code USS_updateClockRelativeError ( USS_SW_Library_configuration config)

The following API allows user to update clockRelativeError parameter during runtime. The clockRelativeError parameter is used to by USS_runAlgorithms and USS_runAlgorithmsFixedPoint APIs. The clockRelativeError parameter is used to correct the UPS and DNS AbsTOF calculations. Refere to clockRelativeError description for for guidance on how to estimate this parameter using USS_verifyHSPLLFrequency API.



Note1: USS_initAlgorithms must be called prior to calling this function.

Parameters
[in]configis a pointer to the USS SW Library user configuration
Returns
USS_message_code

§ USS_getResultsInFloat()

USS_message_code USS_getResultsInFloat ( USS_Algorithms_Results_fixed_point pFixedResults,
USS_Algorithms_Results pFloatResults 
)

The following API allows user to convert the fixed point Algorithm results to floating point representation.

Parameters
[in]pFixedResultsis a pointer to fixed point algorithm result structure
[in]pFloatResultsis a pointer to a floating point algorithm result structure. The converted results are returned in this structure
Returns
USS_message_code

§ USS_swapAlgorithmsCaptureBuffers()

USS_message_code USS_swapAlgorithmsCaptureBuffers ( USS_SW_Library_configuration config)

This function allows user to swap capture buffers. It is highly recommended to call this function after calling USS_swapCaptureChannels.

Parameters
[in]configis a pointer to the USS SW Library user configuration.
Returns
USS_message_code

§ USS_isAlgorithmChannelsSwapped()

bool USS_isAlgorithmChannelsSwapped ( void  )

This function allows users to query current status Algorithm Capture buffers.

Returns
true Capture buffers are swapped false Capture buffers are NOT swapped

§ USS_updateAdditionalCaptureDelay()

USS_message_code USS_updateAdditionalCaptureDelay ( USS_SW_Library_configuration config,
float  additionalCaptureDelay 
)

This function allows users to update Additional Capture Delay with with minimal algorithm reconfiguration.

Parameters
[in]configis a pointer to the USS SW Library user configuration.
[in]additionalCaptureDelaynew additional capture delay
Returns
USS_message_code

§ USS_updateDtoFOffset()

USS_message_code USS_updateDtoFOffset ( USS_SW_Library_configuration config,
float  dTofOffset 
)

This function allows users to update Delta Time Of Flight Offset with with minimal algorithm reconfiguration.

Parameters
[in]configis a pointer to the USS SW Library user configuration.
[in]dTofOffsetnew dtof Offset
Returns
USS_message_code
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale