Other Parts Discussed in Thread: CC2340R2
器件型号: CC2340R2
您好的团队、
我注意到、在新的 SDK (v9.11) 中、为低频时钟选择外部时钟源的功能发生了变化。 我们必须使用 SDK (v8.40) 复制此函数并在代码中将预期频率更改为 32.768kHz。
我想问的差异是:
1) 为什么现在首先完成多路复用器的设置?
2) LFK 良好中断的设置是新的
3) 启用 LFK 良好中断是新的
您能否详细介绍一下为什么进行这些更改、以及是否对较旧的 SDK (v8.40) 有任何影响?
//From new SDK(Simplink_lowpower_f3_SDK_9_11_00_18)
/*
* ======== PowerLPF3_selectEXTLF ========
*/
void PowerLPF3_selectEXTLF(void)
{
/* Configure EXTLF to the right mux */
GPIO_setConfigAndMux(PowerLPF3_extlfPin, GPIO_CFG_INPUT, PowerLPF3_extlfPinMux);
Log_printf(LogModule_Power, Log_INFO, "PowerLPF3_selectEXTLF: EXTLF pin muxing configured");
/* Set LFINC override to 31.25 kHz.
*
* The value is calculated as period in microseconds with 16 fractional
* bits.
* The EXTLF runs at 31.25 kHz -> 1 / 31250 Hz = 32 us.
* 32 * 2^16 = 2097152 = 0x00200000
*/
HWREG(CKMD_BASE + CKMD_O_LFINCOVR) = 0x00200000 | CKMD_LFINCOVR_OVERRIDE;
/* Directly switch to EXTLF, LFTICK will be generated by HFOSC until EXTLF
* is running.
*/
HWREG(CKMD_BASE + CKMD_O_LFCLKSEL) = CKMD_LFCLKSEL_MAIN_EXTLF;
/* Set EXTLF qualification function to be called by
* PowerCC23X0_oscillatorISR(). This function will return true when getting
* the LFCLKGOOD interrupt.
*/
PowerLPF3_lfclkQualFxn = PowerCC23X0_extlfQual;
/* Disallow standby until LF clock is running.
* The PowerCC23X0_oscillatorISR() function will release the constraint once
* PowerLPF3_lfclkQualFxn returns true.
*/
Power_setConstraint(PowerLPF3_DISALLOW_STANDBY);
/* Enable LFCLKGOOD interrupts */
HWREG(CKMD_BASE + CKMD_O_IMSET) = CKMD_IMASK_LFCLKGOOD;
}
//From Old SDK (Simplelink_lowpower_f3_sdk_8_40_00_61)
/*
* ======== PowerLPF3_selectEXTLF ========
*/
void PowerLPF3_selectEXTLF(void)
{
/* Set LFINC override to 31.25 kHz.
*
* The value is calculated as period in microseconds with 16 fractional
* bits.
* The EXTLF runs at 31.25 kHz -> 1 / 31250 Hz = 32 us.
* 32 * 2^16 = 2097152 = 0x00200000
*/
HWREG(CKMD_BASE + CKMD_O_LFINCOVR) = 0x00200000 | CKMD_LFINCOVR_OVERRIDE;
/* Set LFCLK to EXTLF */
HWREG(CKMD_BASE + CKMD_O_LFCLKSEL) = CKMD_LFCLKSEL_MAIN_EXTLF;
/* Configure EXTLF to the right mux */
GPIO_setConfigAndMux(PowerLPF3_extlfPin, GPIO_CFG_INPUT, PowerLPF3_extlfPinMux);
/* Enable LFCLKGOOD */
HWREG(CKMD_BASE + CKMD_O_IMSET) = CKMD_IMASK_LFCLKGOOD;
/* Disallow standby until LF clock is running. Otherwise, we will only
* vector to the ISR after we wake up from standby the next time since the
* CKM interrupt is purposefully not configured as a wakeup source.
*/
Power_setConstraint(PowerLPF3_DISALLOW_STANDBY);
Log_printf(LogModule_Power, Log_INFO, "PowerLPF3_selectEXTLF: EXTLF selected");
}
此致、
Luke