环境

  • Platform: Hi3516DV100
  • Kernel: v3.4

参考代码

主要通过操作寄存器

himm (LSADC_CTRL0,0xff5264ff); //配置0寄存器 0x200B0000
himm (LSADC_CTRL2,0x2f);  //0x200B0008
himm (LSADC_CTRL4,0x01);	//0x200B0010
while(enable)
{ 
	himm (LSADC_CTRL7,0x0f);   //0x200B001C
	data= readl(LSADC_CTRL3);   //0x200B000C
	data = (data >> 16);
	read_adc_data = data;
	himm (LSADC_CTRL6,0x1);      //0x200B0018
	msleep(100);
}