You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
641 B
15 lines
641 B
|
|
/*******************************************************************************
|
|
Function : adc_init
|
|
Brief : initial adc basic configuration
|
|
Input :
|
|
Return :
|
|
*******************************************************************************/
|
|
static void adc_init (int en, int clk_en, int clk_div, int sh_sel)
|
|
{
|
|
REG_CLKCTRL_PERI_CG->bf.adc_en = clk_en; // enable adc module clock
|
|
REG_ADC_CFG->bf.clk_div = clk_div; // default 4m
|
|
REG_ADC_CFG->bf.sh_sel = sh_sel; // 4 adc clk sample hold
|
|
REG_ADC_CFG->bf.en = en; // adc enable
|
|
REG_ADC_CFG->bf.start = en; // adc start
|
|
}
|
|
|