MSP430UltrasonicLibrary
02_20_00_16
|
Contains all USS SW Library enums, structs, macros, function and global variables definitions.
Contains all USS SW Library enums, structs, macros, function and global variables defintions.
#include <msp430.h>
#include <stdint.h>
#include <stdbool.h>
#include <QmathLib.h>
#include <IQmathLib.h>
Go to the source code of this file.
Data Structures | |
struct | _USS_Algorithms_Meter_Constant_Calib_ |
Contain meter constant calibration data. More... | |
struct | _USS_System_Configuration_ |
Contains USS SW Lib System Configuration. More... | |
struct | _USS_Pulse_Additional_End_of_Sequence_Configuration_ |
Structure to configure additional multi tone pulse generation. More... | |
struct | _USS_Pulse_Multitone_Configuration_ |
structure to configure multi tone pulse generation More... | |
struct | _USS_Pulse_Single_Dual_Tone_Configuration_ |
The following structure allows user to specify single and dual tone configuration. More... | |
struct | _USS_Pulse_Configuration_ |
Allows user to specify the pulse configuration. More... | |
struct | _USS_Meter_Configuration_ |
Contains USS SW Lib Meter Configuration. More... | |
struct | _USS_Measurement_Configuration_ |
Contains USS SW Lib Measurement Configuration. More... | |
struct | _USS_HSPLL_Configuration_ |
Contains USS SW Lib HSPLL Configuration. More... | |
struct | _USS_dTof_absTof_offset_test_config_ |
This structure is passed to USS_calculateOffsets API and define the test calibration configuration. More... | |
struct | _USS_dTof_absTof_offset_results_ |
This structure is passed to USS_calculateOffsets API and calibration test result will be returned in this structure. More... | |
struct | _USS_calibration_hspll_results_ |
This structure is passed to USS_verifyHSPLLFrequency API and test result will be returned using this structure. More... | |
struct | _USS_Capture_Configuration_ |
Contains USS SW Lib Capture Configuration. More... | |
struct | _USS_Trigger_Configuration_ |
Contains USS SW Lib Trigger Configuration. More... | |
struct | _USS_Interrupt_Configuration_ |
Contains USS SW Lib Capture Configuration. More... | |
struct | _USS_Algorithms_User_Configuration_ |
Contains USS SW Lib Algorithms User Configuration. More... | |
struct | _USS_Algorithms_Results_ |
Contains USS SW Lib Algorithms Results. More... | |
struct | _USS_Algorithms_Results_fixed_point_ |
Contains USS SW Lib Algorithms Results. More... | |
struct | _USS_SW_Library_configuration_ |
Contains USS SW Lib configuration. More... | |
Macros | |
#define | USS_UUPS_PWR_REQ_IGN_INTERRUPT BIT0 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS UUPS Power request ignored interrupt has been triggered. More... | |
#define | USS_UUPS_PWR_UP_TM_OUT_INTERRUPT BIT1 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS UUPS Power up time out interrupt has been triggered. More... | |
#define | USS_SAPH_DATA_ERR_ABORT_INTERRUPT BIT2 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH Data error abort interrupt has been triggered. More... | |
#define | USS_SAPH_TMF_TM_OUT_INTERRUPT BIT3 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH Time Mark 4 time out interrupt has been triggered. More... | |
#define | USS_SAPH_SEQ_ACQ_DN_INTERRUPT BIT4 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH sequence acquisition done interrupt has been triggered. More... | |
#define | USS_SAPH_PING_DN_INTERRUPT BIT5 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH ping transmit done interrupt has been triggered. More... | |
#define | USS_HSPLL_PLL_UNLOCK_INTERRUPT BIT6 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS HSPLL PLL unlock interrupt has been triggered. More... | |
#define | USS_SDHS_WINLO_INTERRUPT BIT7 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS WINLO interrupt has been triggered. More... | |
#define | USS_SDHS_WINHI_INTERRUPT BIT8 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS WINHI interrupt has been triggered. More... | |
#define | USS_SDHS_DTRDY_INTERRUPT BIT9 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS DTRDY interrupt has been triggered. More... | |
#define | USS_SDHS_SSTRG_INTERRUPT BITA |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS SSTRG interrupt has been triggered. More... | |
#define | USS_SDHS_ACQDONE_INTERRUPT BITB |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS SMPSZ interrupt has been triggered. More... | |
#define | USS_SDHS_OVF_INTERRUPT BITC |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS OVF interrupt has been triggered. More... | |
#define | USS_TIMER_EXPIRED_INTERRUPT BITD |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SW Library delay generator timer has expired. More... | |
#define | USS_SAPH_SEQUENCE_STOPPED BITE |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if SAPH has been stopped. More... | |
#define | USS_UUPS_STOPPED_BY_DEBUGGER BITF |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if UUPS has been stopped by the debugger. More... | |
#define | USS_TIMER_EXPIRED_EVENT1_INTERRUPT 0x10000 |
This bit determines if the first event of period measurement is complete. More... | |
#define | USS_SAPH_DMA_ACK_VIOLATION (0x00010000) |
This define can be used to mask USSSWLIB_USS_interrupt_status variable and determine if SAPH generated an DMA acknowledgment violation. More... | |
#define | HARDWAREWREG16(x) (*((volatile uint16_t *)((uint16_t)x))) |
#define | USS_Alg_dToF_Calculation_Option_gas USS_Alg_dToF_Calculation_Option_estimate |
Typedefs | |
typedef enum _USS_message_code_ | USS_message_code |
The following enumeration contain all possible USS SW Library return message codes. More... | |
typedef enum _USS_diagnostics_mode_ | USS_diagnostics_mode |
Selects diagnostic mode to be used by the library. For optimal power consumption it is recommended to use USS_diagnostics_mode_0. During development it is recommended to use USS_diagnostics_mode_2. More... | |
typedef enum _USS_capture_power_mode_ | USS_capture_power_mode_option |
Selects the desired power mode while USS capture is done, API will remain in this mode until capture is done. More... | |
typedef enum _USS_stop_measurement_state_ | USS_stop_measurement_state |
Selects USS state after capture has been stopped. More... | |
typedef enum _USS_measurement_drive_strength_ | USS_measurement_drive_strength |
Allows user to select USS channel drive strength. User can select between max strength and pre-trimmed drive. More... | |
typedef enum _USS_measurement_pause_state_ | USS_measurement_pause_state |
Allows user to select pause state. Pause state is considered to be time before and after USS Channel Pulse Generation. More... | |
typedef enum _USS_measurement_pulse_polarity_ | USS_measurement_pulse_polarity |
Allows user to select starting pulse state. More... | |
typedef enum _USS_measurement_ULP_bias_delay_ | USS_measurement_ULP_bias_delay |
Allows user to select the ULP bias delay during USS Power up. sequence. The ULP bias allows a faster channel setting on reactive input loads. Please refer the device User's guide UUPS and SAPH chapter for further recommendations regarding ULP bias. More... | |
typedef enum _USS_measurement_bias_impedance_ | USS_measurement_bias_impedance |
The following parameter allows the application to control the RX/TX bias during the acquisition sequence. For resistive loads a low impedance generates the fastest settling times. For reactive loads a different impedance setting might be needed to generate a gentler build up of the bias voltage. Please refer to device User's guide SAPH chapter for further recommended usage. More... | |
typedef enum _USS_measurement_mux_charge_pump_ | USS_measurement_mux_charge_pump |
The following parameter allow application to turn on/off the PGA input multiplexer during the whole firing/capture sequence. Having the the charge always on allows to reduce the RX signal noise. Please refer to the SAPH chapter in the device User's guide for detailed recommended usage of this functionality. More... | |
typedef enum _USS_measurement_pulse_generation_mode_ | USS_measurement_pulse_generation_mode |
Lists pulse generation options. More... | |
typedef enum _USS_test_channel_ | USS_test_channel |
Selects USS channel to be used for test (Used for Application Debug API) More... | |
typedef enum _USS_measurement_capture_sequence_ | USS_measurement_capture_sequence |
Allows user to select USS capture sequence. More... | |
typedef enum _USS_measurement_end_of_sequence_state_ | USS_measurement_end_of_sequence_state |
This is the USS state after capture is done. More... | |
typedef enum _USS_Capture_Over_Sample_Rate_ | USS_Capture_Over_Sample_Rate |
Configures SDHS Over Sample Rate Registers modified: SDHS.CTL0.OBR More... | |
typedef enum _USS_Capture_Gain_Range_ | USS_Capture_Gain_Range |
Selects Programmable Gain Amplifier (PGA) range. More... | |
typedef enum _USS_Capture_Calibration_ | USS_Capture_Calibration |
Selects Programmable Gain Amplifier (PGA) range. More... | |
typedef enum _USS_Trigger_Configuration_Trigger_ | USS_Trigger_Configuration_Trigger |
Selects USS trigger option. More... | |
typedef enum _USS_HSPLL_input_clock_freq_ | USS_HSPLL_input_clock_freq |
Selects USS Crystal Frequency. More... | |
typedef enum _USS_HSPLL_input_clock_type_ | USS_HSPLL_input_clock_type |
Selects USS HSPLL input clock Type. More... | |
typedef enum _USS_HSPLL_output_clk_freq_ | USS_HSPLL_output_clk_freq |
Selects USS HSPLL output clock frequency. More... | |
typedef enum USS_SDHS_Interrupt | USS_SDHS_Interrupt |
Selects appropiate USS SDHS interrupt (Used to register interrupt callback functions) More... | |
typedef enum USS_SAPH_Interrupt | USS_SAPH_Interrupt |
Selects appropiate USS SAPH interrupt (Used to register interrupt callback functions) More... | |
typedef enum USS_UUPS_Interrupt | USS_UUPS_Interrupt |
Used to configure USS UUPS interrupt callback. More... | |
typedef enum USS_HSPLL_Interrupt | USS_HSPLL_Interrupt |
Used to configure USS HSPLL interrupt callback. More... | |
typedef enum _USS_highFlow_option_ | USS_highFlow_option |
Defines high flow computation options. More... | |
typedef enum _USS_low_power_mode_option_ | USS_low_power_mode_option |
Selects the desired power mode while USS capture is done. More... | |
typedef enum _USS_dtof_volume_flow_calculation_interval_ | USS_dtof_volume_flow_calculation_interval |
Selects the interval to calculate Delta ToF and Volume Flow. More... | |
typedef enum _USS_dcOffEst_Calc_Mode_ | USS_dcOffEst_Calc_Mode |
Selects the UPS/DNS DC offset estimation mode used by USS_estimateDCoffset API. More... | |
typedef enum _USS_Alg_AbsToF_Calculation_Option_ | USS_Alg_AbsToF_Calculation_Option |
Enumerated type for absTOF algorithm selection. More... | |
typedef enum _USS_Alg_dToF_Calculation_Option_ | USS_Alg_dToF_Calculation_Option |
Enumerated type for dToF algorithm selection. More... | |
typedef enum _USS_Alg_volume_flow_Calculation_Option_ | USS_Alg_volume_flow_Calculation_Option |
Enumerated type for volume flow rate algorithm selection. More... | |
typedef struct _USS_Algorithms_Meter_Constant_Calib_ | USS_Algorithms_Meter_Constant_Calib |
Contain meter constant calibration data. More... | |
typedef struct _USS_System_Configuration_ | USS_System_Configuration |
Contains USS SW Lib System Configuration. More... | |
typedef struct _USS_Pulse_Additional_End_of_Sequence_Configuration_ | USS_Pulse_Additional_End_of_Sequence_Configuration |
Structure to configure additional multi tone pulse generation. More... | |
typedef struct _USS_Pulse_Multitone_Configuration_ | USS_Pulse_Multitone_Configuration |
structure to configure multi tone pulse generation More... | |
typedef struct _USS_Pulse_Single_Dual_Tone_Configuration_ | USS_Pulse_Single_Dual_Tone_Configuration |
The following structure allows user to specify single and dual tone configuration. More... | |
typedef struct _USS_Pulse_Configuration_ | USS_Pulse_Configuration |
Allows user to specify the pulse configuration. More... | |
typedef struct _USS_Meter_Configuration_ | USS_Meter_Configuration |
Contains USS SW Lib Meter Configuration. More... | |
typedef struct _USS_Measurement_Configuration_ | USS_Measurement_Configuration |
Contains USS SW Lib Measurement Configuration. More... | |
typedef struct _USS_HSPLL_Configuration_ | USS_HSPLL_Configuration |
Contains USS SW Lib HSPLL Configuration. More... | |
typedef struct _USS_dTof_absTof_offset_test_config_ | USS_dTof_absTof_offset_test_config |
This structure is passed to USS_calculateOffsets API and define the test calibration configuration. More... | |
typedef struct _USS_dTof_absTof_offset_results_ | USS_dTof_absTof_offset_results |
This structure is passed to USS_calculateOffsets API and calibration test result will be returned in this structure. More... | |
typedef struct _USS_calibration_hspll_results_ | USS_calibration_hspll_results |
This structure is passed to USS_verifyHSPLLFrequency API and test result will be returned using this structure. More... | |
typedef struct _USS_Capture_Configuration_ | USS_Capture_Configuration |
Contains USS SW Lib Capture Configuration. More... | |
typedef struct _USS_Trigger_Configuration_ | USS_Trigger_Configuration |
Contains USS SW Lib Trigger Configuration. More... | |
typedef struct _USS_Interrupt_Configuration_ | USS_Interrupt_Configuration |
Contains USS SW Lib Capture Configuration. More... | |
typedef struct _USS_Algorithms_User_Configuration_ | USS_Algorithms_User_Configuration |
Contains USS SW Lib Algorithms User Configuration. More... | |
typedef struct _USS_Algorithms_Results_ | USS_Algorithms_Results |
Contains USS SW Lib Algorithms Results. More... | |
typedef struct _USS_Algorithms_Results_fixed_point_ | USS_Algorithms_Results_fixed_point |
Contains USS SW Lib Algorithms Results. More... | |
typedef struct _USS_SW_Library_configuration_ | USS_SW_Library_configuration |
Contains USS SW Lib configuration. More... | |
Functions | |
USS_message_code | USS_configureUltrasonicMeasurement (USS_SW_Library_configuration *config) |
The following API configures USS module based on user configuration files "ussSwLib_userConfig.c" and "ussSwLib_userConfig.h". This API will internally invoke all USS Configuration APIs. In addition, this API will initialize the timer which will be used to generate delays such as the delay to stabilize PLL XTAL. More... | |
USS_message_code | USS_startUltrasonicMeasurement (USS_SW_Library_configuration *config, USS_capture_power_mode_option powerMode) |
The following API can be used to trigger a USS Capture via software trigger. NOTE: User must call "USS_configureUltrasonicMeasurement" before calling this API and USS trigger must be set to USS_Triger_Configuration_Software_Trigger. The API will perform the following operations: More... | |
USS_message_code | USS_startLowPowerUltrasonicCapture (USS_SW_Library_configuration *config) |
The following API has been power optimized for ultrasonic capture. The API controls the capture sequence selected by the user via the sequenceSelection member in USS_Measurement_Configuration structure. NOTE the API has been optimized for USS_measurement_capture_sequence_ch0_ch1 capture mode. NOTE_1: User must call "USS_configureUltrasonicMeasurement" before calling this API and USS trigger must be set to USS_Triger_Configuration_Software_Trigger. To reduce power consumption between captures the device will: More... | |
USS_message_code | USS_stopUltrasonicMeasurement (USS_SW_Library_configuration *config, USS_stop_measurement_state stopMeasurementState) |
The following API can be used to stop any active USS capture. The user has the option to select USS state after conversion is stopped. The API will report if capture was successfully stopped or if any errors occurs while stopping the measurement. More... | |
void | USS_generateLPMDelay (USS_SW_Library_configuration *config, USS_low_power_mode_option lpmMode, uint16_t count) |
The following API can be used to generate a Low Power Mode Delay. The API allows to select the desired Low Power Mode. Global interrupts remain enable. The timer clock source for this delay is ACLK. Therefore the delay generate will be determined based on ACLK frequency (e.g. for count = 30 and ACLK freq = 32768 HZ a delay of ~915 msec will be generated. More... | |
USS_message_code | USS_updateSDHSConfiguration (USS_SW_Library_configuration *config) |
The following function updates the SDHS module configuration based on user defined USS_Capture_Configuration struct in "ussSwLib_userConfig.c". Note: This API must be called everytime a USS_Capture_Configuration parameter is updated. This API performs the following SDHS module configuration. More... | |
USS_message_code | USS_updateHSPLLConfiguration (USS_SW_Library_configuration *config) |
The following function updates the HSPLL module configuration based on user defined USS_HSPLL_Configuration struct in "ussSwLib_userConfig.c". Note1: This API must be called everytime a USS_HSPLL_Configuration parameter is updated. Note2: If "pllOutputFreq_inHz" is modified in USS_HSPLL_Configuration struct, user must call USS_updateSDHSCapture API since SDHS modulator optimization bits might need to be updated. This API performs the following HSPLL module configuration checks: More... | |
USS_message_code | USS_updateSAPHConfiguration (USS_SW_Library_configuration *config) |
The following function updates the SAPH module configuration based on user defined USS_Measurement_Configuration struct in "ussSwLib_userConfig.c". Note: This API must be called everytime a USS_Measurement_Configuration parameter is updated. This API performs the following SAPH module configuration checks: More... | |
USS_message_code | USS_updateUUPSConfiguration (USS_SW_Library_configuration *config) |
The following function updates the UUPS module configuration based on user defined USS_Trigger_Configuration struct in "ussSwLib_userConfig.c". Note1: This API must be called every time a USS_Trigger_Configuration parameter is updated. Note2: This API will assert HSPLL.PLLXTEN bit when USS_Triger_Configuration_RTC_Timer_Trigger, USS_Triger_Configuration_External_Trigger1 or USS_Triger_Configuration_External_Trigger2. Selecting USS_Triger_Configuration_Software_Trigger will deassert HSPLL.PLLXTEN bit. This API performs the following checks: More... | |
USS_message_code | USS_updateUSSInterruptsConfiguration (USS_SW_Library_configuration *config) |
The following function updates the UUPS module interrupt configuration based on user defined USS_Interrupt_Configuration struct in "ussSwLib_userConfig.c". Note: This API must be called every time an USS_Interrupt_Configuration parameter is updated. This API performs the following checks: More... | |
USS_message_code | USS_resetUSSModule (USS_SW_Library_configuration *config, bool reconfigUSSModule) |
This function allows application to reset the USS module. It is recommended that this API is used when an USS SW Library API return a HSPLL unlock error. The API allows user to control the reconfiguration of the measurement. If reconfigUSSModule == true then the measurement is reconfigured. If reconfigUSSModule == false then the USS module will have the default module configuration after a power-up clear (PUC) reset. Note: This functionality is only available in MSP430FR604x Rev B or later silicon. If the code is running on Rev A silicon and this API is called the API will return the following error message USS_meesage_code_silicon_version_does_not_support_this_functionality, it is recommended that the application checks the API return message code to confirm the USS module have been reset successfully. More... | |
USS_message_code | USS_swapCaptureChannels (USS_SW_Library_configuration *config) |
This function allows user to swap capture channels. This functionality is only available when USS_measurement_capture_sequence_ch0_ch1 or USS_measurement_capture_sequence_ch1_ch0 capture sequence is selected. More... | |
USS_message_code | USS_verifyHSPLLFrequency (USS_SW_Library_configuration *config, USS_calibration_hspll_results *testResults) |
The following API allows to verify the HSPLL frequency is set at the user selected pllOutputFreq_inHz in the USS_HSPLL_Configuration struct. The test consists on using LFXT to verify HSPLL frequency. The acquisition timer which is sourced by the HSPLL will be clear and started for this test. After 30.517 msec the acquisition timer will be stopped and the acquisition timer counter will be used to determine if HSPLL is working the tolerance frequency range. This test is run 16 times and acquisition timer counts are averaged to determine if the outcome of the test is within the desired tolerance. More... | |
USS_message_code | USS_calibrateSignalGain (USS_SW_Library_configuration *config) |
The following API runs the SDHS Signal Gain calibration routine if no errors are encountered during Signal Gain calibration the config->captureConfig->gainRange value will be configured else it will remain the original value. Please refer to agcConstant parameter description in USS_Capture_Configuration structure for more information regarding the configuration for this signal gain calibration parameter. More... | |
USS_message_code | USS_estimateDCoffset (USS_SW_Library_configuration *config, USS_dcOffEst_Calc_Mode mode) |
This API allows the user to estimate the DC offset generated by the SDHS module. More... | |
USS_message_code | USS_calculateOffsets (USS_SW_Library_configuration *config, USS_dTof_absTof_offset_results *testResults, USS_dTof_absTof_offset_test_config *testConfig) |
This API allows the user to estimate the DC offset generated by the SDHS module. More... | |
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... | |
USS_message_code | USS_testPPGconfiguration (USS_SW_Library_configuration *config, USS_test_channel PPGChannel) |
The following API will output current PPG configuration. PPG configuration is controlled via the following USS_Measurement_Configuration parameter: More... | |
USS_message_code | USS_testSDHSconversion (USS_SW_Library_configuration *config, USS_test_channel SDHSChannel, USS_capture_power_mode_option mode) |
The following trigger manual SDHS conversion with current SDHS configuration. SDHS configuration is controlled via the USS_Measurement_Configuration struct and . The API will perform the following operations: More... | |
USS_message_code | USS_startPPGToneGeneration (USS_SW_Library_configuration *config, USS_test_channel PPGChannel) |
The following API will the tone generation output in the SAPH module. Tone generation is controlled via the following USS_Measurement_Configuration parameter: More... | |
USS_message_code | USS_stopPPGToneGeneration (USS_SW_Library_configuration *config) |
The following API will stop the tone generation output in the SAPH module. More... | |
int16_t * | USS_getUPSPtr (USS_SW_Library_configuration *config) |
The following API allows to obtain the address were UPS capture starts. IMPORTANT: USS_configureUltrasonicMeasurement API must be call in the application first before using this API. More... | |
int16_t * | USS_getDNSPtr (USS_SW_Library_configuration *config) |
The following API allows to obtain the address were DNS capture starts. IMPORTANT: USS_configureUltrasonicMeasurement API must be call in the application first before using this API. More... | |
void | USS_registerSDHSInterruptCallback (USS_SDHS_Interrupt interruptNum, void function(void)) |
The following API registers a function callback to the desired SAPH interrupt vector. More... | |
void | USS_registerSAPHInterruptCallback (USS_SAPH_Interrupt interruptNum, void function(void)) |
The following API registers a function callback to the desired SAPH interrupt vector. More... | |
void | USS_registerUUPSInterruptCallback (USS_UUPS_Interrupt interruptNum, void function(void)) |
The following API registers a function callback to the desired UUPS interrupt vector. More... | |
void | USS_registerHSPLLInterruptCallback (USS_HSPLL_Interrupt interruptNum, void function(void)) |
The following API registers a function callback to the desired HSPLL interrupt vector. More... | |
void | USS_unregisterSDHSInterruptCallback (USS_SDHS_Interrupt interruptNum) |
The following API registers a function callback to the desired SAPH interrupt vector. More... | |
void | USS_unregisterSAPHInterruptCallback (USS_SAPH_Interrupt interruptNum) |
The following API unregisters a function callback to the desired SAPH interrupt vector. More... | |
void | USS_unregisterUUPSInterruptCallback (USS_UUPS_Interrupt interruptNum) |
The following API unregisters a function callback to the desired UUPS interrupt vector. More... | |
void | USS_unregisterHSPLLInterruptCallback (USS_HSPLL_Interrupt interruptNum) |
The following API unregisters a function callback to the desired HSPLL interrupt vector. More... | |
Variables | |
volatile uint32_t | USSSWLIB_USS_interrupt_status |
The following variable is used to monitor USS interrupt status this variable combines SAPH, UUPS, HSPLL interrupts as well as a Timer interrupt status. More... | |
#define USS_UUPS_PWR_REQ_IGN_INTERRUPT BIT0 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS UUPS Power request ignored interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), and ISR_UUPS().
#define USS_UUPS_PWR_UP_TM_OUT_INTERRUPT BIT1 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS UUPS Power up time out interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), commonWaitForconversion(), and ISR_UUPS().
#define USS_SAPH_DATA_ERR_ABORT_INTERRUPT BIT2 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH Data error abort interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), and ISR_SAPH().
#define USS_SAPH_TMF_TM_OUT_INTERRUPT BIT3 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH Time Mark 4 time out interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), and ISR_SAPH().
#define USS_SAPH_SEQ_ACQ_DN_INTERRUPT BIT4 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH sequence acquisition done interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), commonWaitForconversion(), ISR_SAPH(), and USS_stopUltrasonicMeasurement().
#define USS_SAPH_PING_DN_INTERRUPT BIT5 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SAPH ping transmit done interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), and ISR_SAPH().
#define USS_HSPLL_PLL_UNLOCK_INTERRUPT BIT6 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS HSPLL PLL unlock interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), commonWaitForconversion(), and ISR_HSPLL().
#define USS_SDHS_WINLO_INTERRUPT BIT7 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS WINLO interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), and ISR_SDHS().
#define USS_SDHS_WINHI_INTERRUPT BIT8 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS WINHI interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), and ISR_SDHS().
#define USS_SDHS_DTRDY_INTERRUPT BIT9 |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS DTRDY interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), and ISR_SDHS().
#define USS_SDHS_SSTRG_INTERRUPT BITA |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS SSTRG interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), and ISR_SDHS().
#define USS_SDHS_ACQDONE_INTERRUPT BITB |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS SMPSZ interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), commonWaitForconversion(), and ISR_SDHS().
#define USS_SDHS_OVF_INTERRUPT BITC |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SDHS OVF interrupt has been triggered.
Referenced by commonClearUSSInterrupts(), and ISR_SDHS().
#define USS_TIMER_EXPIRED_INTERRUPT BITD |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if USS SW Library delay generator timer has expired.
Referenced by commonTimerGenerateLowPowerDelay(), commonTimerPeriodMeasurementClear(), USS_stopUltrasonicMeasurement(), and USSLIB_HAL_TIMER_INT().
#define USS_SAPH_SEQUENCE_STOPPED BITE |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if SAPH has been stopped.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), commonWaitForconversion(), and USS_stopUltrasonicMeasurement().
#define USS_UUPS_STOPPED_BY_DEBUGGER BITF |
This defines can be used to mask USSSWLIB_USS_interrupt_status variable and determine if UUPS has been stopped by the debugger.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), commonWaitForconversion(), and ISR_UUPS().
#define USS_TIMER_EXPIRED_EVENT1_INTERRUPT 0x10000 |
This bit determines if the first event of period measurement is complete.
Referenced by commonTimerPeriodMeasurementClear(), and USSLIB_HAL_TIMER_INT_CCRn().
#define USS_SAPH_DMA_ACK_VIOLATION (0x00010000) |
This define can be used to mask USSSWLIB_USS_interrupt_status variable and determine if SAPH generated an DMA acknowledgment violation.
Referenced by commonClearUSSInterrupts().
#define HARDWAREWREG16 | ( | x | ) | (*((volatile uint16_t *)((uint16_t)x))) |
Referenced by commonClearCCFlagStart(), commonTimerClear(), commonTimerConfigureDelay(), commonTimerConfigurePeriodMeasurement(), commonTimerConfigureTimer(), commonTimerDisableInterrupt(), commonTimerEnableInterrupt(), commonTimerPeriodMeasurementClear(), commonTimerPeriodMeasurementDisableInterrupts(), commonTimerPeriodMeasurementEnableInterrupts(), commonTimerPollInterruptFlag(), commonTimerStart(), commonTimerStop(), USS_testSDHSconversion(), USSLIB_HAL_TIMER_INT(), and USSLIB_HAL_TIMER_INT_CCRn().
#define USS_Alg_dToF_Calculation_Option_gas USS_Alg_dToF_Calculation_Option_estimate |
typedef enum _USS_message_code_ USS_message_code |
The following enumeration contain all possible USS SW Library return message codes.
typedef enum _USS_diagnostics_mode_ USS_diagnostics_mode |
Selects diagnostic mode to be used by the library. For optimal power consumption it is recommended to use USS_diagnostics_mode_0. During development it is recommended to use USS_diagnostics_mode_2.
typedef enum _USS_capture_power_mode_ USS_capture_power_mode_option |
Selects the desired power mode while USS capture is done, API will remain in this mode until capture is done.
typedef enum _USS_stop_measurement_state_ USS_stop_measurement_state |
Selects USS state after capture has been stopped.
Allows user to select USS channel drive strength. User can select between max strength and pre-trimmed drive.
typedef enum _USS_measurement_pause_state_ USS_measurement_pause_state |
Allows user to select pause state. Pause state is considered to be time before and after USS Channel Pulse Generation.
Allows user to select starting pulse state.
Allows user to select the ULP bias delay during USS Power up. sequence. The ULP bias allows a faster channel setting on reactive input loads. Please refer the device User's guide UUPS and SAPH chapter for further recommendations regarding ULP bias.
The following parameter allows the application to control the RX/TX bias during the acquisition sequence. For resistive loads a low impedance generates the fastest settling times. For reactive loads a different impedance setting might be needed to generate a gentler build up of the bias voltage. Please refer to device User's guide SAPH chapter for further recommended usage.
The following parameter allow application to turn on/off the PGA input multiplexer during the whole firing/capture sequence. Having the the charge always on allows to reduce the RX signal noise. Please refer to the SAPH chapter in the device User's guide for detailed recommended usage of this functionality.
Lists pulse generation options.
typedef enum _USS_test_channel_ USS_test_channel |
Selects USS channel to be used for test (Used for Application Debug API)
Allows user to select USS capture sequence.
This is the USS state after capture is done.
Configures SDHS Over Sample Rate
Registers modified: SDHS.CTL0.OBR
typedef enum _USS_Capture_Gain_Range_ USS_Capture_Gain_Range |
Selects Programmable Gain Amplifier (PGA) range.
typedef enum _USS_Capture_Calibration_ USS_Capture_Calibration |
Selects Programmable Gain Amplifier (PGA) range.
Selects USS trigger option.
typedef enum _USS_HSPLL_input_clock_freq_ USS_HSPLL_input_clock_freq |
Selects USS Crystal Frequency.
typedef enum _USS_HSPLL_input_clock_type_ USS_HSPLL_input_clock_type |
Selects USS HSPLL input clock Type.
typedef enum _USS_HSPLL_output_clk_freq_ USS_HSPLL_output_clk_freq |
Selects USS HSPLL output clock frequency.
typedef enum USS_SDHS_Interrupt USS_SDHS_Interrupt |
Selects appropiate USS SDHS interrupt (Used to register interrupt callback functions)
typedef enum USS_SAPH_Interrupt USS_SAPH_Interrupt |
Selects appropiate USS SAPH interrupt (Used to register interrupt callback functions)
typedef enum USS_UUPS_Interrupt USS_UUPS_Interrupt |
Used to configure USS UUPS interrupt callback.
typedef enum USS_HSPLL_Interrupt USS_HSPLL_Interrupt |
Used to configure USS HSPLL interrupt callback.
typedef enum _USS_highFlow_option_ USS_highFlow_option |
Defines high flow computation options.
typedef enum _USS_low_power_mode_option_ USS_low_power_mode_option |
Selects the desired power mode while USS capture is done.
Selects the interval to calculate Delta ToF and Volume Flow.
typedef enum _USS_dcOffEst_Calc_Mode_ USS_dcOffEst_Calc_Mode |
Selects the UPS/DNS DC offset estimation mode used by USS_estimateDCoffset API.
Enumerated type for absTOF algorithm selection.
Enumerated type for dToF algorithm selection.
Enumerated type for volume flow rate algorithm selection.
Contain meter constant calibration data.
typedef struct _USS_System_Configuration_ USS_System_Configuration |
Contains USS SW Lib System Configuration.
typedef struct _USS_Pulse_Additional_End_of_Sequence_Configuration_ USS_Pulse_Additional_End_of_Sequence_Configuration |
Structure to configure additional multi tone pulse generation.
structure to configure multi tone pulse generation
The following structure allows user to specify single and dual tone configuration.
typedef struct _USS_Pulse_Configuration_ USS_Pulse_Configuration |
Allows user to specify the pulse configuration.
typedef struct _USS_Meter_Configuration_ USS_Meter_Configuration |
Contains USS SW Lib Meter Configuration.
typedef struct _USS_Measurement_Configuration_ USS_Measurement_Configuration |
Contains USS SW Lib Measurement Configuration.
typedef struct _USS_HSPLL_Configuration_ USS_HSPLL_Configuration |
Contains USS SW Lib HSPLL Configuration.
This structure is passed to USS_calculateOffsets API and define the test calibration configuration.
typedef struct _USS_dTof_absTof_offset_results_ USS_dTof_absTof_offset_results |
This structure is passed to USS_calculateOffsets API and calibration test result will be returned in this structure.
typedef struct _USS_calibration_hspll_results_ USS_calibration_hspll_results |
This structure is passed to USS_verifyHSPLLFrequency API and test result will be returned using this structure.
typedef struct _USS_Capture_Configuration_ USS_Capture_Configuration |
Contains USS SW Lib Capture Configuration.
typedef struct _USS_Trigger_Configuration_ USS_Trigger_Configuration |
Contains USS SW Lib Trigger Configuration.
typedef struct _USS_Interrupt_Configuration_ USS_Interrupt_Configuration |
Contains USS SW Lib Capture Configuration.
Contains USS SW Lib Algorithms User Configuration.
typedef struct _USS_Algorithms_Results_ USS_Algorithms_Results |
Contains USS SW Lib Algorithms Results.
Contains USS SW Lib Algorithms Results.
typedef struct _USS_SW_Library_configuration_ USS_SW_Library_configuration |
Contains USS SW Lib configuration.
enum _USS_message_code_ |
The following enumeration contain all possible USS SW Library return message codes.
Selects diagnostic mode to be used by the library. For optimal power consumption it is recommended to use USS_diagnostics_mode_0. During development it is recommended to use USS_diagnostics_mode_2.
Selects the desired power mode while USS capture is done, API will remain in this mode until capture is done.
Enumerator | |
---|---|
USS_capture_power_mode_active | MSP remains in ACTIVE power mode until USS capture is done. |
USS_capture_power_mode_low_power_mode_0 | MSP remains in LPM0 power mode until USS capture is done. |
Allows user to select pause state. Pause state is considered to be time before and after USS Channel Pulse Generation.
Allows user to select the ULP bias delay during USS Power up. sequence. The ULP bias allows a faster channel setting on reactive input loads. Please refer the device User's guide UUPS and SAPH chapter for further recommendations regarding ULP bias.
The following parameter allows the application to control the RX/TX bias during the acquisition sequence. For resistive loads a low impedance generates the fastest settling times. For reactive loads a different impedance setting might be needed to generate a gentler build up of the bias voltage. Please refer to device User's guide SAPH chapter for further recommended usage.
The following parameter allow application to turn on/off the PGA input multiplexer during the whole firing/capture sequence. Having the the charge always on allows to reduce the RX signal noise. Please refer to the SAPH chapter in the device User's guide for detailed recommended usage of this functionality.
enum _USS_test_channel_ |
Allows user to select USS capture sequence.
This is the USS state after capture is done.
Configures SDHS Over Sample Rate
Registers modified: SDHS.CTL0.OBR
Selects Programmable Gain Amplifier (PGA) range.
Selects USS HSPLL output clock frequency.
enum USS_SDHS_Interrupt |
Selects appropiate USS SDHS interrupt (Used to register interrupt callback functions)
enum USS_SAPH_Interrupt |
Selects appropiate USS SAPH interrupt (Used to register interrupt callback functions)
enum USS_UUPS_Interrupt |
enum USS_HSPLL_Interrupt |
Defines high flow computation options.
Selects the desired power mode while USS capture is done.
Selects the interval to calculate Delta ToF and Volume Flow.
Selects the UPS/DNS DC offset estimation mode used by USS_estimateDCoffset API.
Enumerated type for absTOF algorithm selection.
volatile uint32_t USSSWLIB_USS_interrupt_status |
The following variable is used to monitor USS interrupt status this variable combines SAPH, UUPS, HSPLL interrupts as well as a Timer interrupt status.
Referenced by commonClearUSSInterrupts(), commonIsconversionSuccessfull(), commonTimerGenerateLowPowerDelay(), commonTimerPeriodMeasurementClear(), commonWaitForconversion(), ISR_HSPLL(), ISR_SAPH(), ISR_SDHS(), ISR_UUPS(), USS_commonTriggerSingleCapture(), USS_startUltrasonicMeasurement(), USS_stopUltrasonicMeasurement(), USS_updateUSSInterruptsConfiguration(), USSLIB_HAL_TIMER_INT(), and USSLIB_HAL_TIMER_INT_CCRn().