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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers WOLFSON_config.h Source File

WOLFSON_config.h

00001 #ifndef WOLFSON_config
00002 #define WOLFSON_config
00003 // WM8731 Drivers - from MIKROE LIBSTOCK: https://libstock.mikroe.com/projects/view/304/wm8731-example
00004 /**************************************************************************************************
00005 * WM8731 sound chip register addresses
00006 **************************************************************************************************/
00007 const int WM8731_ADDRESS = 0x34;       // WM8731 chip address on I2C bus
00008 /**************************************************************************************************
00009 * WM8731 sound chip register addresses
00010 **************************************************************************************************/
00011 const int WM8731_REG_LLINE_IN        = 0x00;       // Left Channel Line Input Volume Control
00012 const int WM8731_REG_RLINE_IN        = 0x01;       // Right Channel Line Input Volume Control
00013 const int WM8731_REG_LHPHONE_OUT     = 0x02;       // Left Channel Headphone Output Volume Control
00014 const int WM8731_REG_RHPHONE_OUT     = 0x03;       // Right Channel Headphone Output Volume Control
00015 const int WM8731_REG_ANALOG_PATH     = 0x04;       // Analog Audio Path Control
00016 const int WM8731_REG_DIGITAL_PATH    = 0x05;       // Digital Audio Path Control
00017 const int WM8731_REG_PDOWN_CTRL      = 0x06;       // Power Down Control Register
00018 const int WM8731_REG_DIGITAL_IF      = 0x07;       // Digital Audio Interface Format
00019 const int WM8731_REG_SAMPLING_CTRL   = 0x08;       // Sampling Control Register
00020 const int WM8731_REG_ACTIVE_CTRL     = 0x09;       // Active Control
00021 const int WM8731_REG_RESET           = 0x0F;       // Reset register
00022 
00023 /**************************************************************************************************
00024 * WM8731 sound chip constants (for default set up)
00025 **************************************************************************************************/
00026 const int _WM8731_LEFT_LINEIN        = 0X0180;     // MIC SETTINGS: ENABLE MUTE, ENABLE SIMULTANEOUS LOAD TO LEFT AND RIGHT CHANNELS
00027 const int _WM8731_RIGHT_LINEIN       = 0X0180;     // MIC SETTINGS: ENABLE MUTE, ENABLE SIMULTANEOUS LOAD TO LEFT AND RIGHT CHANNELS
00028 const int _WM8731_LEFT_HP            = 0X00F9;     // HEADPHONE SETTINGS : 0DB
00029 const int _WM8731_RIGHT_HP           = 0X00F9;     // HEADPHONE SETTINGS : 0DB
00030 //const int _WM8731_LEFT_HP            = 0X00E1;     // HEADPHONE SETTINGS : -6?DB
00031 //const int _WM8731_RIGHT_HP           = 0X00E1;     // HEADPHONE SETTINGS : -6?DB
00032 const int _WM8731_ANALOGAUDIO        = 0XD0;       // DAC SELECT
00033 const int _WM8731_DIGITALAUDIO       = 0X00;        //11011
00034 const int _WM8731_POWER              = 0X00;       // DISABLE POWER DOWN
00035 const int _WM8731_DAIF               = 0X02;       // ENABLE SLAVE MODE, 16BIT DATA AND I2S DATA
00036 //const int _WM8731_SAMPLING           = 0X00;       // 48000HZ,12.288MHz oscillator.
00037 //const int _WM8731_SAMPLING           = 0X2E;       // 8000HZ,12.288MHz oscillator.
00038 const int _WM8731_SAMPLING           = 0X18;       // 8000HZ,12.288MHz oscillator.
00039 const int _WM8731_ACTIVATE           = 0X01;       // MODULE IS ON
00040 const int _WM8731_DEACTIVATE         = 0X00;       // MODULE IS OFF
00041 const int _WM8731_RESET              = 0X00;       // RESET VALUE
00042 
00043 //do I need to delete these highlighted ones? (ie unused ones?) I think maybe theyre duplicates
00044 /**************************************************************************************************/
00045 
00046 
00047 #endif