EFR32 Mighty Gecko 13 Software Documentation
efr32mg13-doc-5.1.2
|
Low Energy Sensor (LESENSE) Peripheral API.
This module contains functions to control the LESENSE peripheral of Silicon Labs 32-bit MCUs and SoCs. LESENSE is a low energy sensor interface capable of autonomously collecting and processing data from multiple sensors even when in EM2.
Data Structures | |
struct | LESENSE_AltExDesc_TypeDef |
struct | LESENSE_ChAll_TypeDef |
struct | LESENSE_ChDesc_TypeDef |
struct | LESENSE_ConfAltEx_TypeDef |
struct | LESENSE_CoreCtrlDesc_TypeDef |
struct | LESENSE_DecCtrlDesc_TypeDef |
struct | LESENSE_DecStAll_TypeDef |
struct | LESENSE_DecStCond_TypeDef |
struct | LESENSE_DecStDesc_TypeDef |
struct | LESENSE_Init_TypeDef |
struct | LESENSE_PerCtrlDesc_TypeDef |
struct | LESENSE_TimeCtrlDesc_TypeDef |
Macros | |
#define | LESENSE_ALTEX_CH_CONF_DEFAULT |
#define | LESENSE_ALTEX_CONF_DEFAULT |
#define | LESENSE_CH_CONF_DEFAULT |
#define | LESENSE_CORECTRL_DESC_DEFAULT |
#define | LESENSE_DECCTRL_DESC_DEFAULT |
#define | LESENSE_DECODER_CONF_DEFAULT |
#define | LESENSE_INIT_DEFAULT |
#define | LESENSE_NUM_CHANNELS 16 |
#define | LESENSE_NUM_DECODER_STATES (_LESENSE_DECSTATE_DECSTATE_MASK + 1) |
#define | LESENSE_PERCTRL_DESC_DEFAULT |
#define | LESENSE_SCAN_CONF_DEFAULT |
#define | LESENSE_ST_CONF_DEFAULT |
#define | LESENSE_TIMECTRL_DESC_DEFAULT |
Enumerations | |
enum | LESENSE_AltExMap_TypeDef { lesenseAltExMapALTEX = _LESENSE_CTRL_ALTEXMAP_ALTEX, lesenseAltExMapCH = _LESENSE_CTRL_ALTEXMAP_CH } |
enum | LESENSE_AltExPinIdle_TypeDef { lesenseAltExPinIdleDis = _LESENSE_ALTEXCONF_IDLECONF0_DISABLE, lesenseAltExPinIdleHigh = _LESENSE_ALTEXCONF_IDLECONF0_HIGH, lesenseAltExPinIdleLow = _LESENSE_ALTEXCONF_IDLECONF0_LOW } |
enum | LESENSE_BiasMode_TypeDef { lesenseBiasModeDutyCycle = LESENSE_BIASCTRL_BIASMODE_DUTYCYCLE, lesenseBiasModeHighAcc = LESENSE_BIASCTRL_BIASMODE_HIGHACC, lesenseBiasModeDontTouch = LESENSE_BIASCTRL_BIASMODE_DONTTOUCH } |
enum | LESENSE_BufTrigLevel_TypeDef { lesenseBufTrigHalf = LESENSE_CTRL_BUFIDL_HALFFULL, lesenseBufTrigFull = LESENSE_CTRL_BUFIDL_FULL } |
enum | LESENSE_ChClk_TypeDef { lesenseClkLF = _LESENSE_CH_INTERACT_EXCLK_LFACLK, lesenseClkHF = _LESENSE_CH_INTERACT_EXCLK_AUXHFRCO } |
enum | LESENSE_ChCompMode_TypeDef { lesenseCompModeLess = LESENSE_CH_EVAL_COMP_LESS, lesenseCompModeGreaterOrEq = LESENSE_CH_EVAL_COMP_GE } |
enum | LESENSE_ChEvalMode_TypeDef { lesenseEvalModeThreshold = _LESENSE_CH_EVAL_MODE_THRES, lesenseEvalModeSlidingWindow = _LESENSE_CH_EVAL_MODE_SLIDINGWIN, lesenseEvalModeStepDetection = _LESENSE_CH_EVAL_MODE_STEPDET } |
enum | LESENSE_ChIntMode_TypeDef { lesenseSetIntNone = LESENSE_CH_INTERACT_SETIF_NONE, lesenseSetIntLevel = LESENSE_CH_INTERACT_SETIF_LEVEL, lesenseSetIntPosEdge = LESENSE_CH_INTERACT_SETIF_POSEDGE, lesenseSetIntNegEdge = LESENSE_CH_INTERACT_SETIF_NEGEDGE } |
enum | LESENSE_ChPinExMode_TypeDef { lesenseChPinExDis = LESENSE_CH_INTERACT_EXMODE_DISABLE, lesenseChPinExHigh = LESENSE_CH_INTERACT_EXMODE_HIGH, lesenseChPinExLow = LESENSE_CH_INTERACT_EXMODE_LOW, lesenseChPinExDACOut = LESENSE_CH_INTERACT_EXMODE_DACOUT } |
enum | LESENSE_ChPinIdleMode_TypeDef { lesenseChPinIdleDis = _LESENSE_IDLECONF_CH0_DISABLE, lesenseChPinIdleHigh = _LESENSE_IDLECONF_CH0_HIGH, lesenseChPinIdleLow = _LESENSE_IDLECONF_CH0_LOW, lesenseChPinIdleDACC = _LESENSE_IDLECONF_CH0_DAC } |
enum | LESENSE_ChSampleMode_TypeDef { lesenseSampleModeCounter = 0x0 << _LESENSE_CH_INTERACT_SAMPLE_SHIFT, lesenseSampleModeACMP = LESENSE_CH_INTERACT_SAMPLE_ACMP, lesenseSampleModeADC = LESENSE_CH_INTERACT_SAMPLE_ADC, lesenseSampleModeADCDiff = LESENSE_CH_INTERACT_SAMPLE_ADCDIFF } |
enum | LESENSE_ClkPresc_TypeDef { lesenseClkDiv_1 = 0, lesenseClkDiv_2 = 1, lesenseClkDiv_4 = 2, lesenseClkDiv_8 = 3, lesenseClkDiv_16 = 4, lesenseClkDiv_32 = 5, lesenseClkDiv_64 = 6, lesenseClkDiv_128 = 7 } |
enum | LESENSE_ControlACMP_TypeDef { lesenseACMPModeDisable = _LESENSE_PERCTRL_ACMP0MODE_DISABLE, lesenseACMPModeMux = _LESENSE_PERCTRL_ACMP0MODE_MUX, lesenseACMPModeMuxThres = _LESENSE_PERCTRL_ACMP0MODE_MUXTHRES } |
enum | LESENSE_ControlDACData_TypeDef { lesenseDACIfData = _LESENSE_PERCTRL_DACCH0DATA_DACDATA, lesenseThres = _LESENSE_PERCTRL_DACCH0DATA_THRES } |
enum | LESENSE_DecInput_TypeDef { lesenseDecInputSensorSt = LESENSE_DECCTRL_INPUT_SENSORSTATE, lesenseDecInputPRS = LESENSE_DECCTRL_INPUT_PRS } |
enum | LESENSE_DMAWakeUp_TypeDef { lesenseDMAWakeUpDisable = LESENSE_CTRL_DMAWU_DISABLE, lesenseDMAWakeUpBufValid = LESENSE_CTRL_DMAWU_BUFDATAV, lesenseDMAWakeUpBufLevel = LESENSE_CTRL_DMAWU_BUFLEVEL } |
enum | LESENSE_PRSSel_TypeDef { lesensePRSCh0 = 0, lesensePRSCh1 = 1, lesensePRSCh2 = 2, lesensePRSCh3 = 3, lesensePRSCh4 = 4, lesensePRSCh5 = 5, lesensePRSCh6 = 6, lesensePRSCh7 = 7, lesensePRSCh8 = 8, lesensePRSCh9 = 9, lesensePRSCh10 = 10, lesensePRSCh11 = 11 } |
enum | LESENSE_ScanConfSel_TypeDef { lesenseScanConfDirMap = LESENSE_CTRL_SCANCONF_DIRMAP, lesenseScanConfInvMap = LESENSE_CTRL_SCANCONF_INVMAP, lesenseScanConfToggle = LESENSE_CTRL_SCANCONF_TOGGLE, lesenseScanConfDecDef = LESENSE_CTRL_SCANCONF_DECDEF } |
enum | LESENSE_ScanMode_TypeDef { lesenseScanStartPeriodic = LESENSE_CTRL_SCANMODE_PERIODIC, lesenseScanStartOneShot = LESENSE_CTRL_SCANMODE_ONESHOT, lesenseScanStartPRS = LESENSE_CTRL_SCANMODE_PRS } |
enum | LESENSE_StTransAct_TypeDef { lesenseTransActNone = LESENSE_ST_TCONFA_PRSACT_NONE, lesenseTransActPRS0 = LESENSE_ST_TCONFA_PRSACT_PRS0, lesenseTransActPRS1 = LESENSE_ST_TCONFA_PRSACT_PRS1, lesenseTransActPRS01 = LESENSE_ST_TCONFA_PRSACT_PRS01, lesenseTransActPRS2 = LESENSE_ST_TCONFA_PRSACT_PRS2, lesenseTransActPRS02 = LESENSE_ST_TCONFA_PRSACT_PRS02, lesenseTransActPRS12 = LESENSE_ST_TCONFA_PRSACT_PRS12, lesenseTransActPRS012 = LESENSE_ST_TCONFA_PRSACT_PRS012, lesenseTransActUp = LESENSE_ST_TCONFA_PRSACT_UP, lesenseTransActDown = LESENSE_ST_TCONFA_PRSACT_DOWN, lesenseTransActUpAndPRS2 = LESENSE_ST_TCONFA_PRSACT_UPANDPRS2, lesenseTransActDownAndPRS2 = LESENSE_ST_TCONFA_PRSACT_DOWNANDPRS2 } |
enum | LESENSE_WarmupMode_TypeDef { lesenseWarmupModeNormal = LESENSE_PERCTRL_WARMUPMODE_NORMAL, lesenseWarmupModeACMP = LESENSE_PERCTRL_WARMUPMODE_KEEPACMPWARM, lesenseWarmupModeDAC = LESENSE_PERCTRL_WARMUPMODE_KEEPDACWARM, lesenseWarmupModeKeepWarm = LESENSE_PERCTRL_WARMUPMODE_KEEPACMPDACWARM } |
Functions | |
void | LESENSE_AltExConfig (const LESENSE_ConfAltEx_TypeDef *confAltEx) |
Configure the LESENSE alternate excitation modes. More... | |
__STATIC_INLINE uint32_t | LESENSE_ChannelActiveGet (void) |
Get the currently active channel index. More... | |
void | LESENSE_ChannelAllConfig (const LESENSE_ChAll_TypeDef *confChAll) |
Configure all (16) LESENSE sensor channels. More... | |
void | LESENSE_ChannelConfig (const LESENSE_ChDesc_TypeDef *confCh, uint32_t chIdx) |
Configure a single LESENSE sensor channel. More... | |
void | LESENSE_ChannelEnable (uint8_t chIdx, bool enaScanCh, bool enaPin) |
Enable/disable LESENSE scan channel and the pin assigned to it. More... | |
void | LESENSE_ChannelEnableMask (uint16_t chMask, uint16_t pinMask) |
Enable/disable LESENSE scan channel and the pin assigned to it. More... | |
void | LESENSE_ChannelSlidingWindow (uint8_t chIdx, uint32_t windowSize, uint32_t initValue) |
Configure Sliding Window evaluation mode for a specific channel. More... | |
void | LESENSE_ChannelStepDetection (uint8_t chIdx, uint32_t stepSize, uint32_t initValue) |
Configure step detection evaluation mode for a specific channel. More... | |
void | LESENSE_ChannelThresSet (uint8_t chIdx, uint16_t acmpThres, uint16_t cntThres) |
Set LESENSE channel threshold parameters. More... | |
void | LESENSE_ChannelTimingSet (uint8_t chIdx, uint8_t exTime, uint8_t sampleDelay, uint16_t measDelay) |
Set LESENSE channel timing parameters. More... | |
void | LESENSE_ClkDivSet (LESENSE_ChClk_TypeDef clk, LESENSE_ClkPresc_TypeDef clkDiv) |
Set clock division for LESENSE timers. More... | |
void | LESENSE_DecoderPrsOut (bool enable, uint32_t decMask, uint32_t decVal) |
Enable or disable PRS output from the LESENSE decoder. More... | |
void | LESENSE_DecoderStart (void) |
Start LESENSE decoder. More... | |
void | LESENSE_DecoderStateAllConfig (const LESENSE_DecStAll_TypeDef *confDecStAll) |
Configure all LESENSE decoder states. More... | |
void | LESENSE_DecoderStateConfig (const LESENSE_DecStDesc_TypeDef *confDecSt, uint32_t decSt) |
Configure a single LESENSE decoder state. More... | |
uint32_t | LESENSE_DecoderStateGet (void) |
Get the current state of the LESENSE decoder. More... | |
void | LESENSE_DecoderStateSet (uint32_t decSt) |
Set LESENSE decoder state. More... | |
__STATIC_INLINE void | LESENSE_DecoderStop (void) |
Stop LESENSE decoder. More... | |
void | LESENSE_Init (const LESENSE_Init_TypeDef *init, bool reqReset) |
Initialize the LESENSE module. More... | |
__STATIC_INLINE void | LESENSE_IntClear (uint32_t flags) |
Clear one or more pending LESENSE interrupts. More... | |
__STATIC_INLINE void | LESENSE_IntDisable (uint32_t flags) |
Disable one or more LESENSE interrupts. More... | |
__STATIC_INLINE void | LESENSE_IntEnable (uint32_t flags) |
Enable one or more LESENSE interrupts. More... | |
__STATIC_INLINE uint32_t | LESENSE_IntGet (void) |
Get pending LESENSE interrupt flags. More... | |
__STATIC_INLINE uint32_t | LESENSE_IntGetEnabled (void) |
Get enabled and pending LESENSE interrupt flags. More... | |
__STATIC_INLINE void | LESENSE_IntSet (uint32_t flags) |
Set one or more pending LESENSE interrupts from SW. More... | |
void | LESENSE_Reset (void) |
Reset the LESENSE module. More... | |
void | LESENSE_ResultBufferClear (void) |
Clear result buffer. More... | |
uint32_t | LESENSE_ScanFreqSet (uint32_t refFreq, uint32_t scanFreq) |
Set scan frequency for periodic scanning. More... | |
void | LESENSE_ScanModeSet (LESENSE_ScanMode_TypeDef scanMode, bool start) |
Set scan mode of the LESENSE channels. More... | |
__STATIC_INLINE uint32_t | LESENSE_ScanResultDataBufferGet (uint32_t idx) |
Get data from the result data buffer. More... | |
__STATIC_INLINE uint32_t | LESENSE_ScanResultDataGet (void) |
Get the oldest unread data from the result buffer. More... | |
__STATIC_INLINE uint32_t | LESENSE_ScanResultGet (void) |
Get the latest scan comparison result (1 bit / channel). More... | |
void | LESENSE_ScanStart (void) |
Start scanning of sensors. More... | |
void | LESENSE_ScanStop (void) |
Stop scanning of sensors. More... | |
__STATIC_INLINE uint32_t | LESENSE_SensorStateGet (void) |
Get the current state of the LESENSE sensor. More... | |
void | LESENSE_StartDelaySet (uint8_t startDelay) |
Set start delay of sensor interaction on each channel. More... | |
__STATIC_INLINE uint32_t | LESENSE_StatusGet (void) |
Get the current status of LESENSE. More... | |
__STATIC_INLINE void | LESENSE_StatusWait (uint32_t flag) |
Wait until the status of LESENSE is equal to what requested. More... | |
void | LESENSE_StepSizeSet (uint32_t stepSize) |
Set the step size for all LESENSE channels. More... | |
void | LESENSE_WindowSizeSet (uint32_t windowSize) |
Set the window size for all LESENSE channels. More... | |
#define LESENSE_ALTEX_CH_CONF_DEFAULT |
Default configuration for alternate excitation channel.
Definition at line 1008 of file em_lesense.h.
#define LESENSE_ALTEX_CONF_DEFAULT |
Default configuration for all alternate excitation channels.
Definition at line 1040 of file em_lesense.h.
#define LESENSE_CH_CONF_DEFAULT |
Default configuration for scan channel.
Definition at line 889 of file em_lesense.h.
#define LESENSE_CORECTRL_DESC_DEFAULT |
Default configuration for LESENSE_CtrlDesc_TypeDef structure.
Definition at line 579 of file em_lesense.h.
#define LESENSE_DECCTRL_DESC_DEFAULT |
Default configuration for LESENSE_PerCtrl_TypeDef structure.
Definition at line 749 of file em_lesense.h.
#define LESENSE_DECODER_CONF_DEFAULT |
Default configuration for all decoder states.
Definition at line 1147 of file em_lesense.h.
#define LESENSE_INIT_DEFAULT |
Default configuration for LESENSE_Init_TypeDef structure.
Definition at line 784 of file em_lesense.h.
#define LESENSE_NUM_CHANNELS 16 |
Number of LESENSE channels.
Definition at line 61 of file em_lesense.h.
Referenced by LESENSE_ChannelAllConfig(), LESENSE_ChannelConfig(), LESENSE_ChannelThresSet(), and LESENSE_Reset().
#define LESENSE_NUM_DECODER_STATES (_LESENSE_DECSTATE_DECSTATE_MASK + 1) |
Number of decoder states supported by current device.
Definition at line 58 of file em_lesense.h.
Referenced by LESENSE_DecoderStateAllConfig(), LESENSE_DecoderStateConfig(), and LESENSE_Reset().
#define LESENSE_PERCTRL_DESC_DEFAULT |
Default configuration for LESENSE_PerCtrl_TypeDef structure.
Definition at line 687 of file em_lesense.h.
#define LESENSE_SCAN_CONF_DEFAULT |
Default configuration for all sensor channels.
Definition at line 939 of file em_lesense.h.
#define LESENSE_ST_CONF_DEFAULT |
Default configuration for decoder state condition.
Definition at line 1089 of file em_lesense.h.
#define LESENSE_TIMECTRL_DESC_DEFAULT |
Default configuration for LESENSE_TimeCtrlDesc_TypeDef structure.
Definition at line 610 of file em_lesense.h.
Locations of the alternate excitation function.
Definition at line 135 of file em_lesense.h.
Idle phase configuration of alternate excitation channels.
Definition at line 474 of file em_lesense.h.
Bias modes.
Definition at line 181 of file em_lesense.h.
Result buffer interrupt and DMA trigger levels.
Enumerator | |
---|---|
lesenseBufTrigHalf |
DMA and interrupt flags are set when result buffer is halffull. |
lesenseBufTrigFull |
DMA and interrupt flags set when result buffer is full. |
Definition at line 154 of file em_lesense.h.
Clock used for excitation and sample delay timing.
Enumerator | |
---|---|
lesenseClkLF |
LFACLK (LF clock) is used. |
lesenseClkHF |
AUXHFRCO (HF clock) is used. |
Definition at line 423 of file em_lesense.h.
Compare modes for counter comparison.
Definition at line 434 of file em_lesense.h.
Sensor evaluation modes.
Enumerator | |
---|---|
lesenseEvalModeThreshold |
Threshold comparison evaluation mode. In this mode the sensor data is compared to the configured threshold value. Two possible comparison operators can be used on the sensor data, either >= (GE) or < (LT). Which operator to use is given using the LESENSE_ChDesc_TypeDef::compMode member. |
lesenseEvalModeSlidingWindow |
Sliding window evaluation mode. In this mode the sensor data is evaluated against the upper and lower limits of a window range. The windows range is defined by a base value and a window size. |
lesenseEvalModeStepDetection |
Step detection evaluation mode. In this mode the sensor data is compared to the sensor data from the previous measurement. The sensor evaluation will result in a "1" if the difference between the current measurement and the previous one is greater than a configurable "step size". If the difference is less than the configured step size then the sensor evaluation will result in a "0". |
Definition at line 448 of file em_lesense.h.
Interrupt generation setup for CHx interrupt flag.
Definition at line 358 of file em_lesense.h.
Channel pin mode for the excitation phase of the scan sequence.
Definition at line 375 of file em_lesense.h.
Channel pin mode for the idle phase of the scan sequence.
Definition at line 392 of file em_lesense.h.
Compare source selection for sensor sampling.
Definition at line 339 of file em_lesense.h.
Clock divisors for controlling the prescaling factor of the period counter. Note: these enumeration values are being used for different clock division related configuration parameters (hfPresc, lfPresc, pcPresc).
Definition at line 71 of file em_lesense.h.
ACMPx control configuration.
Definition at line 294 of file em_lesense.h.
DAC CHx data control configuration.
Definition at line 216 of file em_lesense.h.
Decoder input source configuration.
Enumerator | |
---|---|
lesenseDecInputSensorSt |
The SENSORSTATE register is used as input to the decoder. |
lesenseDecInputPRS |
PRS channels are used as input to the decoder. |
Definition at line 328 of file em_lesense.h.
Modes of operation for DMA wakeup from EM2.
Definition at line 165 of file em_lesense.h.
PRS sources. Note: these enumeration values are being used for different PRS related configuration parameters.
Definition at line 101 of file em_lesense.h.
Scan configuration.
Definition at line 195 of file em_lesense.h.
Scan modes.
Enumerator | |
---|---|
lesenseScanStartPeriodic |
New scan is started each time the period counter overflows. |
lesenseScanStartOneShot |
Single scan is performed when LESENSE_ScanStart() is called. |
lesenseScanStartPRS |
New scan is triggered by pulse on PRS channel. |
Definition at line 85 of file em_lesense.h.
Transition action modes.
Definition at line 491 of file em_lesense.h.
Warm up modes. ACMP and DAC duty cycle mode configuration.
Definition at line 311 of file em_lesense.h.
void LESENSE_AltExConfig | ( | const LESENSE_ConfAltEx_TypeDef * | confAltEx | ) |
Configure the LESENSE alternate excitation modes.
This function configures the alternate excitation channels of the LESENSE interface. Please refer to the configuration parameter type definition (LESENSE_ConfAltEx_TypeDef) for more details.
useAltEx
must be true in the channel configuration structrure (LESENSE_ChDesc_TypeDef) in order to use alternate excitation pins on the channel.[in] | confAltEx | Configuration structure for LESENSE alternate excitation pins. |
Definition at line 620 of file em_lesense.c.
References _LESENSE_CTRL_ALTEXMAP_SHIFT, LESENSE_ConfAltEx_TypeDef::AltEx, LESENSE_ConfAltEx_TypeDef::altExMap, LESENSE_AltExDesc_TypeDef::alwaysEx, BUS_RegBitWrite(), LESENSE_AltExDesc_TypeDef::enablePin, LESENSE_AltExDesc_TypeDef::idleConf, LESENSE, lesenseAltExMapALTEX, and lesenseAltExMapCH.
__STATIC_INLINE uint32_t LESENSE_ChannelActiveGet | ( | void | ) |
Get the currently active channel index.
Definition at line 1310 of file em_lesense.h.
References LESENSE.
void LESENSE_ChannelAllConfig | ( | const LESENSE_ChAll_TypeDef * | confChAll | ) |
Configure all (16) LESENSE sensor channels.
This function configures all the sensor channels of LESENSE interface. Please refer to the configuration parameter type definition (LESENSE_ChAll_TypeDef) for more details.
[in] | confChAll | Configuration structure for all (16) LESENSE sensor channels. |
Definition at line 476 of file em_lesense.c.
References LESENSE_ChAll_TypeDef::Ch, LESENSE_ChannelConfig(), and LESENSE_NUM_CHANNELS.
Referenced by CAPLESENSE_setupLESENSE().
void LESENSE_ChannelConfig | ( | const LESENSE_ChDesc_TypeDef * | confCh, |
uint32_t | chIdx | ||
) |
Configure a single LESENSE sensor channel.
This function configures a single sensor channel of the LESENSE interface. Please refer to the configuration parameter type definition (LESENSE_ChDesc_TypeDef) for more details.
useAltEx
must be true in the channel configuration in order to use alternate excitation pins.[in] | confCh | Configuration structure for a single LESENSE sensor channel. |
[in] | chIdx | Channel index to configure (0-15). |
Definition at line 511 of file em_lesense.c.
References _LESENSE_CH_EVAL_DECODE_SHIFT, _LESENSE_CH_EVAL_MODE_MASK, _LESENSE_CH_EVAL_MODE_SHIFT, _LESENSE_CH_EVAL_SCANRESINV_SHIFT, _LESENSE_CH_EVAL_STRSAMPLE_SHIFT, _LESENSE_CH_INTERACT_ALTEX_SHIFT, _LESENSE_CH_INTERACT_EXCLK_SHIFT, _LESENSE_CH_INTERACT_SAMPLECLK_SHIFT, _LESENSE_CH_TIMING_EXTIME_MASK, _LESENSE_CH_TIMING_EXTIME_SHIFT, _LESENSE_CH_TIMING_MEASUREDLY_MASK, _LESENSE_CH_TIMING_MEASUREDLY_SHIFT, _LESENSE_CH_TIMING_SAMPLEDLY_MASK, _LESENSE_CH_TIMING_SAMPLEDLY_SHIFT, LESENSE_ChDesc_TypeDef::acmpThres, BUS_RegBitWrite(), LESENSE_ChDesc_TypeDef::chPinExMode, LESENSE_ChDesc_TypeDef::chPinIdleMode, LESENSE_ChDesc_TypeDef::cntThres, LESENSE_ChDesc_TypeDef::compMode, LESENSE_ChDesc_TypeDef::enaInt, LESENSE_ChDesc_TypeDef::enaPin, LESENSE_ChDesc_TypeDef::enaScanCh, LESENSE_ChDesc_TypeDef::evalMode, LESENSE_ChDesc_TypeDef::exClk, LESENSE_ChDesc_TypeDef::exTime, LESENSE_ChDesc_TypeDef::intMode, LESENSE_ChDesc_TypeDef::invRes, LESENSE, LESENSE_ChannelThresSet(), LESENSE_ChannelTimingSet(), LESENSE_NUM_CHANNELS, lesenseChPinExDACOut, LESENSE_ChDesc_TypeDef::measDelay, LESENSE_ChDesc_TypeDef::sampleClk, LESENSE_ChDesc_TypeDef::sampleDelay, LESENSE_ChDesc_TypeDef::sampleMode, LESENSE_ChDesc_TypeDef::shiftRes, LESENSE_ChDesc_TypeDef::storeCntRes, and LESENSE_ChDesc_TypeDef::useAltEx.
Referenced by LESENSE_ChannelAllConfig().
void LESENSE_ChannelEnable | ( | uint8_t | chIdx, |
bool | enaScanCh, | ||
bool | enaPin | ||
) |
Enable/disable LESENSE scan channel and the pin assigned to it.
Use this function to enable/disable a selected LESENSE scan channel and the pin assigned to.
[in] | chIdx | Identifier of the scan channel. Valid range: 0-15. |
[in] | enaScanCh | Enable/disable the selected scan channel by setting this parameter to true/false respectively. |
[in] | enaPin | Enable/disable the pin assigned to the channel selected by chIdx . |
Definition at line 708 of file em_lesense.c.
References BUS_RegBitWrite(), and LESENSE.
void LESENSE_ChannelEnableMask | ( | uint16_t | chMask, |
uint16_t | pinMask | ||
) |
Enable/disable LESENSE scan channel and the pin assigned to it.
Use this function to enable/disable LESENSE scan channels and the pins assigned to them using a mask.
[in] | chMask | Set the corresponding bit to 1 to enable, 0 to disable the selected scan channel. |
[in] | pinMask | Set the corresponding bit to 1 to enable, 0 to disable the pin on selected channel. |
Definition at line 745 of file em_lesense.c.
References LESENSE.
void LESENSE_ChannelSlidingWindow | ( | uint8_t | chIdx, |
uint32_t | windowSize, | ||
uint32_t | initValue | ||
) |
Configure Sliding Window evaluation mode for a specific channel.
This function will configure the evaluation mode, the initial sensor measurement (COMPTHRES) and the window size. For other channel related configuration see the LESENSE_ChannelConfig() function.
[in] | chIdx | Identifier of the scan channel. Valid range: 0-15. |
[in] | windowSize | Window size to be used on all channels. |
[in] | initValue | The initial sensor value for the channel. |
Definition at line 892 of file em_lesense.c.
References _LESENSE_CH_EVAL_COMPTHRES_MASK, _LESENSE_CH_EVAL_COMPTHRES_SHIFT, _LESENSE_CH_EVAL_MODE_MASK, LESENSE_CH_TypeDef::EVAL, LESENSE, LESENSE_CH_EVAL_MODE_SLIDINGWIN, and LESENSE_WindowSizeSet().
void LESENSE_ChannelStepDetection | ( | uint8_t | chIdx, |
uint32_t | stepSize, | ||
uint32_t | initValue | ||
) |
Configure step detection evaluation mode for a specific channel.
This function will configure the evaluation mode, the initial sensor measurement (COMPTHRES) and the window size. For other channel related configuration see the LESENSE_ChannelConfig() function.
[in] | chIdx | Identifier of the scan channel. Valid range: 0-15. |
[in] | stepSize | Step size to be used on all channels. |
[in] | initValue | The initial sensor value for the channel. |
Definition at line 929 of file em_lesense.c.
References _LESENSE_CH_EVAL_COMPTHRES_MASK, _LESENSE_CH_EVAL_COMPTHRES_SHIFT, _LESENSE_CH_EVAL_MODE_MASK, LESENSE_CH_TypeDef::EVAL, LESENSE, LESENSE_CH_EVAL_MODE_STEPDET, and LESENSE_StepSizeSet().
void LESENSE_ChannelThresSet | ( | uint8_t | chIdx, |
uint16_t | acmpThres, | ||
uint16_t | cntThres | ||
) |
Set LESENSE channel threshold parameters.
Use this function to set threshold parameters on a selected LESENSE channel.
[in] | chIdx | Identifier of the scan channel. Valid range: 0-15. |
[in] | acmpThres | ACMP threshold.
|
[in] | cntThres | Decision threshold for counter comparison. Valid range: 0-65535 (16 bits). |
Definition at line 837 of file em_lesense.c.
References _LESENSE_CH_EVAL_COMPTHRES_MASK, _LESENSE_CH_EVAL_COMPTHRES_SHIFT, LESENSE, and LESENSE_NUM_CHANNELS.
Referenced by CAPLESENSE_setupLESENSE(), and LESENSE_ChannelConfig().
void LESENSE_ChannelTimingSet | ( | uint8_t | chIdx, |
uint8_t | exTime, | ||
uint8_t | sampleDelay, | ||
uint16_t | measDelay | ||
) |
Set LESENSE channel timing parameters.
Use this function to set timing parameters on a selected LESENSE channel.
[in] | chIdx | Identifier of the scan channel. Valid range: 0-15. |
[in] | exTime | Excitation time on chIdx. Excitation will last exTime+1 excitation clock cycles. Valid range: 0-63 (6 bits). |
[in] | sampleDelay | Sample delay on chIdx. Sampling will occur after sampleDelay+1 sample clock cycles. Valid range: 0-127 (7 bits). |
[in] | measDelay | Measure delay on chIdx. Sensor measuring is delayed for measDelay+1 excitation clock cycles. Valid range: 0-127 (7 bits). |
Definition at line 782 of file em_lesense.c.
References _LESENSE_CH_TIMING_EXTIME_MASK, _LESENSE_CH_TIMING_EXTIME_SHIFT, _LESENSE_CH_TIMING_MEASUREDLY_MASK, _LESENSE_CH_TIMING_MEASUREDLY_SHIFT, _LESENSE_CH_TIMING_SAMPLEDLY_MASK, _LESENSE_CH_TIMING_SAMPLEDLY_SHIFT, and LESENSE.
Referenced by LESENSE_ChannelConfig().
void LESENSE_ClkDivSet | ( | LESENSE_ChClk_TypeDef | clk, |
LESENSE_ClkPresc_TypeDef | clkDiv | ||
) |
Set clock division for LESENSE timers.
Use this function to configure the clock division for the LESENSE timers used for excitation timing. The division setting is global, but the clock source can be selected for each channel using LESENSE_ChannelConfig() function, please refer to the documentation of it for more details.
[in] | clk | Select clock to prescale.
|
[in] | clkDiv | Clock divisor value. Valid range depends on the clk value. |
Definition at line 414 of file em_lesense.c.
References _LESENSE_TIMCTRL_AUXPRESC_MASK, _LESENSE_TIMCTRL_AUXPRESC_SHIFT, _LESENSE_TIMCTRL_LFPRESC_MASK, _LESENSE_TIMCTRL_LFPRESC_SHIFT, LESENSE, lesenseClkDiv_8, lesenseClkHF, and lesenseClkLF.
Referenced by CAPLESENSE_setupLESENSE().
void LESENSE_DecoderPrsOut | ( | bool | enable, |
uint32_t | decMask, | ||
uint32_t | decVal | ||
) |
Enable or disable PRS output from the LESENSE decoder.
[in] | enable | enable/disable the PRS output from the LESENSE decoder. true to enable and false to disable. |
[in] | decMask | Decoder state compare value mask |
[in] | decVal | Decoder state compare value. |
Definition at line 1115 of file em_lesense.c.
References _LESENSE_PRSCTRL_DECCMPEN_SHIFT, _LESENSE_PRSCTRL_DECCMPMASK_SHIFT, _LESENSE_PRSCTRL_DECCMPVAL_SHIFT, and LESENSE.
void LESENSE_DecoderStart | ( | void | ) |
Start LESENSE decoder.
Definition at line 1199 of file em_lesense.c.
References LESENSE, LESENSE_CMD_DECODE, and LESENSE_SYNCBUSY_CMD.
void LESENSE_DecoderStateAllConfig | ( | const LESENSE_DecStAll_TypeDef * | confDecStAll | ) |
Configure all LESENSE decoder states.
This function configures all the decoder states of the LESENSE interface. Please refer to the configuration parameter type definition (LESENSE_DecStAll_TypeDef) for more details.
[in] | confDecStAll | Configuration structure for all (16 or 32) LESENSE decoder states. |
Definition at line 999 of file em_lesense.c.
References LESENSE_DecoderStateConfig(), LESENSE_NUM_DECODER_STATES, and LESENSE_DecStAll_TypeDef::St.
void LESENSE_DecoderStateConfig | ( | const LESENSE_DecStDesc_TypeDef * | confDecSt, |
uint32_t | decSt | ||
) |
Configure a single LESENSE decoder state.
This function configures a single decoder state of the LESENSE interface. Please refer to the configuration parameter type definition (LESENSE_DecStDesc_TypeDef) for more details.
[in] | confDecSt | Configuration structure for a single LESENSE decoder state. |
[in] | decSt | Decoder state index to configure (0-15) or (0-31) depending on device. |
Definition at line 1027 of file em_lesense.c.
References _LESENSE_ST_TCONFA_CHAIN_SHIFT, _LESENSE_ST_TCONFA_COMP_SHIFT, _LESENSE_ST_TCONFA_MASK_SHIFT, _LESENSE_ST_TCONFA_NEXTSTATE_SHIFT, _LESENSE_ST_TCONFA_SETIF_SHIFT, _LESENSE_ST_TCONFB_COMP_SHIFT, _LESENSE_ST_TCONFB_MASK_SHIFT, _LESENSE_ST_TCONFB_NEXTSTATE_SHIFT, _LESENSE_ST_TCONFB_SETIF_SHIFT, LESENSE_DecStDesc_TypeDef::chainDesc, LESENSE_DecStCond_TypeDef::compMask, LESENSE_DecStCond_TypeDef::compVal, LESENSE_DecStDesc_TypeDef::confA, LESENSE_DecStDesc_TypeDef::confB, LESENSE, LESENSE_NUM_DECODER_STATES, LESENSE_DecStCond_TypeDef::nextState, LESENSE_DecStCond_TypeDef::prsAct, and LESENSE_DecStCond_TypeDef::setInt.
Referenced by LESENSE_DecoderStateAllConfig().
uint32_t LESENSE_DecoderStateGet | ( | void | ) |
Get the current state of the LESENSE decoder.
Definition at line 1095 of file em_lesense.c.
References _LESENSE_DECSTATE_DECSTATE_MASK, and LESENSE.
void LESENSE_DecoderStateSet | ( | uint32_t | decSt | ) |
Set LESENSE decoder state.
This function can be used for setting the initial state of the LESENSE decoder.
[in] | decSt | Decoder state to set as current state. Valid range: 0-15 or 0-31 depending on device. |
Definition at line 1079 of file em_lesense.c.
References _LESENSE_DECSTATE_DECSTATE_MASK, and LESENSE.
Referenced by LESENSE_Init().
__STATIC_INLINE void LESENSE_DecoderStop | ( | void | ) |
Stop LESENSE decoder.
This function disables the LESENSE decoder by setting the command to the LESENSE_DECCTRL register.
Definition at line 1248 of file em_lesense.h.
References LESENSE, and LESENSE_DECCTRL_DISABLE.
void LESENSE_Init | ( | const LESENSE_Init_TypeDef * | init, |
bool | reqReset | ||
) |
Initialize the LESENSE module.
This function configures the main parameters of the LESENSE interface. Please refer to the initialization parameter type definition (LESENSE_Init_TypeDef) for more details.
reqReset
to true is required in each reset or power-on cycle in order to configure the default values of the RAM mapped LESENSE registers. Notice that GPIO pins used by the LESENSE module must be properly configured by the user explicitly, in order for the LESENSE to work as intended. (When configuring pins, one should remember to consider the sequence of configuration, in order to avoid unintended pulses/glitches on output pins.)[in] | init | LESENSE initialization structure. |
[in] | reqReset | Request to call LESENSE_Reset() first in order to initialize all LESENSE registers with the default value. |
Definition at line 118 of file em_lesense.c.
References _LESENSE_CTRL_BUFOW_SHIFT, _LESENSE_CTRL_DEBUGRUN_SHIFT, _LESENSE_CTRL_DUALSAMPLE_SHIFT, _LESENSE_CTRL_PRSSEL_SHIFT, _LESENSE_CTRL_STRSCANRES_SHIFT, _LESENSE_DECCTRL_ERRCHK_SHIFT, _LESENSE_DECCTRL_HYSTIRQ_SHIFT, _LESENSE_DECCTRL_HYSTPRS0_SHIFT, _LESENSE_DECCTRL_HYSTPRS1_SHIFT, _LESENSE_DECCTRL_HYSTPRS2_SHIFT, _LESENSE_DECCTRL_INTMAP_SHIFT, _LESENSE_DECCTRL_PRSCNT_SHIFT, _LESENSE_DECCTRL_PRSSEL0_SHIFT, _LESENSE_DECCTRL_PRSSEL1_SHIFT, _LESENSE_DECCTRL_PRSSEL2_SHIFT, _LESENSE_DECCTRL_PRSSEL3_SHIFT, _LESENSE_PERCTRL_ACMP0INV_MASK, _LESENSE_PERCTRL_ACMP0INV_SHIFT, _LESENSE_PERCTRL_ACMP0MODE_SHIFT, _LESENSE_PERCTRL_ACMP1INV_SHIFT, _LESENSE_PERCTRL_ACMP1MODE_SHIFT, _LESENSE_PERCTRL_DACCH0DATA_SHIFT, _LESENSE_PERCTRL_DACCH1DATA_SHIFT, _LESENSE_PERCTRL_DACCONVTRIG_SHIFT, _LESENSE_TIMCTRL_AUXSTARTUP_MASK, _LESENSE_TIMCTRL_AUXSTARTUP_SHIFT, LESENSE_PerCtrlDesc_TypeDef::acmp0Mode, LESENSE_PerCtrlDesc_TypeDef::acmp1Mode, LESENSE_CoreCtrlDesc_TypeDef::biasMode, LESENSE_CoreCtrlDesc_TypeDef::bufOverWr, LESENSE_CoreCtrlDesc_TypeDef::bufTrigLevel, LESENSE_DecCtrlDesc_TypeDef::chkState, LESENSE_Init_TypeDef::coreCtrl, LESENSE_PerCtrlDesc_TypeDef::dacCh0Data, LESENSE_PerCtrlDesc_TypeDef::dacCh1Data, LESENSE_PerCtrlDesc_TypeDef::dacScan, LESENSE_CoreCtrlDesc_TypeDef::debugRun, LESENSE_Init_TypeDef::decCtrl, LESENSE_DecCtrlDesc_TypeDef::decInput, LESENSE_TimeCtrlDesc_TypeDef::delayAuxStartup, LESENSE_CoreCtrlDesc_TypeDef::dualSample, LESENSE_DecCtrlDesc_TypeDef::hystIRQ, LESENSE_DecCtrlDesc_TypeDef::hystPRS0, LESENSE_DecCtrlDesc_TypeDef::hystPRS1, LESENSE_DecCtrlDesc_TypeDef::hystPRS2, LESENSE_DecCtrlDesc_TypeDef::initState, LESENSE_DecCtrlDesc_TypeDef::intMap, LESENSE_CoreCtrlDesc_TypeDef::invACMP0, LESENSE_CoreCtrlDesc_TypeDef::invACMP1, LESENSE, LESENSE_DecoderStateSet(), LESENSE_Reset(), LESENSE_ScanModeSet(), LESENSE_StartDelaySet(), LESENSE_Init_TypeDef::perCtrl, LESENSE_DecCtrlDesc_TypeDef::prsChSel0, LESENSE_DecCtrlDesc_TypeDef::prsChSel1, LESENSE_DecCtrlDesc_TypeDef::prsChSel2, LESENSE_DecCtrlDesc_TypeDef::prsChSel3, LESENSE_DecCtrlDesc_TypeDef::prsCount, LESENSE_CoreCtrlDesc_TypeDef::prsSel, LESENSE_CoreCtrlDesc_TypeDef::scanConfSel, LESENSE_CoreCtrlDesc_TypeDef::scanStart, LESENSE_TimeCtrlDesc_TypeDef::startDelay, LESENSE_CoreCtrlDesc_TypeDef::storeScanRes, LESENSE_Init_TypeDef::timeCtrl, LESENSE_CoreCtrlDesc_TypeDef::wakeupOnDMA, and LESENSE_PerCtrlDesc_TypeDef::warmupMode.
Referenced by CAPLESENSE_setupLESENSE().
__STATIC_INLINE void LESENSE_IntClear | ( | uint32_t | flags | ) |
Clear one or more pending LESENSE interrupts.
[in] | flags | Pending LESENSE interrupt sources to clear. Use a set of interrupt flags OR-ed together to clear multiple interrupt sources of the LESENSE module (LESENSE_IF_nnn). |
Definition at line 1417 of file em_lesense.h.
References LESENSE.
Referenced by CAPLESENSE_setupLESENSE(), and LESENSE_IRQHandler().
__STATIC_INLINE void LESENSE_IntDisable | ( | uint32_t | flags | ) |
Disable one or more LESENSE interrupts.
[in] | flags | LESENSE interrupt sources to disable. Use a set of interrupt flags OR-ed together to disable multiple interrupt sources of the LESENSE module (LESENSE_IF_nnn). |
Definition at line 1447 of file em_lesense.h.
References LESENSE.
Referenced by CAPLESENSE_setupLESENSE().
__STATIC_INLINE void LESENSE_IntEnable | ( | uint32_t | flags | ) |
Enable one or more LESENSE interrupts.
[in] | flags | LESENSE interrupt sources to enable. Use a set of interrupt flags OR-ed together to enable multiple interrupt sources of the LESENSE module (LESENSE_IF_nnn). |
Definition at line 1432 of file em_lesense.h.
References LESENSE.
Referenced by CAPLESENSE_setupLESENSE().
__STATIC_INLINE uint32_t LESENSE_IntGet | ( | void | ) |
Get pending LESENSE interrupt flags.
Definition at line 1479 of file em_lesense.h.
References LESENSE.
__STATIC_INLINE uint32_t LESENSE_IntGetEnabled | ( | void | ) |
Get enabled and pending LESENSE interrupt flags.
Useful for handling more interrupt sources in the same interrupt handler.
Definition at line 1503 of file em_lesense.h.
References LESENSE.
Referenced by LESENSE_IRQHandler().
__STATIC_INLINE void LESENSE_IntSet | ( | uint32_t | flags | ) |
Set one or more pending LESENSE interrupts from SW.
[in] | flags | LESENSE interrupt sources to set to pending. Use a set of interrupt flags OR-ed together to set multiple interrupt sources of the LESENSE module (LESENSE_IFS_nnn). |
Definition at line 1462 of file em_lesense.h.
References LESENSE.
void LESENSE_Reset | ( | void | ) |
Reset the LESENSE module.
Use this function to reset the LESENSE registers.
reqReset
parameter to true in LESENSE_Init(). Definition at line 1258 of file em_lesense.c.
References _LESENSE_ALTEXCONF_RESETVALUE, _LESENSE_BIASCTRL_RESETVALUE, _LESENSE_CH_EVAL_RESETVALUE, _LESENSE_CH_INTERACT_RESETVALUE, _LESENSE_CH_TIMING_RESETVALUE, _LESENSE_CHEN_RESETVALUE, _LESENSE_CTRL_RESETVALUE, _LESENSE_DECCTRL_RESETVALUE, _LESENSE_EVALCTRL_RESETVALUE, _LESENSE_IDLECONF_RESETVALUE, _LESENSE_IEN_RESETVALUE, _LESENSE_IFC_MASK, _LESENSE_PERCTRL_RESETVALUE, _LESENSE_PRSCTRL_RESETVALUE, _LESENSE_ROUTEPEN_RESETVALUE, _LESENSE_ST_TCONFA_RESETVALUE, _LESENSE_ST_TCONFB_RESETVALUE, LESENSE, LESENSE_CMD_CLEARBUF, LESENSE_CMD_STOP, LESENSE_DECCTRL_DISABLE, LESENSE_NUM_CHANNELS, LESENSE_NUM_DECODER_STATES, and LESENSE_SYNCBUSY_CMD.
Referenced by LESENSE_Init().
void LESENSE_ResultBufferClear | ( | void | ) |
Clear result buffer.
Definition at line 1229 of file em_lesense.c.
References LESENSE, LESENSE_CMD_CLEARBUF, and LESENSE_SYNCBUSY_CMD.
Referenced by CAPLESENSE_setupLESENSE().
uint32_t LESENSE_ScanFreqSet | ( | uint32_t | refFreq, |
uint32_t | scanFreq | ||
) |
Set scan frequency for periodic scanning.
This function only applies to LESENSE if period counter is being used as a trigger for scan start. The calculation is based on the following formula: Fscan = LFACLKles / ((1+PCTOP)*2^PCPRESC)
[in] | refFreq | Select reference LFACLK clock frequency in Hz. If set to 0, the current clock frequency is being used as a reference. |
[in] | scanFreq | Set the desired scan frequency in Hz. |
Definition at line 247 of file em_lesense.c.
References _LESENSE_TIMCTRL_PCPRESC_MASK, _LESENSE_TIMCTRL_PCPRESC_SHIFT, _LESENSE_TIMCTRL_PCTOP_MASK, _LESENSE_TIMCTRL_PCTOP_SHIFT, CMU_ClockFreqGet(), cmuClock_LESENSE, LESENSE, and lesenseClkDiv_128.
Referenced by CAPLESENSE_setupLESENSE().
void LESENSE_ScanModeSet | ( | LESENSE_ScanMode_TypeDef | scanMode, |
bool | start | ||
) |
Set scan mode of the LESENSE channels.
This function configures how the scan start is being triggered. It can be used for re-configuring the scan mode while running the application but it is also used by LESENSE_Init() for initialization.
[in] | scanMode | Select where to map LESENSE alternate excitation channels.
|
[in] | start | If true, LESENSE_ScanStart() is immediately issued after configuration. |
Definition at line 329 of file em_lesense.c.
References _LESENSE_CTRL_SCANMODE_MASK, LESENSE, and LESENSE_ScanStart().
Referenced by LESENSE_Init().
__STATIC_INLINE uint32_t LESENSE_ScanResultDataBufferGet | ( | uint32_t | idx | ) |
Get data from the result data buffer.
[in] | idx | Result data buffer index. Valid range: 0-15. |
Definition at line 1367 of file em_lesense.h.
References LESENSE.
Referenced by CAPLESENSE_setupLESENSE().
__STATIC_INLINE uint32_t LESENSE_ScanResultDataGet | ( | void | ) |
Get the oldest unread data from the result buffer.
Definition at line 1346 of file em_lesense.h.
References LESENSE.
Referenced by LESENSE_IRQHandler().
__STATIC_INLINE uint32_t LESENSE_ScanResultGet | ( | void | ) |
Get the latest scan comparison result (1 bit / channel).
Definition at line 1327 of file em_lesense.h.
References _LESENSE_SCANRES_SCANRES_MASK, and LESENSE.
void LESENSE_ScanStart | ( | void | ) |
Start scanning of sensors.
Definition at line 1136 of file em_lesense.c.
References LESENSE, LESENSE_CMD_START, and LESENSE_SYNCBUSY_CMD.
Referenced by CAPLESENSE_setupLESENSE(), and LESENSE_ScanModeSet().
void LESENSE_ScanStop | ( | void | ) |
Stop scanning of sensors.
Definition at line 1169 of file em_lesense.c.
References LESENSE, LESENSE_CMD_STOP, and LESENSE_SYNCBUSY_CMD.
Referenced by CAPLESENSE_setupLESENSE().
__STATIC_INLINE uint32_t LESENSE_SensorStateGet | ( | void | ) |
Get the current state of the LESENSE sensor.
Definition at line 1381 of file em_lesense.h.
References LESENSE.
void LESENSE_StartDelaySet | ( | uint8_t | startDelay | ) |
Set start delay of sensor interaction on each channel.
This function sets start delay of sensor interaction on each channel. It can be used for adjusting the start delay while running the application but it is also used by LESENSE_Init() for initialization.
[in] | startDelay | Number of LFACLK cycles to delay. Valid range: 0-3 (2 bit). |
Definition at line 371 of file em_lesense.c.
References _LESENSE_TIMCTRL_STARTDLY_MASK, _LESENSE_TIMCTRL_STARTDLY_SHIFT, and LESENSE.
Referenced by LESENSE_Init().
__STATIC_INLINE uint32_t LESENSE_StatusGet | ( | void | ) |
Get the current status of LESENSE.
Definition at line 1269 of file em_lesense.h.
References LESENSE.
Referenced by CAPLESENSE_setupLESENSE().
__STATIC_INLINE void LESENSE_StatusWait | ( | uint32_t | flag | ) |
Wait until the status of LESENSE is equal to what requested.
This function is polling the LESENSE_STATUS register and waits until the requested combination of flags are set.
[in] | flag | The OR combination of the following status bits:
|
Definition at line 1295 of file em_lesense.h.
References LESENSE.
void LESENSE_StepSizeSet | ( | uint32_t | stepSize | ) |
Set the step size for all LESENSE channels.
The step size is configured using the same register field as use to configure window size. So calling this function will overwrite any previously configured window size as done by the LESENSE_WindowSizeSet() function.
[in] | stepSize | The step size to use for all channels. |
Definition at line 977 of file em_lesense.c.
References LESENSE_WindowSizeSet().
Referenced by LESENSE_ChannelStepDetection().
void LESENSE_WindowSizeSet | ( | uint32_t | windowSize | ) |
Set the window size for all LESENSE channels.
The window size is used by all channels that are configured as lesenseEvalModeSlidingWindow.
[in] | windowSize | The window size to use for all channels. |
Definition at line 958 of file em_lesense.c.
References _LESENSE_EVALCTRL_WINSIZE_MASK, and LESENSE.
Referenced by LESENSE_ChannelSlidingWindow(), and LESENSE_StepSizeSet().