大家好、
我正在使用 CC2640 (5x5 QFN)。 我想在 BLE SDK-2.2中从 DIO13读取模拟值。
有人可以帮助我如何阅读 BLE SDK v.2.2中的模拟值?
我可以在较早的 BLE SDK - 2.0版本中读取 ADC 值。
谢谢
Mahesh
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
谢谢 YiKai。
下面是测量模拟值的代码:
void AnalogMeasure (void)(空)
{
uint32_t currentSample = 0;
//为 ADC 数字和模拟接口启用时钟(当前未在驱动器中启用)
AUXVCClockEnable (AUX_WuC_MODCLKEN0_AUX_ADI4_M);
//将 AUX IO1 (DIO13)连接为模拟输入。
AUXADCselectInput (ADC_COMPB_IN_AUXIO1);
//设置 ADC
AUXADCEnableSync (AUXADC_REF_FIXED、AUXADC_SAMPLE_TIME_2P7_US、AUXADC_TRIGGER_MANUAL);
//使用 ADC 时禁止待机模式。
power_setConstraint (PowerCC26XX_SB_disallow);
//触发 ADC 采样
AUXADCGenManualTrigger ();
currentSample = AUXADCReadFifo();
//禁用 ADC
AUXADCDisable ();
//再次允许待机模式
power_releaseConstraint (PowerCC26XX_SB_disallow);
printf ("电压:%d\n"、currentSample);
}
在上面的代码中、我在执行 AUXADCGenManualTrigger ()时被突出显示;执行会停止(卡滞)。
谢谢