PlayFiles with button (GPIO) control

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

PlayFiles with button (GPIO) control

Post by Panu »

Dear Forum Memberes,

Here's an example of PlayFiles which reads GPIO pins (buttons S1 and S2 on the developer board) to switch to next or previous track.

Below is an example log of running it from the VSOS uart shell. It can also be started by editing config.txt
Hello.
VSOS 3.22 build May 19 2015 18:52:20
VLSI Solution Oy 2012-2015 - http://www.vlsi.fi

Starting the kernel.. Starting Devices... External SPI Flash
Installed system devices:
S: SPI Flash c814, handled by FAT.
Load drivers, config 0...
Driver: SDSD... D: SD card in SD mode

Driver: RUN... FC00,D Y:0xfc00: 0x2000-13 -> 0x0
Driver: RUN... FC00,C Y:0xfc00: 0x0-12 -> 0x0
Driver: UARTIN...
Driver: S:SHELL.AP3...
VSOS SHELL

S:>d:
D: SD/SD Card

D:>dir
- 1. 01SLOW~1.OGG 9621073 01 Slow Down.ogg
D 36. 1984_S~1 0 1984_See-Identity
- 3. ALITTL~1.MP3 956335 A Little Bit (sample).mp3
- 4. ANGELS~1.MP3 972217 Angels Crying (sample).mp3
- 21. AUDIOL~1.APP 10240 AudioLevel.APP
- 28. CONFIG.TXT 138 CONFIG.TXT
- 27. CONFIG~1.TXT 118 config.txt~
- 18. CONSOL~1.APP 10240 ConsoleFont.APP
- 6. HELLOW~1.APP 9728 HelloWorld.APP
- 26. HIRES1.DL3 11066 HIRES1.DL3
- 7. IWONTL~1.MP3 956418 I wont let the Sun go Down (sample).mp3
- 23. INIT.AP3 34508 INIT.AP3
- 8. INIT.APP 47616 INIT.APP
- 13. KERNEL~1.APP 53760 KernelUpdater.APP
- 22. MEMSIN~1.APP 14848 MemsInput1.APP
D 34. MUSIC 0 MUSIC
D 20. NEWFOL~1 0 New Folder
D 14. OLDAPP 0 OLDAPP
- 9. ORINOC~1.MP3 954746 Orinoco Flow (sample).mp3
- 35. PLAYLIST.M3U 56 PLAYLIST.M3U
- 24. RTCTEST.AP3 792 RtcTest.ap3
D 29. SYS 0 SYS
D 2. SYS2 0 SYS2
D 25. SYS3 0 SYS3
- 11. SYSTEM~1.APP 41472 SystemDiskUSB.APP
- 33. TEST.MP3 18522044 TEST.MP3
- 12. TEST2.AVI 80944220 TEST2.AVI
- 32. TEST_1~1.MP3 3361226 test_1khz.mp3
- 31. TEST_A~1.MP3 968121 test_aqua.mp3
- 19. VO3INIT.APP 48128 VO3INIT.APP
D 30. VS23VI~1 0 vs23 video
- 5. VSOS.INI 67 VSOS.INI
- 10. VSOS02~1.ZIP 4818052 vsos022_sdcard_root.zip
- 15. VSOS0240.IMG 31280 VSOS0240.IMG
- 17. VSOS02~1.IMG 31593 vsos0241 (LCD Emu).img
- 16. VSOS0241.IMG 32075 VSOS0241.IMG

D:>playfiles d:*.mp3
PlayFiles d:*.mp3
Open file 1...
Playing 'A Little Bit (sample).mp3' from device SD/SD Card...
~0503'A Little Bit (sample)
~0504'Changes
~0505'Pandora
Open file 2...
Playing 'Angels Crying (sample).mp3' from device SD/SD Card...
~0503'Angels Crying
~0504'Last Man Standing
~0506'1998
~0505'E-Type
Open file 3...
Playing 'I wont let the Sun go Down (sample).mp3' from device SD/SD Card...
~0503'I Won't let the sun go down
~0505'Robin Cook
~0504'Land of Sunshine
~0506'1996
Here's an example CONFIG.TXT. Configuration [1] starts the UART shell. Configuration [2] plays all mp3 files from the SD card.
# VSOS3 Boot Configuration File

[0]
# Start SD card as device D
SDSD D
# Clear UART RX interrupt enable
RUN YBITCLR FC00,D
# Clear UART TX interrupt enable
RUN YBITCLR FC00,C
# Start UART in/out driver
UARTIN
# Start the shell
S:SHELL.AP3

[2]
SDSD D
playfiles d:*.mp3
-Panu
Attachments
arch-ButtonControl-2015-06-09-18-47-PlayFiles.zip
PlayFiles example with GPIO control.
(33.61 KiB) Downloaded 328 times
Post Reply