#include <stdio.h>
#include <stdint.h>
#include "driver.h"
#include "hal_interface_api.h"
#include <fcntl.h>

/*
adctool --get-all-channels
*/

void help()
{
	printf("spitool <cmd>\n");
	printf("    --.\n");
}

int main(int argc, char* argv[])
{
	int i;
	uint16_t buf;
	if(argc < 2)
	{
		help();
		return -1;
	}

	if((strcmp(argv[1], "--get-all-channels") == 0) && (argc == 2))
	{
		for(i=1;i<=7;i++)
		{
			buf = 0;
			stm32_adc_get_value(i, &buf);
			printf("ADC%d: %#04x\n", i, buf); 	
		}
		
	}
	else
	{
		help();
		return -1;
	}
}