Open main menu

DAVE Developer's Wiki β

Changes

Accessing hardware peripherals (SDVX)

1,226 bytes added, 07:10, 10 October 2018
Audio
root@sdv03-lite:~# aplay test_stereo_44100Hz_16bit_PCM.wav
Playing WAVE 'test_stereo_44100Hz_16bit_PCM.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
root@sdv03-lite:~#
</pre>
 
=== Bluetooth ===
BT device can be accessed using standard ''tty'' device driver.
 
==== AT commands ====
The device is controlled using '''AT commands''' via <code>/dev/ttymxc0</code> port
 
Serial port access example using AT commands:
 
<pre class="workstation-terminal">
root@test-noserialnumber:~# microcom -s 115200 /dev/ttymxc0
 
+STARTUP
AT
OK
AT
OK
ATZ
OK
ATO01
OK
</pre>
 
==== GPIOs ====
 
Two GPIOs control its main functionalities via <code>sysfs</code> entries mapped on ''leds'' interface:
 
* device reset
 
/sys/class/leds/bt_reset/brightness
 
Here below a script example for resetting the BT device:
 
<pre class="workstation-terminal">
root@sdv03-lite:~# cat bt.sh
echo Reset BT
echo 1 > /sys/class/leds/bt_reset/brightness
sleep 1
echo 0 > /sys/class/leds/bt_reset/brightness
root@sdv03-lite:~#
</pre>
 
* command mode
 
/sys/class/leds/bt_command_mode/brightness
 
Here below a script example for switch the BT device back to AT command mode (from <code>data</code> mode):
 
<pre class="workstation-terminal">
root@sdv03-lite:~# cat bt-command.sh
echo BT set command mode
echo 0 > /sys/class/leds/bt_command_mode/brightness
sleep 0.5
echo 1 > /sys/class/leds/bt_command_mode/brightness
root@sdv03-lite:~#
</pre>
8,220
edits