Created
December 13, 2022 14:55
-
-
Save sp5wwp/43e1753ec0aeaa7a829e735bb3899f28 to your computer and use it in GitHub Desktop.
WM8960 slave DAC init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delay_ms(250); | |
WM8960_Write(0x0F, 0x1FF); delay_ms(250); //reset | |
WM8960_Write(0x34, 0x018); //PLL prescale=2 | |
WM8960_Write(0x04, 0x3B1); //clocking | |
//WM8960_Write(0x07, (1<<1)); //16-bit, I2S format | |
WM8960_Write(0x07, (1<<0)); //16-bit, left justified MSB first format | |
WM8960_Write(0x19, (1<<7)|(1<<6)); //VMIDSEL=01, VREF=1 | |
WM8960_Write(0x0A, 0x1FF); //Volume Update + DAC volume | |
WM8960_Write(0x0B, 0x1FF); | |
WM8960_Write(0x05, 0x000); //DACMU=0 | |
WM8960_Write(0x2F, (1<<3)|(1<<2)); //MIX enable | |
WM8960_Write(0x22, (1<<8)); | |
WM8960_Write(0x25, (1<<8)); | |
WM8960_Write(0x02, 0x17A); //output volume - headphones | |
WM8960_Write(0x03, 0x17A); | |
WM8960_Write(0x28, 0x150); //output volume - SPKVOL | |
WM8960_Write(0x29, 0x150); | |
WM8960_Write(0x31, 0x0F7); //enable spk output amp | |
WM8960_Write(0x1A, 0x1F9); //enable almost everything |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment