完善PGA设置:ADC通道改为CH6、添加PB4(PGA2_OUT)模拟模式、配置CHSMPR2采样时间
This commit is contained in:
@@ -10,7 +10,7 @@ ret_code_t adc_init(void)
|
||||
|
||||
ADC1->CFGR1 = ADC_CFGR1_RES_1;
|
||||
|
||||
ADC1->CHSMPR2 = (0x7 << 0);
|
||||
ADC1->CHSMPR2 = (0x7 << 3);
|
||||
|
||||
ADC1->SMPR1 = 0x07;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "sys_data_bus.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define PGA_ADC_CH ADC_CH_0
|
||||
#define PGA_ADC_CH ADC_CH_6
|
||||
|
||||
#define PGA_GAIN_1 0x00
|
||||
#define PGA_GAIN_2 0x01
|
||||
|
||||
Reference in New Issue
Block a user