DART-SD410 Android Examples: Difference between revisions

From Variscite Wiki
Line 37: Line 37:
# dd if=/dev/block/mmcblk0 of=/dev/null bs=128 count=1000000
# dd if=/dev/block/mmcblk0 of=/dev/null bs=128 count=1000000
</pre>
</pre>
= Using GPIO =

Revision as of 09:36, 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

Using GPIO