Notifications
Clear all
以 vo_gpio.c 为例子, 通过 GpioReadPin(0x00), GpioReadPin(0x01), GpioReadPin(0x02), GpioReadPin(0x03) 來控制 VS1005 音量
代码如下:
#include <vo_stdio.h> #include <audio.h> ioresult SetMasterVolumeVS1005G(u_int16 leftHalfDB, u_int16 rightHalfDB) { if (*((u_int32*)(0xfffe))!=0xf22ccf6b) { return S_ERROR; //We are not running in VS1005G } // write to playerVolume (VS1005 internal global) *((u_int16*)(1431)) = (leftHalfDB << 8) | (rightHalfDB & 0xff); SetVolume(); //Call a ROM function that sets the DAC volume from playerVolume return S_OK; } int main(void) { SetMasterVolumeVS1005G(50,50); //Set master volume to -25dB // To test that we have updated the master volume, we // now exec to MP3TEST.APP to hear music with the softer volume fclose(appFile); appFile = fopen("S:MP3TEST.APP","rb"); return S_OK; }
Posted : 24/02/2022 8:16 am
VS1005 GPIO 输出指令是 GpioSetPin, 例子
GpioSetPin(0x2f, 1);
Posted : 27/02/2022 1:20 am