/******************************
***
**BatteryCtrl.c
**
************************************/



#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>


int main(void)
{
	int SysPower=0;
    	int adc_fd = 0;	
   	adc_fd = open("/dev/ebr_adc",O_RDONLY | O_NONBLOCK);
     	SysPower = ioctl(adc_fd,2,7);		//Get the battery level
     	printf("Battery Level :%d ,SysPower\n");
     	close(adc_fd);
     	sleep(5);
	return 0;
}