DART-SD410 Android Examples: Difference between revisions

From Variscite Wiki
(Created page with "{{PageHeader|DART-SD410 - Using Peripherals}} __toc__ This WIKI describes how to use some simple peripheral devices available on VAR-DT410CustomBoard. =Using User LED1= User ...")
 
Line 14: Line 14:
};
};
</pre>
</pre>
The user can access the LED device via serial console by:
You can access the LED device via serial console by:
<pre>
<pre>
$ su  
$ su  
# cd /sys/class/leds/led1
# cd /sys/class/leds/led1
# echo 1 > brightness
# echo 1 > brightness
The led will turn on
Writing any value other then 0 will turn the led on
# echo 0 > brightness
# echo 0 > brightness
The led will turn off
The led will turn off
</pre>
You can view available triggers by typing:
<pre>
# cat trigger
The output will be:
[none] boot-indication usb-online mmc0 mmc1 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid wlan-indication-led
</pre>
Set the trigger to mmc0 device by typing:
<pre>
# echo mmc0 > trigger
</pre>
Test it by reading mmc0 device:
<pre>
# dd if=/dev/block/mmcblk0 of=/dev/null bs=128 count=1000000
</pre>
</pre>

Revision as of 09:35, 19 January 2016

DART-SD410 - Using Peripherals

This WIKI describes how to use some simple peripheral devices available on VAR-DT410CustomBoard.

Using User LED1

User LED1 (D6) connected to GPIO21 of the CPU. The LED1 is defined in the apq8016-var-dt410.dtsi file under gpio-leds section.

general1 {
	gpios = <&msm_gpio 21 0>;
	label = "led1";
	linux,default-trigger = "none";
	default-state = "off";
	retain-state-suspended;
};

You can access the LED device via serial console by:

$ su 
# cd /sys/class/leds/led1
# echo 1 > brightness
Writing any value other then 0 will turn the led on
# echo 0 > brightness
The led will turn off

You can view available triggers by typing:

# cat trigger
The output will be:
[none] boot-indication usb-online mmc0 mmc1 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid wlan-indication-led

Set the trigger to mmc0 device by typing:

# echo mmc0 > trigger

Test it by reading mmc0 device:

# dd if=/dev/block/mmcblk0 of=/dev/null bs=128 count=1000000