em_lesense.c
Go to the documentation of this file.00001
00034 #include "em_lesense.h"
00035 #if defined(LESENSE_COUNT) && (LESENSE_COUNT > 0)
00036 #include "em_assert.h"
00037 #include "em_bitband.h"
00038 #include "em_cmu.h"
00039
00041 #ifndef UINT32_MAX
00042 #define UINT32_MAX ((uint32_t)(0xFFFFFFFF))
00043 #endif
00044
00046
00051
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00097 void LESENSE_Init(LESENSE_Init_TypeDef const *init, bool const reqReset)
00098 {
00099
00100 EFM_ASSERT((uint32_t)init->timeCtrl.startDelay < 4U);
00101 EFM_ASSERT((uint32_t)init->perCtrl.dacPresc < 32U);
00102
00103
00104 if (reqReset)
00105 {
00106 LESENSE_Reset();
00107 }
00108
00109
00110 LESENSE_StartDelaySet((uint32_t)init->timeCtrl.startDelay);
00111
00112
00113
00114
00115
00116
00117
00118
00119 LESENSE->CTRL = ((uint32_t)init->coreCtrl.prsSel <<
00120 _LESENSE_CTRL_PRSSEL_SHIFT) |
00121 (uint32_t)init->coreCtrl.scanConfSel |
00122 (uint32_t)init->coreCtrl.bufTrigLevel |
00123 (uint32_t)init->coreCtrl.wakeupOnDMA |
00124 ((uint32_t)init->coreCtrl.invACMP0 <<
00125 _LESENSE_CTRL_ACMP0INV_SHIFT) |
00126 ((uint32_t)init->coreCtrl.invACMP1 <<
00127 _LESENSE_CTRL_ACMP1INV_SHIFT) |
00128 ((uint32_t)init->coreCtrl.dualSample <<
00129 _LESENSE_CTRL_DUALSAMPLE_SHIFT) |
00130 ((uint32_t)init->coreCtrl.storeScanRes <<
00131 _LESENSE_CTRL_STRSCANRES_SHIFT) |
00132 ((uint32_t)init->coreCtrl.bufOverWr <<
00133 _LESENSE_CTRL_BUFOW_SHIFT) |
00134 ((uint32_t)init->coreCtrl.debugRun <<
00135 _LESENSE_CTRL_DEBUGRUN_SHIFT);
00136
00137
00138
00139 LESENSE_ScanModeSet((LESENSE_ScanMode_TypeDef)init->coreCtrl.scanStart, false);
00140
00141
00142
00143
00144
00145 LESENSE->PERCTRL = ((uint32_t)init->perCtrl.dacCh0Data <<
00146 _LESENSE_PERCTRL_DACCH0DATA_SHIFT) |
00147 ((uint32_t)init->perCtrl.dacCh0ConvMode <<
00148 _LESENSE_PERCTRL_DACCH0CONV_SHIFT) |
00149 ((uint32_t)init->perCtrl.dacCh0OutMode <<
00150 _LESENSE_PERCTRL_DACCH0OUT_SHIFT) |
00151 ((uint32_t)init->perCtrl.dacCh1Data <<
00152 _LESENSE_PERCTRL_DACCH1DATA_SHIFT) |
00153 ((uint32_t)init->perCtrl.dacCh1ConvMode <<
00154 _LESENSE_PERCTRL_DACCH1CONV_SHIFT) |
00155 ((uint32_t)init->perCtrl.dacCh1OutMode <<
00156 _LESENSE_PERCTRL_DACCH1OUT_SHIFT) |
00157 ((uint32_t)init->perCtrl.dacPresc <<
00158 _LESENSE_PERCTRL_DACPRESC_SHIFT) |
00159 (uint32_t)init->perCtrl.dacRef |
00160 ((uint32_t)init->perCtrl.acmp0Mode <<
00161 _LESENSE_PERCTRL_ACMP0MODE_SHIFT) |
00162 ((uint32_t)init->perCtrl.acmp1Mode <<
00163 _LESENSE_PERCTRL_ACMP1MODE_SHIFT) |
00164 (uint32_t)init->perCtrl.warmupMode;
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 LESENSE->DECCTRL = (uint32_t)init->decCtrl.decInput |
00175 ((uint32_t)init->decCtrl.prsChSel0 <<
00176 _LESENSE_DECCTRL_PRSSEL0_SHIFT) |
00177 ((uint32_t)init->decCtrl.prsChSel1 <<
00178 _LESENSE_DECCTRL_PRSSEL1_SHIFT) |
00179 ((uint32_t)init->decCtrl.prsChSel2 <<
00180 _LESENSE_DECCTRL_PRSSEL2_SHIFT) |
00181 ((uint32_t)init->decCtrl.prsChSel3 <<
00182 _LESENSE_DECCTRL_PRSSEL3_SHIFT) |
00183 ((uint32_t)init->decCtrl.chkState <<
00184 _LESENSE_DECCTRL_ERRCHK_SHIFT) |
00185 ((uint32_t)init->decCtrl.intMap <<
00186 _LESENSE_DECCTRL_INTMAP_SHIFT) |
00187 ((uint32_t)init->decCtrl.hystPRS0 <<
00188 _LESENSE_DECCTRL_HYSTPRS0_SHIFT) |
00189 ((uint32_t)init->decCtrl.hystPRS1 <<
00190 _LESENSE_DECCTRL_HYSTPRS1_SHIFT) |
00191 ((uint32_t)init->decCtrl.hystPRS2 <<
00192 _LESENSE_DECCTRL_HYSTPRS2_SHIFT) |
00193 ((uint32_t)init->decCtrl.hystIRQ <<
00194 _LESENSE_DECCTRL_HYSTIRQ_SHIFT) |
00195 ((uint32_t)init->decCtrl.prsCount <<
00196 _LESENSE_DECCTRL_PRSCNT_SHIFT);
00197
00198
00199 LESENSE_DecoderStateSet((uint32_t)init->decCtrl.initState);
00200
00201
00202 LESENSE->BIASCTRL = (uint32_t)init->coreCtrl.biasMode;
00203 }
00204
00205
00206
00232 uint32_t LESENSE_ScanFreqSet(uint32_t refFreq, uint32_t const scanFreq)
00233 {
00234 uint32_t tmp;
00235 uint32_t pcPresc = 0UL;
00236 uint32_t clkDiv = 1UL;
00237 uint32_t pcTop = 63UL;
00238 uint32_t calcScanFreq;
00239
00240
00241
00242
00243 if (!refFreq)
00244 {
00245 refFreq = CMU_ClockFreqGet(cmuClock_LESENSE);
00246 }
00247
00248
00249
00250
00251 EFM_ASSERT(refFreq < ((uint32_t)UINT32_MAX / 128UL));
00252
00253
00254 EFM_ASSERT((scanFreq > 0U) && (scanFreq <= refFreq));
00255
00256
00257
00258
00259 while ((refFreq / ((uint32_t)scanFreq * clkDiv) > (pcTop + 1UL)) &&
00260 (pcPresc < lesenseClkDiv_128))
00261 {
00262 ++pcPresc;
00263 clkDiv = (uint32_t)1UL << pcPresc;
00264 }
00265
00266
00267 pcTop = ((uint32_t)refFreq / ((uint32_t)scanFreq * clkDiv)) - 1UL;
00268
00269
00270
00271 tmp = LESENSE->TIMCTRL & (~(_LESENSE_TIMCTRL_PCPRESC_MASK)&
00272 ~(_LESENSE_TIMCTRL_PCTOP_MASK));
00273
00274
00275 tmp |= ((uint32_t)pcPresc << _LESENSE_TIMCTRL_PCPRESC_SHIFT) |
00276 ((uint32_t)pcTop << _LESENSE_TIMCTRL_PCTOP_SHIFT);
00277
00278
00279 LESENSE->TIMCTRL = tmp;
00280
00281
00282 calcScanFreq = ((uint32_t)refFreq / ((uint32_t)(1UL + pcTop) * clkDiv));
00283
00284 return calcScanFreq;
00285 }
00286
00287
00288
00314 void LESENSE_ScanModeSet(LESENSE_ScanMode_TypeDef const scanMode,
00315 bool const start)
00316 {
00317 uint32_t tmp;
00318
00319
00320
00321
00322 tmp = LESENSE->CTRL & ~(_LESENSE_CTRL_SCANMODE_MASK);
00323
00324
00325 tmp |= (uint32_t)scanMode;
00326
00327
00328 LESENSE->CTRL = tmp;
00329
00330
00331 if (start)
00332 {
00333 LESENSE_ScanStart();
00334 }
00335 }
00336
00337
00338
00356 void LESENSE_StartDelaySet(uint8_t const startDelay)
00357 {
00358 uint32_t tmp;
00359
00360
00361
00362 EFM_ASSERT(startDelay < 4U);
00363
00364
00365
00366 tmp = LESENSE->TIMCTRL & ~(_LESENSE_TIMCTRL_STARTDLY_MASK);
00367
00368 tmp |= (uint32_t)startDelay << _LESENSE_TIMCTRL_STARTDLY_SHIFT;
00369
00370
00371 LESENSE->TIMCTRL = tmp;
00372 }
00373
00374
00375
00399 void LESENSE_ClkDivSet(LESENSE_ChClk_TypeDef const clk,
00400 LESENSE_ClkPresc_TypeDef const clkDiv)
00401 {
00402 uint32_t tmp;
00403
00404
00405
00406 switch (clk)
00407 {
00408 case lesenseClkHF:
00409 {
00410
00411 EFM_ASSERT((uint32_t)clkDiv <= lesenseClkDiv_8);
00412
00413
00414 tmp = LESENSE->TIMCTRL & ~(_LESENSE_TIMCTRL_AUXPRESC_MASK);
00415
00416
00417 tmp |= ((uint32_t)clkDiv << _LESENSE_TIMCTRL_AUXPRESC_SHIFT);
00418
00419
00420 LESENSE->TIMCTRL = tmp;
00421 }
00422 break;
00423
00424 case lesenseClkLF:
00425 {
00426
00427 tmp = LESENSE->TIMCTRL & ~(_LESENSE_TIMCTRL_LFPRESC_MASK);
00428
00429
00430 tmp |= ((uint32_t)clkDiv << _LESENSE_TIMCTRL_LFPRESC_SHIFT);
00431
00432
00433 LESENSE->TIMCTRL = tmp;
00434 }
00435 break;
00436
00437 default:
00438 {
00439 EFM_ASSERT(0);
00440 }
00441 break;
00442 }
00443 }
00444
00445
00446
00467 void LESENSE_ChannelAllConfig(LESENSE_ChAll_TypeDef const *confChAll)
00468 {
00469 uint32_t i;
00470
00471
00472
00473 for (i = 0U; i < 16U; ++i)
00474 {
00475
00476 LESENSE_ChannelConfig(&confChAll->Ch[i], i);
00477 }
00478 }
00479
00480
00481
00503 void LESENSE_ChannelConfig(LESENSE_ChDesc_TypeDef const *confCh,
00504 uint32_t const chIdx)
00505 {
00506 uint32_t tmp;
00507
00508
00509
00510 EFM_ASSERT(chIdx < 16U);
00511 EFM_ASSERT(confCh->exTime < 64U);
00512 EFM_ASSERT(confCh->sampleDelay < 128U);
00513 EFM_ASSERT(confCh->measDelay < 128U);
00514
00515
00516
00517 EFM_ASSERT(confCh->acmpThres < 4096U);
00518 EFM_ASSERT(!(confCh->chPinExMode == lesenseChPinExDACOut &&
00519 (chIdx != 2U) && (chIdx != 3U) && (chIdx != 4U) && (chIdx != 5U)));
00520 EFM_ASSERT(!(confCh->chPinIdleMode == lesenseChPinIdleDACCh1 &&
00521 ((chIdx != 12U) && (chIdx != 13U) && (chIdx != 14U) && (chIdx != 15U))));
00522 EFM_ASSERT(!(confCh->chPinIdleMode == lesenseChPinIdleDACCh0 &&
00523 ((chIdx != 0U) && (chIdx != 1U) && (chIdx != 2U) && (chIdx != 3U))));
00524
00525
00526
00527
00528
00529 tmp = (LESENSE->IDLECONF & ~((uint32_t)0x3UL << (chIdx * 2UL)));
00530 tmp |= ((uint32_t)confCh->chPinIdleMode << (chIdx * 2UL));
00531 LESENSE->IDLECONF = tmp;
00532
00533
00534
00535 LESENSE_ChannelTimingSet(chIdx,
00536 (uint32_t)confCh->exTime,
00537 (uint32_t)confCh->sampleDelay,
00538 (uint32_t)confCh->measDelay);
00539
00540
00541
00542
00543 LESENSE->CH[chIdx].INTERACT = ((uint32_t)confCh->exClk <<
00544 _LESENSE_CH_INTERACT_EXCLK_SHIFT) |
00545 ((uint32_t)confCh->sampleClk <<
00546 _LESENSE_CH_INTERACT_SAMPLECLK_SHIFT) |
00547 (uint32_t)confCh->sampleMode |
00548 (uint32_t)confCh->intMode |
00549 (uint32_t)confCh->chPinExMode |
00550 ((uint32_t)confCh->useAltEx <<
00551 _LESENSE_CH_INTERACT_ALTEX_SHIFT);
00552
00553
00554
00555
00556 LESENSE->CH[chIdx].EVAL = (uint32_t)confCh->compMode |
00557 ((uint32_t)confCh->shiftRes <<
00558 _LESENSE_CH_EVAL_DECODE_SHIFT) |
00559 ((uint32_t)confCh->storeCntRes <<
00560 _LESENSE_CH_EVAL_STRSAMPLE_SHIFT) |
00561 ((uint32_t)confCh->invRes <<
00562 _LESENSE_CH_EVAL_SCANRESINV_SHIFT);
00563
00564
00565
00566 LESENSE_ChannelThresSet(chIdx,
00567 (uint32_t)confCh->acmpThres,
00568 (uint32_t)confCh->cntThres);
00569
00570
00571
00572
00573
00574 BITBAND_Peripheral(&(LESENSE->IEN),
00575 (uint32_t)chIdx,
00576 (uint32_t)confCh->enaInt);
00577
00578
00579 BITBAND_Peripheral(&(LESENSE->ROUTE),
00580 (uint32_t)chIdx,
00581 (uint32_t)confCh->enaPin);
00582
00583
00584 BITBAND_Peripheral(&(LESENSE->CHEN),
00585 (uint32_t)chIdx,
00586 (uint32_t)confCh->enaScanCh);
00587 }
00588
00589
00590
00607 void LESENSE_AltExConfig(LESENSE_ConfAltEx_TypeDef const *confAltEx)
00608 {
00609 uint32_t i;
00610 uint32_t tmp;
00611
00612
00613
00614
00615
00616 BITBAND_Peripheral(&(LESENSE->CTRL),
00617 _LESENSE_CTRL_ALTEXMAP_SHIFT,
00618 (uint32_t)confAltEx->altExMap);
00619
00620 switch (confAltEx->altExMap)
00621 {
00622 case lesenseAltExMapALTEX:
00623
00624 for (i = 0U; i < 8U; ++i)
00625 {
00626
00627
00628
00629 BITBAND_Peripheral(&(LESENSE->ROUTE),
00630 (16UL + i),
00631 (uint32_t)confAltEx->AltEx[i].enablePin);
00632
00633
00634
00635
00636 tmp = (LESENSE->ALTEXCONF & ~((uint32_t)0x3UL << (i * 2UL)));
00637 tmp |= ((uint32_t)confAltEx->AltEx[i].idleConf << (i * 2UL));
00638 LESENSE->ALTEXCONF = tmp;
00639
00640
00641 BITBAND_Peripheral(&(LESENSE->ALTEXCONF),
00642 (16UL + i),
00643 (uint32_t)confAltEx->AltEx[i].alwaysEx);
00644 }
00645 break;
00646
00647 case lesenseAltExMapACMP:
00648
00649 for (i = 0U; i < 16U; ++i)
00650 {
00651
00652
00653
00654 BITBAND_Peripheral(&(LESENSE->ROUTE),
00655 i,
00656 (uint32_t)confAltEx->AltEx[i].enablePin);
00657 }
00658 break;
00659 default:
00660
00661 EFM_ASSERT(0);
00662 }
00663 }
00664
00665
00666
00690 void LESENSE_ChannelEnable(uint8_t const chIdx,
00691 bool const enaScanCh,
00692 bool const enaPin)
00693 {
00694
00695
00696
00697
00698 BITBAND_Peripheral(&(LESENSE->ROUTE),
00699 (uint32_t)chIdx,
00700 (uint32_t)enaPin);
00701
00702
00703 BITBAND_Peripheral(&(LESENSE->CHEN),
00704 (uint32_t)chIdx,
00705 (uint32_t)enaScanCh);
00706 }
00707
00708
00709
00731 void LESENSE_ChannelEnableMask(uint16_t chMask, uint16_t pinMask)
00732 {
00733
00734 LESENSE->CHEN = chMask;
00735
00736 LESENSE->ROUTE = pinMask;
00737 }
00738
00739
00740
00768 void LESENSE_ChannelTimingSet(uint8_t const chIdx,
00769 uint8_t const exTime,
00770 uint8_t const sampleDelay,
00771 uint8_t const measDelay)
00772 {
00773
00774 EFM_ASSERT(exTime < 64U);
00775 EFM_ASSERT(sampleDelay < 128U);
00776 EFM_ASSERT(measDelay < 128U);
00777
00778
00779
00780 LESENSE->CH[chIdx].TIMING = ((uint32_t)exTime <<
00781 _LESENSE_CH_TIMING_EXTIME_SHIFT) |
00782 ((uint32_t)sampleDelay <<
00783 _LESENSE_CH_TIMING_SAMPLEDLY_SHIFT) |
00784 ((uint32_t)measDelay <<
00785 _LESENSE_CH_TIMING_MEASUREDLY_SHIFT);
00786 }
00787
00788
00789
00822 void LESENSE_ChannelThresSet(uint8_t const chIdx,
00823 uint16_t const acmpThres,
00824 uint16_t const cntThres)
00825 {
00826 uint32_t tmp;
00827
00828
00829
00830 EFM_ASSERT(acmpThres < 4096U);
00831
00832 EFM_ASSERT(chIdx < 16);
00833
00834
00835
00836 tmp = LESENSE->CH[chIdx].INTERACT & ~(_LESENSE_CH_INTERACT_ACMPTHRES_MASK);
00837
00838 tmp |= (uint32_t)acmpThres << _LESENSE_CH_INTERACT_ACMPTHRES_SHIFT;
00839
00840 LESENSE->CH[chIdx].INTERACT = tmp;
00841
00842
00843
00844 tmp = LESENSE->CH[chIdx].EVAL & ~(_LESENSE_CH_EVAL_COMPTHRES_MASK);
00845
00846 tmp |= (uint32_t)cntThres << _LESENSE_CH_EVAL_COMPTHRES_SHIFT;
00847
00848 LESENSE->CH[chIdx].EVAL = tmp;
00849 }
00850
00851
00852
00868 void LESENSE_DecoderStateAllConfig(LESENSE_DecStAll_TypeDef const *confDecStAll)
00869 {
00870 uint32_t i;
00871
00872
00873
00874 for (i = 0U; i < 16U; ++i)
00875 {
00876
00877 LESENSE_DecoderStateConfig(&confDecStAll->St[i], i);
00878 }
00879 }
00880
00881
00882
00897 void LESENSE_DecoderStateConfig(LESENSE_DecStDesc_TypeDef const *confDecSt,
00898 uint32_t const decSt)
00899 {
00900
00901 EFM_ASSERT(decSt < 16U);
00902 EFM_ASSERT((uint32_t)confDecSt->confA.compMask < 16U);
00903 EFM_ASSERT((uint32_t)confDecSt->confA.compVal < 16U);
00904 EFM_ASSERT((uint32_t)confDecSt->confA.nextState < 16U);
00905 EFM_ASSERT((uint32_t)confDecSt->confB.compMask < 16U);
00906 EFM_ASSERT((uint32_t)confDecSt->confB.compVal < 16U);
00907 EFM_ASSERT((uint32_t)confDecSt->confB.nextState < 16U);
00908
00909
00910
00911
00912
00913 LESENSE->ST[decSt].TCONFA = (uint32_t)confDecSt->confA.prsAct |
00914 ((uint32_t)confDecSt->confA.compMask <<
00915 _LESENSE_ST_TCONFA_MASK_SHIFT) |
00916 ((uint32_t)confDecSt->confA.compVal <<
00917 _LESENSE_ST_TCONFA_COMP_SHIFT) |
00918 ((uint32_t)confDecSt->confA.nextState <<
00919 _LESENSE_ST_TCONFA_NEXTSTATE_SHIFT) |
00920 ((uint32_t)confDecSt->confA.setInt <<
00921 _LESENSE_ST_TCONFA_SETIF_SHIFT) |
00922 ((uint32_t)confDecSt->chainDesc <<
00923 _LESENSE_ST_TCONFA_CHAIN_SHIFT);
00924
00925
00926
00927
00928 LESENSE->ST[decSt].TCONFB = (uint32_t)confDecSt->confB.prsAct |
00929 ((uint32_t)confDecSt->confB.compMask <<
00930 _LESENSE_ST_TCONFB_MASK_SHIFT) |
00931 ((uint32_t)confDecSt->confB.compVal <<
00932 _LESENSE_ST_TCONFB_COMP_SHIFT) |
00933 ((uint32_t)confDecSt->confB.nextState <<
00934 _LESENSE_ST_TCONFB_NEXTSTATE_SHIFT) |
00935 ((uint32_t)confDecSt->confB.setInt <<
00936 _LESENSE_ST_TCONFB_SETIF_SHIFT);
00937 }
00938
00939
00940
00955 void LESENSE_DecoderStateSet(uint32_t decSt)
00956 {
00957 EFM_ASSERT(decSt < 16U);
00958
00959 LESENSE->DECSTATE = decSt & _LESENSE_DECSTATE_DECSTATE_MASK;
00960 }
00961
00962
00963
00971 uint32_t LESENSE_DecoderStateGet(void)
00972 {
00973 return LESENSE->DECSTATE & _LESENSE_DECSTATE_DECSTATE_MASK;
00974 }
00975
00976
00977
00990 void LESENSE_ScanStart(void)
00991 {
00992
00993
00994 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
00995
00996
00997 LESENSE->CMD = LESENSE_CMD_START;
00998
00999
01000
01001 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01002 }
01003
01004
01005
01021 void LESENSE_ScanStop(void)
01022 {
01023
01024
01025 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01026
01027
01028 LESENSE->CMD = LESENSE_CMD_STOP;
01029
01030
01031
01032 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01033 }
01034
01035
01036
01049 void LESENSE_DecoderStart(void)
01050 {
01051
01052
01053 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01054
01055
01056 LESENSE->CMD = LESENSE_CMD_DECODE;
01057
01058
01059
01060 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01061 }
01062
01063
01064
01077 void LESENSE_ResultBufferClear(void)
01078 {
01079
01080
01081 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01082
01083 LESENSE->CMD = LESENSE_CMD_CLEARBUF;
01084
01085
01086
01087 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01088 }
01089
01090
01091
01104 void LESENSE_Reset(void)
01105 {
01106 uint32_t i;
01107
01108
01109
01110 LESENSE->IEN = _LESENSE_IEN_RESETVALUE;
01111
01112
01113 LESENSE->IFC = _LESENSE_IFC_MASK;
01114
01115
01116 LESENSE->DECCTRL |= LESENSE_DECCTRL_DISABLE;
01117
01118
01119
01120 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01121
01122 LESENSE->CMD = (LESENSE_CMD_STOP | LESENSE_CMD_CLEARBUF);
01123
01124
01125 LESENSE->CTRL = _LESENSE_CTRL_RESETVALUE;
01126 LESENSE->PERCTRL = _LESENSE_PERCTRL_RESETVALUE;
01127 LESENSE->DECCTRL = _LESENSE_DECCTRL_RESETVALUE;
01128 LESENSE->BIASCTRL = _LESENSE_BIASCTRL_RESETVALUE;
01129 LESENSE->CHEN = _LESENSE_CHEN_RESETVALUE;
01130 LESENSE->IDLECONF = _LESENSE_IDLECONF_RESETVALUE;
01131 LESENSE->ALTEXCONF = _LESENSE_ALTEXCONF_RESETVALUE;
01132
01133
01134 LESENSE->ROUTE = _LESENSE_ROUTE_RESETVALUE;
01135
01136
01137 for (i = 0U; i < 16U; ++i)
01138 {
01139 LESENSE->CH[i].TIMING = _LESENSE_CH_TIMING_RESETVALUE;
01140 LESENSE->CH[i].INTERACT = _LESENSE_CH_INTERACT_RESETVALUE;
01141 LESENSE->CH[i].EVAL = _LESENSE_CH_EVAL_RESETVALUE;
01142 }
01143
01144
01145 for (i = 0U; i < 16U; ++i)
01146 {
01147 LESENSE->ST[i].TCONFA = _LESENSE_ST_TCONFA_RESETVALUE;
01148 LESENSE->ST[i].TCONFB = _LESENSE_ST_TCONFB_RESETVALUE;
01149 }
01150
01151
01152 while (LESENSE_SYNCBUSY_CMD & LESENSE->SYNCBUSY);
01153 }
01154
01155
01159 #endif