does not work yet. Sound starts but then stops after a few seconds, whole thing hangs. Published so as I can import through mbed CLI.
Dependencies: mbed sinelookup SDFileSystem_Copy_of_mbed_version I2S
WOLFSON_config.h@8:40f37287589a, 2018-10-28 (annotated)
- Committer:
- roryhand
- Date:
- Sun Oct 28 22:01:16 2018 +0000
- Revision:
- 8:40f37287589a
- Parent:
- 7:fb47ff047ac7
- Child:
- 9:4d6b9a554550
latest revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
roryhand | 0:004cb0595aa8 | 1 | #ifndef WOLFSON_config |
roryhand | 0:004cb0595aa8 | 2 | #define WOLFSON_config |
roryhand | 0:004cb0595aa8 | 3 | // WM8731 Drivers - from MIKROE LIBSTOCK: https://libstock.mikroe.com/projects/view/304/wm8731-example |
roryhand | 0:004cb0595aa8 | 4 | /************************************************************************************************** |
roryhand | 0:004cb0595aa8 | 5 | * WM8731 sound chip register addresses |
roryhand | 0:004cb0595aa8 | 6 | **************************************************************************************************/ |
roryhand | 0:004cb0595aa8 | 7 | const int WM8731_ADDRESS = 0x34; // WM8731 chip address on I2C bus |
roryhand | 0:004cb0595aa8 | 8 | /************************************************************************************************** |
roryhand | 0:004cb0595aa8 | 9 | * WM8731 sound chip register addresses |
roryhand | 0:004cb0595aa8 | 10 | **************************************************************************************************/ |
roryhand | 0:004cb0595aa8 | 11 | const int WM8731_REG_LLINE_IN = 0x00; // Left Channel Line Input Volume Control |
roryhand | 0:004cb0595aa8 | 12 | const int WM8731_REG_RLINE_IN = 0x01; // Right Channel Line Input Volume Control |
roryhand | 0:004cb0595aa8 | 13 | const int WM8731_REG_LHPHONE_OUT = 0x02; // Left Channel Headphone Output Volume Control |
roryhand | 0:004cb0595aa8 | 14 | const int WM8731_REG_RHPHONE_OUT = 0x03; // Right Channel Headphone Output Volume Control |
roryhand | 0:004cb0595aa8 | 15 | const int WM8731_REG_ANALOG_PATH = 0x04; // Analog Audio Path Control |
roryhand | 0:004cb0595aa8 | 16 | const int WM8731_REG_DIGITAL_PATH = 0x05; // Digital Audio Path Control |
roryhand | 0:004cb0595aa8 | 17 | const int WM8731_REG_PDOWN_CTRL = 0x06; // Power Down Control Register |
roryhand | 0:004cb0595aa8 | 18 | const int WM8731_REG_DIGITAL_IF = 0x07; // Digital Audio Interface Format |
roryhand | 0:004cb0595aa8 | 19 | const int WM8731_REG_SAMPLING_CTRL = 0x08; // Sampling Control Register |
roryhand | 0:004cb0595aa8 | 20 | const int WM8731_REG_ACTIVE_CTRL = 0x09; // Active Control |
roryhand | 0:004cb0595aa8 | 21 | const int WM8731_REG_RESET = 0x0F; // Reset register |
roryhand | 0:004cb0595aa8 | 22 | |
roryhand | 0:004cb0595aa8 | 23 | /************************************************************************************************** |
roryhand | 0:004cb0595aa8 | 24 | * WM8731 sound chip constants (for default set up) |
roryhand | 0:004cb0595aa8 | 25 | **************************************************************************************************/ |
roryhand | 0:004cb0595aa8 | 26 | const int _WM8731_LEFT_LINEIN = 0X0180; // MIC SETTINGS: ENABLE MUTE, ENABLE SIMULTANEOUS LOAD TO LEFT AND RIGHT CHANNELS |
roryhand | 0:004cb0595aa8 | 27 | const int _WM8731_RIGHT_LINEIN = 0X0180; // MIC SETTINGS: ENABLE MUTE, ENABLE SIMULTANEOUS LOAD TO LEFT AND RIGHT CHANNELS |
roryhand | 0:004cb0595aa8 | 28 | const int _WM8731_LEFT_HP = 0X00F9; // HEADPHONE SETTINGS : 0DB |
roryhand | 0:004cb0595aa8 | 29 | const int _WM8731_RIGHT_HP = 0X00F9; // HEADPHONE SETTINGS : 0DB |
roryhand | 5:5b120a2d9249 | 30 | //const int _WM8731_LEFT_HP = 0X00E1; // HEADPHONE SETTINGS : -6?DB |
roryhand | 5:5b120a2d9249 | 31 | //const int _WM8731_RIGHT_HP = 0X00E1; // HEADPHONE SETTINGS : -6?DB |
roryhand | 0:004cb0595aa8 | 32 | const int _WM8731_ANALOGAUDIO = 0XD0; // DAC SELECT |
roryhand | 5:5b120a2d9249 | 33 | const int _WM8731_DIGITALAUDIO = 0X00; //11011 |
roryhand | 0:004cb0595aa8 | 34 | const int _WM8731_POWER = 0X00; // DISABLE POWER DOWN |
roryhand | 0:004cb0595aa8 | 35 | const int _WM8731_DAIF = 0X02; // ENABLE SLAVE MODE, 16BIT DATA AND I2S DATA |
roryhand | 8:40f37287589a | 36 | //const int _WM8731_SAMPLING = 0X00; // 48000HZ,12.288MHz oscillator. |
roryhand | 5:5b120a2d9249 | 37 | //const int _WM8731_SAMPLING = 0X2E; // 8000HZ,12.288MHz oscillator. |
roryhand | 8:40f37287589a | 38 | const int _WM8731_SAMPLING = 0X18; // 8000HZ,12.288MHz oscillator. |
roryhand | 0:004cb0595aa8 | 39 | const int _WM8731_ACTIVATE = 0X01; // MODULE IS ON |
roryhand | 0:004cb0595aa8 | 40 | const int _WM8731_DEACTIVATE = 0X00; // MODULE IS OFF |
roryhand | 0:004cb0595aa8 | 41 | const int _WM8731_RESET = 0X00; // RESET VALUE |
roryhand | 0:004cb0595aa8 | 42 | |
roryhand | 0:004cb0595aa8 | 43 | //do I need to delete these highlighted ones? (ie unused ones?) I think maybe theyre duplicates |
roryhand | 0:004cb0595aa8 | 44 | /**************************************************************************************************/ |
roryhand | 0:004cb0595aa8 | 45 | |
roryhand | 0:004cb0595aa8 | 46 | |
roryhand | 0:004cb0595aa8 | 47 | #endif |