Skip to content

Instantly share code, notes, and snippets.

@sp5wwp
Created December 13, 2022 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sp5wwp/43e1753ec0aeaa7a829e735bb3899f28 to your computer and use it in GitHub Desktop.
Save sp5wwp/43e1753ec0aeaa7a829e735bb3899f28 to your computer and use it in GitHub Desktop.
WM8960 slave DAC init
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