MSP430UltrasonicLibrary
02_30_00_03
|
#include <msp430.h>
#include <stdint.h>
#include <stdbool.h>
#include "ussSwLib.h"
#include "common/benchmarkussswLib.h"
#include "common/ussSwLibCommonUSS.h"
#include "common/ussSwLibCommonSDHS.h"
#include "common/ussSwLibCommonInterrupts.h"
#include "common/ussSwLibCommonTimer.h"
#include "common/USSGenericRegDef.h"
#include "USS_Lib_HAL.h"
#include "USS_Config/USS_userConfig.h"
Macros | |
#define | USS_LOW_POWER_DELAY_MAX_RERTY 3 |
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 mode) |
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_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... | |
void | USS_configAppTimerPeriod (USS_SW_Library_configuration *config, uint16_t count) |
The following API can be used to set the application timer period between USS measurements. The API allows to select the desired Low Power Mode. Global interrupts remain enable. The timer clock source for this background delay is ACLK. Therefore the timer period will be determined based on ACLK frequency (e.g. for count = 30 and ACLK freq = 32768 HZ a timer period of ~915 msec will be generated. This API will configure the config->systemConfig->measurementPeriod. More... | |
USS_message_code | USS_waitForAppTimerElapse (USS_SW_Library_configuration *config, USS_low_power_mode_option lpmMode) |
The following API can be used to wait until the background timer between USS measurements has elapsed. If the timer has elapsed prior to entering the API it will return USS_message_code_measurement_period_overflow, otherwise it will wait until the timer elapses, then return USS_message_code_no_error. Note1: USS_configAppTimerPeriod must be called prior to calling this function. More... | |
USS_message_code | USS_commonTriggerSingleCapture (USS_SW_Library_configuration *config, uint8_t captureChannel, uint16_t lowPowerDelay) |
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_CAPTURE_SEQUENCE_SELECTION_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... | |
#define USS_LOW_POWER_DELAY_MAX_RERTY 3 |
USS_message_code USS_commonTriggerSingleCapture | ( | USS_SW_Library_configuration * | config, |
uint8_t | captureChannel, | ||
uint16_t | lowPowerDelay | ||
) |
References commonEnableCaptureInterrupts(), commonIsconversionSuccessfull(), commonTimerGenerateLowPowerDelay(), commonWaitForconversion(), GENERIC_SAPH_ASCTL0, GENERIC_SAPH_ASCTL1, GENERIC_SAPH_BCTL, GENERIC_SAPH_ICR, GENERIC_SAPH_ICTL0, GENERIC_SAPH_KEY, GENERIC_SAPH_PGC, _USS_SW_Library_configuration_::measurementConfig, _USS_Pulse_Configuration_::numOfStopPulses, _USS_SW_Library_configuration_::pllConfiguration, _USS_Pulse_Multitone_Configuration_::pNumOfEPulsArray, _USS_Pulse_Multitone_Configuration_::pNumOfXPulsArray, _USS_Pulse_Multitone_Configuration_::pRAMDMAConfigArray, _USS_Pulse_Multitone_Configuration_::pRAMPulseConfigArray, _USS_Pulse_Configuration_::pToneConfig, _USS_Measurement_Configuration_::pulseConfig, _USS_Pulse_Configuration_::pulseGenMode, _USS_Pulse_Multitone_Configuration_::pXPulsHPerArray, _USS_Pulse_Multitone_Configuration_::pXPulsLPerArray, USS_capture_power_mode_low_power_mode_0, USS_CAPTURE_SEQUENCE_SELECTION_CH0, USS_CAPTURE_SEQUENCE_SELECTION_CH1, USS_INTERRUPTS_MASK, USS_low_power_mode_option_low_power_mode_3, USS_measurement_pulse_generation_mode_multi_tone, USS_message_code_error_occurred, USS_message_code_no_error, USSLIB_HAL_capture_mode_dns, USSLIB_HAL_capture_mode_ups, USSLIB_HAL_configGPIOAfterCapture(), USSLIB_HAL_configGPIOForCapture(), USSLIB_HAL_startRxEnTimer(), USSSWLIB_USS_interrupt_status, and _USS_HSPLL_Configuration_::ussXTALsettlingCount.
Referenced by USS_startLowPowerUltrasonicCapture().