GPIOs 2.0 - 2.2 playing USB audio

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
regh
Senior User
Posts: 25
Joined: Thu 2020-11-05 13:50

GPIOs 2.0 - 2.2 playing USB audio

Post by regh » Thu 2021-02-18 14:50

Hi

The VS1010 handbook says that some of the GPIOs in port 2 are used to indicate audio playback information when doing USB playback. Are we able to still use these GPIOs in our application (e.g. control LEDs) or is their function fixed if usb playback is occuring.

Thanks in advance for any help.

User avatar
Panu
VSDSP Expert
Posts: 2803
Joined: Tue 2010-06-22 13:43

Re: GPIOs 2.0 - 2.2 playing USB audio

Post by Panu » Thu 2021-02-18 16:12

Here's all the ROM code that writes to GPIO2 pins:

usbaudio3.c:

Code: Select all

__y void *DoSetInterfaceAudio(int k) {
	GpioSetPin(0x20,0);
	GpioSetPin(0x21,0);
	GpioSetPin(0x22,0);
	if (usp.d.setup.value != 0) { // Any USB audio interface setting except 'no audio'
		GpioSetPin(0x22,1);
	}
voaudio.c:

Code: Select all

case IOCTL_AUDIO_SET_ORATE: 
			if (runlevel==5) { //usb audio
				GpioSetPin(0x20, (bitsPerSample > 16) ? 1 : 0);
				GpioSetPin(0x21, (audioSampleRate >= 48000) ? 1 : 0);
			}
There's nothing except this that touches GPIO2 pins in the ROM. So you can use the pins as you like, but when a SET_INTERFACE usb packet is handled, the pins are written as per the code in usbaudio3.c and voaudio.c.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Post Reply