Re: [PATCH] bccmd - add ability to read ADC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Simon,

On Mon, Jun 08, 2015, Simon Wood wrote:
> Some BlueCore devices are equipped with an 'Analogue In' pin which is
> internally connected to a MUX and ADC. This patch adds the ability to
> control the MUX and read the ADC.
> 
> The ADC is also connected internal to a temp sensor, which can also be
> read via this method.
> 
> The (only) MUX values expected to be used are:
> 1  Internal 1V25 reference
> 16 BlueCore01b pin Test_A; BlueCore2-External pin AIO0
> 17 BlueCore01b pin Test_B; BlueCore2-External pin AIO1
> 36 Chip’s internal temperature (change) sensor. BlueCore2-ROM and later only.
> 
> The MUX can also select other (undocumented) test points.
> 
> Example usage
> --
> $ ./bccmd -t HCI -d hci1 adc 17
> ADC value from Mux 0x11 : 0x0054 (valid)
> $ ./bccmd -t HCI -d hci1 adc 1
> ADC value from Mux 0x01 : 0x00b2 (valid)
> 
> Signed-off-by: Simon Wood <simon@xxxxxxxxxxxxx>

No Signed-off-by lines for user space patches please.

> +static int cmd_adc(int transport, int argc, char *argv[])
> +{
> +	uint8_t array[8];
> +	uint16_t mux, value;
> +	int err;
> +
> +	OPT_HELP(1, NULL);
> +
> +	if (!strncasecmp(argv[0], "0x", 2))
> +		mux = strtol(argv[0], NULL, 16);
> +	else
> +		mux = atoi(argv[0]);
> +
> +	// Request an ADC read from a particular mux'ed input

No C++ style comments please. Use /* ... */

> +	// sleep, then read result

Same here.

And the patch doesn't actually compile:

tools/bccmd.c:1068:2: error: implicit declaration of function ‘usleep’ [-Werror=implicit-function-declaration]
  usleep(50000);
  ^

Please add the necessary include for that (unistd.h, I believe).

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux