Classes | Enumerator | Variables
Wm8960

Classes

struct  _wm8960_audio_format
 wm8960 audio format More...
 
struct  _wm8960_handle
 wm8960 codec handler More...
 
struct  wm8960_config
 Initialize structure of WM8960. More...
 

Variables

uint32_t _wm8960_audio_format::bitWidth
 
wm8960_protocol_t wm8960_config::bus
 
const wm8960_config_t_wm8960_handle::config
 
bool wm8960_config::enableSpeaker
 
wm8960_audio_format_t wm8960_config::format
 
codec_i2c_config_t wm8960_config::i2cConfig
 
uint8_t _wm8960_handle::i2cHandle [WM8960_I2C_HANDLER_SIZE]
 
wm8960_input_t wm8960_config::leftInputSource
 
bool wm8960_config::master_slave
 
uint32_t _wm8960_audio_format::mclk_HZ
 
wm8960_play_source_t wm8960_config::playSource
 
wm8960_input_t wm8960_config::rightInputSource
 
wm8960_route_t wm8960_config::route
 
uint32_t _wm8960_audio_format::sampleRate
 
uint8_t wm8960_config::slaveAddress
 

Driver version

enum  _wm8960_module {
  kWM8960_ModuleADC = 0, kWM8960_ModuleDAC = 1, kWM8960_ModuleVREF = 2, kWM8960_ModuleHP = 3,
  kWM8960_ModuleMICB = 4, kWM8960_ModuleMIC = 5, kWM8960_ModuleLineIn = 6, kWM8960_ModuleLineOut = 7,
  kWM8960_ModuleSpeaker = 8, kWM8960_ModuleOMIX = 9
}
 Modules in WM8960 board. More...
 
enum  _wm8960_play_channel { kWM8960_HeadphoneLeft = 1, kWM8960_HeadphoneRight = 2, kWM8960_SpeakerLeft = 4, kWM8960_SpeakerRight = 8 }
 wm8960 play channel More...
 
enum  _wm8960_play_source { kWM8960_PlaySourcePGA = 1, kWM8960_PlaySourceInput = 2, kWM8960_PlaySourceDAC = 4 }
 wm8960 play source More...
 
enum  _wm8960_route { kWM8960_RouteBypass = 0, kWM8960_RoutePlayback = 1, kWM8960_RoutePlaybackandRecord = 2, kWM8960_RouteRecord = 5 }
 WM8960 data route. Only provide some typical data route, not all route listed. Note: Users cannot combine any routes, once a new route is set, the previous one would be replaced. More...
 
enum  _wm8960_protocol {
  kWM8960_BusI2S = 2, kWM8960_BusLeftJustified = 1, kWM8960_BusRightJustified = 0, kWM8960_BusPCMA = 3,
  kWM8960_BusPCMB = 3 | (1 << 4)
}
 The audio data transfer protocol choice. WM8960 only supports I2S format and PCM format. More...
 
enum  _wm8960_input {
  kWM8960_InputClosed = 0, kWM8960_InputSingleEndedMic = 1, kWM8960_InputDifferentialMicInput2 = 2, kWM8960_InputDifferentialMicInput3 = 3,
  kWM8960_InputLineINPUT2 = 4, kWM8960_InputLineINPUT3 = 5
}
 wm8960 input source More...
 
enum  _wm8960_sample_rate {
  kWM8960_AudioSampleRate8KHz = 8000U, kWM8960_AudioSampleRate11025Hz = 11025U, kWM8960_AudioSampleRate12KHz = 12000U, kWM8960_AudioSampleRate16KHz = 16000U,
  kWM8960_AudioSampleRate22050Hz = 22050U, kWM8960_AudioSampleRate24KHz = 24000U, kWM8960_AudioSampleRate32KHz = 32000U, kWM8960_AudioSampleRate44100Hz = 44100U,
  kWM8960_AudioSampleRate48KHz = 48000U, kWM8960_AudioSampleRate96KHz = 96000U, kWM8960_AudioSampleRate192KHz = 192000U, kWM8960_AudioSampleRate384KHz = 384000U
}
 audio sample rate definition More...
 
enum  _wm8960_audio_bit_width { kWM8960_AudioBitWidth16bit = 16U, kWM8960_AudioBitWidth20bit = 20U, kWM8960_AudioBitWidth24bit = 24U, kWM8960_AudioBitWidth32bit = 32U }
 audio bit width More...
 
typedef enum _wm8960_module wm8960_module_t
 Modules in WM8960 board. More...
 
typedef enum _wm8960_play_source wm8960_play_source_t
 wm8960 play source More...
 
typedef enum _wm8960_route wm8960_route_t
 WM8960 data route. Only provide some typical data route, not all route listed. Note: Users cannot combine any routes, once a new route is set, the previous one would be replaced. More...
 
typedef enum _wm8960_protocol wm8960_protocol_t
 The audio data transfer protocol choice. WM8960 only supports I2S format and PCM format. More...
 
typedef enum _wm8960_input wm8960_input_t
 wm8960 input source More...
 
typedef struct _wm8960_audio_format wm8960_audio_format_t
 wm8960 audio format More...
 
typedef struct wm8960_config wm8960_config_t
 Initialize structure of WM8960. More...
 
typedef struct _wm8960_handle wm8960_handle_t
 wm8960 codec handler More...
 
status_t WM8960_Init (wm8960_handle_t *handle, const wm8960_config_t *wm8960Config)
 WM8960 initialize function. More...
 
status_t WM8960_Deinit (wm8960_handle_t *handle)
 Deinit the WM8960 codec. More...
 
status_t WM8960_SetDataRoute (wm8960_handle_t *handle, wm8960_route_t route)
 Set audio data route in WM8960. More...
 
status_t WM8960_SetLeftInput (wm8960_handle_t *handle, wm8960_input_t input)
 Set left audio input source in WM8960. More...
 
status_t WM8960_SetRightInput (wm8960_handle_t *handle, wm8960_input_t input)
 Set right audio input source in WM8960. More...
 
status_t WM8960_SetProtocol (wm8960_handle_t *handle, wm8960_protocol_t protocol)
 Set the audio transfer protocol. More...
 
void WM8960_SetMasterSlave (wm8960_handle_t *handle, bool master)
 Set WM8960 as master or slave. More...
 
status_t WM8960_SetVolume (wm8960_handle_t *handle, wm8960_module_t module, uint32_t volume)
 Set the volume of different modules in WM8960. More...
 
uint32_t WM8960_GetVolume (wm8960_handle_t *handle, wm8960_module_t module)
 Get the volume of different modules in WM8960. More...
 
status_t WM8960_SetMute (wm8960_handle_t *handle, wm8960_module_t module, bool isEnabled)
 Mute modules in WM8960. More...
 
status_t WM8960_SetModule (wm8960_handle_t *handle, wm8960_module_t module, bool isEnabled)
 Enable/disable expected devices. More...
 
status_t WM8960_SetPlay (wm8960_handle_t *handle, uint32_t playSource)
 SET the WM8960 play source. More...
 
status_t WM8960_ConfigDataFormat (wm8960_handle_t *handle, uint32_t sysclk, uint32_t sample_rate, uint32_t bits)
 Configure the data format of audio data. More...
 
status_t WM8960_SetJackDetect (wm8960_handle_t *handle, bool isEnabled)
 Enable/disable jack detect feature. More...
 
status_t WM8960_WriteReg (wm8960_handle_t *handle, uint8_t reg, uint16_t val)
 Write register to WM8960 using I2C. More...
 
status_t WM8960_ReadReg (uint8_t reg, uint16_t *val)
 Read register from WM8960 using I2C. More...
 
status_t WM8960_ModifyReg (wm8960_handle_t *handle, uint8_t reg, uint16_t mask, uint16_t val)
 Modify some bits in the register using I2C. More...
 
#define FSL_WM8960_DRIVER_VERSION   (MAKE_VERSION(2, 1, 1))
 CLOCK driver version 2.1.1. More...
 
#define WM8960_I2C_HANDLER_SIZE   CODEC_I2C_MASTER_HANDLER_SIZE
 wm8960 handle size More...
 
#define WM8960_LINVOL   0x0
 Define the register address of WM8960. More...
 
#define WM8960_RINVOL   0x1
 
#define WM8960_LOUT1   0x2
 
#define WM8960_ROUT1   0x3
 
#define WM8960_CLOCK1   0x4
 
#define WM8960_DACCTL1   0x5
 
#define WM8960_DACCTL2   0x6
 
#define WM8960_IFACE1   0x7
 
#define WM8960_CLOCK2   0x8
 
#define WM8960_IFACE2   0x9
 
#define WM8960_LDAC   0xa
 
#define WM8960_RDAC   0xb
 
#define WM8960_RESET   0xf
 
#define WM8960_3D   0x10
 
#define WM8960_ALC1   0x11
 
#define WM8960_ALC2   0x12
 
#define WM8960_ALC3   0x13
 
#define WM8960_NOISEG   0x14
 
#define WM8960_LADC   0x15
 
#define WM8960_RADC   0x16
 
#define WM8960_ADDCTL1   0x17
 
#define WM8960_ADDCTL2   0x18
 
#define WM8960_POWER1   0x19
 
#define WM8960_POWER2   0x1a
 
#define WM8960_ADDCTL3   0x1b
 
#define WM8960_APOP1   0x1c
 
#define WM8960_APOP2   0x1d
 
#define WM8960_LINPATH   0x20
 
#define WM8960_RINPATH   0x21
 
#define WM8960_LOUTMIX   0x22
 
#define WM8960_ROUTMIX   0x25
 
#define WM8960_MONOMIX1   0x26
 
#define WM8960_MONOMIX2   0x27
 
#define WM8960_LOUT2   0x28
 
#define WM8960_ROUT2   0x29
 
#define WM8960_MONO   0x2a
 
#define WM8960_INBMIX1   0x2b
 
#define WM8960_INBMIX2   0x2c
 
#define WM8960_BYPASS1   0x2d
 
#define WM8960_BYPASS2   0x2e
 
#define WM8960_POWER3   0x2f
 
#define WM8960_ADDCTL4   0x30
 
#define WM8960_CLASSD1   0x31
 
#define WM8960_CLASSD3   0x33
 
#define WM8960_PLL1   0x34
 
#define WM8960_PLL2   0x35
 
#define WM8960_PLL3   0x36
 
#define WM8960_PLL4   0x37
 
#define WM8960_CACHEREGNUM   56
 Cache register number. More...
 
#define WM8960_IFACE1_FORMAT_MASK   0x03
 WM8960_IFACE1 FORMAT bits. More...
 
#define WM8960_IFACE1_FORMAT_SHIFT   0x00
 
#define WM8960_IFACE1_FORMAT_RJ   0x00
 
#define WM8960_IFACE1_FORMAT_LJ   0x01
 
#define WM8960_IFACE1_FORMAT_I2S   0x02
 
#define WM8960_IFACE1_FORMAT_DSP   0x03
 
#define WM8960_IFACE1_FORMAT(x)   ((x << WM8960_IFACE1_FORMAT_SHIFT) & WM8960_IFACE1_FORMAT_MASK)
 
#define WM8960_IFACE1_WL_MASK   0x0C
 WM8960_IFACE1 WL bits. More...
 
#define WM8960_IFACE1_WL_SHIFT   0x02
 
#define WM8960_IFACE1_WL_16BITS   0x00
 
#define WM8960_IFACE1_WL_20BITS   0x01
 
#define WM8960_IFACE1_WL_24BITS   0x02
 
#define WM8960_IFACE1_WL_32BITS   0x03
 
#define WM8960_IFACE1_WL(x)   ((x << WM8960_IFACE1_WL_SHIFT) & WM8960_IFACE1_WL_MASK)
 
#define WM8960_IFACE1_LRP_MASK   0x10
 WM8960_IFACE1 LRP bit. More...
 
#define WM8960_IFACE1_LRP_SHIFT   0x04
 
#define WM8960_IFACE1_LRCLK_NORMAL_POL   0x00
 
#define WM8960_IFACE1_LRCLK_INVERT_POL   0x01
 
#define WM8960_IFACE1_DSP_MODEA   0x00
 
#define WM8960_IFACE1_DSP_MODEB   0x01
 
#define WM8960_IFACE1_LRP(x)   ((x << WM8960_IFACE1_LRP_SHIFT) & WM8960_IFACE1_LRP_MASK)
 
#define WM8960_IFACE1_DLRSWAP_MASK   0x20
 WM8960_IFACE1 DLRSWAP bit. More...
 
#define WM8960_IFACE1_DLRSWAP_SHIFT   0x05
 
#define WM8960_IFACE1_DACCH_NORMAL   0x00
 
#define WM8960_IFACE1_DACCH_SWAP   0x01
 
#define WM8960_IFACE1_DLRSWAP(x)   ((x << WM8960_IFACE1_DLRSWAP_SHIFT) & WM8960_IFACE1_DLRSWAP_MASK)
 
#define WM8960_IFACE1_MS_MASK   0x40
 WM8960_IFACE1 MS bit. More...
 
#define WM8960_IFACE1_MS_SHIFT   0x06
 
#define WM8960_IFACE1_SLAVE   0x00
 
#define WM8960_IFACE1_MASTER   0x01
 
#define WM8960_IFACE1_MS(x)   ((x << WM8960_IFACE1_MS_SHIFT) & WM8960_IFACE1_MS_MASK)
 
#define WM8960_IFACE1_BCLKINV_MASK   0x80
 WM8960_IFACE1 BCLKINV bit. More...
 
#define WM8960_IFACE1_BCLKINV_SHIFT   0x07
 
#define WM8960_IFACE1_BCLK_NONINVERT   0x00
 
#define WM8960_IFACE1_BCLK_INVERT   0x01
 
#define WM8960_IFACE1_BCLKINV(x)   ((x << WM8960_IFACE1_BCLKINV_SHIFT) & WM8960_IFACE1_BCLKINV_MASK)
 
#define WM8960_IFACE1_ALRSWAP_MASK   0x100
 WM8960_IFACE1 ALRSWAP bit. More...
 
#define WM8960_IFACE1_ALRSWAP_SHIFT   0x08
 
#define WM8960_IFACE1_ADCCH_NORMAL   0x00
 
#define WM8960_IFACE1_ADCCH_SWAP   0x01
 
#define WM8960_IFACE1_ALRSWAP(x)   ((x << WM8960_IFACE1_ALRSWAP_SHIFT) & WM8960_IFACE1_ALRSWAP_MASK)
 
#define WM8960_POWER1_VREF_MASK   0x40
 WM8960_POWER1. More...
 
#define WM8960_POWER1_VREF_SHIFT   0x06
 
#define WM8960_POWER1_AINL_MASK   0x20
 
#define WM8960_POWER1_AINL_SHIFT   0x05
 
#define WM8960_POWER1_AINR_MASK   0x10
 
#define WM8960_POWER1_AINR_SHIFT   0x04
 
#define WM8960_POWER1_ADCL_MASK   0x08
 
#define WM8960_POWER1_ADCL_SHIFT   0x03
 
#define WM8960_POWER1_ADCR_MASK   0x0
 
#define WM8960_POWER1_ADCR_SHIFT   0x02
 
#define WM8960_POWER1_MICB_MASK   0x02
 
#define WM8960_POWER1_MICB_SHIFT   0x01
 
#define WM8960_POWER1_DIGENB_MASK   0x01
 
#define WM8960_POWER1_DIGENB_SHIFT   0x00
 
#define WM8960_POWER2_DACL_MASK   0x100
 WM8960_POWER2. More...
 
#define WM8960_POWER2_DACL_SHIFT   0x08
 
#define WM8960_POWER2_DACR_MASK   0x80
 
#define WM8960_POWER2_DACR_SHIFT   0x07
 
#define WM8960_POWER2_LOUT1_MASK   0x40
 
#define WM8960_POWER2_LOUT1_SHIFT   0x06
 
#define WM8960_POWER2_ROUT1_MASK   0x20
 
#define WM8960_POWER2_ROUT1_SHIFT   0x05
 
#define WM8960_POWER2_SPKL_MASK   0x10
 
#define WM8960_POWER2_SPKL_SHIFT   0x04
 
#define WM8960_POWER2_SPKR_MASK   0x08
 
#define WM8960_POWER2_SPKR_SHIFT   0x03
 
#define WM8960_POWER3_LMIC_MASK   0x20
 
#define WM8960_POWER3_LMIC_SHIFT   0x05
 
#define WM8960_POWER3_RMIC_MASK   0x10
 
#define WM8960_POWER3_RMIC_SHIFT   0x04
 
#define WM8960_POWER3_LOMIX_MASK   0x08
 
#define WM8960_POWER3_LOMIX_SHIFT   0x03
 
#define WM8960_POWER3_ROMIX_MASK   0x04
 
#define WM8960_POWER3_ROMIX_SHIFT   0x02
 
#define WM8960_I2C_ADDR   0x1A
 WM8960 I2C address. More...
 
#define WM8960_I2C_BAUDRATE   (100000U)
 WM8960 I2C baudrate. More...
 

Detailed Description

Macro Definition Documentation

◆ FSL_WM8960_DRIVER_VERSION

#define FSL_WM8960_DRIVER_VERSION   (MAKE_VERSION(2, 1, 1))

CLOCK driver version 2.1.1.

Definition at line 26 of file fsl_wm8960.h.

◆ WM8960_3D

#define WM8960_3D   0x10

Definition at line 49 of file fsl_wm8960.h.

◆ WM8960_ADDCTL1

#define WM8960_ADDCTL1   0x17

Definition at line 56 of file fsl_wm8960.h.

◆ WM8960_ADDCTL2

#define WM8960_ADDCTL2   0x18

Definition at line 57 of file fsl_wm8960.h.

◆ WM8960_ADDCTL3

#define WM8960_ADDCTL3   0x1b

Definition at line 60 of file fsl_wm8960.h.

◆ WM8960_ADDCTL4

#define WM8960_ADDCTL4   0x30

Definition at line 79 of file fsl_wm8960.h.

◆ WM8960_ALC1

#define WM8960_ALC1   0x11

Definition at line 50 of file fsl_wm8960.h.

◆ WM8960_ALC2

#define WM8960_ALC2   0x12

Definition at line 51 of file fsl_wm8960.h.

◆ WM8960_ALC3

#define WM8960_ALC3   0x13

Definition at line 52 of file fsl_wm8960.h.

◆ WM8960_APOP1

#define WM8960_APOP1   0x1c

Definition at line 61 of file fsl_wm8960.h.

◆ WM8960_APOP2

#define WM8960_APOP2   0x1d

Definition at line 62 of file fsl_wm8960.h.

◆ WM8960_BYPASS1

#define WM8960_BYPASS1   0x2d

Definition at line 76 of file fsl_wm8960.h.

◆ WM8960_BYPASS2

#define WM8960_BYPASS2   0x2e

Definition at line 77 of file fsl_wm8960.h.

◆ WM8960_CACHEREGNUM

#define WM8960_CACHEREGNUM   56

Cache register number.

Definition at line 89 of file fsl_wm8960.h.

◆ WM8960_CLASSD1

#define WM8960_CLASSD1   0x31

Definition at line 80 of file fsl_wm8960.h.

◆ WM8960_CLASSD3

#define WM8960_CLASSD3   0x33

Definition at line 82 of file fsl_wm8960.h.

◆ WM8960_CLOCK1

#define WM8960_CLOCK1   0x4

Definition at line 39 of file fsl_wm8960.h.

◆ WM8960_CLOCK2

#define WM8960_CLOCK2   0x8

Definition at line 43 of file fsl_wm8960.h.

◆ WM8960_DACCTL1

#define WM8960_DACCTL1   0x5

Definition at line 40 of file fsl_wm8960.h.

◆ WM8960_DACCTL2

#define WM8960_DACCTL2   0x6

Definition at line 41 of file fsl_wm8960.h.

◆ WM8960_I2C_ADDR

#define WM8960_I2C_ADDR   0x1A

WM8960 I2C address.

Definition at line 196 of file fsl_wm8960.h.

◆ WM8960_I2C_BAUDRATE

#define WM8960_I2C_BAUDRATE   (100000U)

WM8960 I2C baudrate.

Definition at line 198 of file fsl_wm8960.h.

◆ WM8960_I2C_HANDLER_SIZE

#define WM8960_I2C_HANDLER_SIZE   CODEC_I2C_MASTER_HANDLER_SIZE

wm8960 handle size

Definition at line 31 of file fsl_wm8960.h.

◆ WM8960_IFACE1

#define WM8960_IFACE1   0x7

Definition at line 42 of file fsl_wm8960.h.

◆ WM8960_IFACE1_ADCCH_NORMAL

#define WM8960_IFACE1_ADCCH_NORMAL   0x00

Definition at line 142 of file fsl_wm8960.h.

◆ WM8960_IFACE1_ADCCH_SWAP

#define WM8960_IFACE1_ADCCH_SWAP   0x01

Definition at line 143 of file fsl_wm8960.h.

◆ WM8960_IFACE1_ALRSWAP

#define WM8960_IFACE1_ALRSWAP (   x)    ((x << WM8960_IFACE1_ALRSWAP_SHIFT) & WM8960_IFACE1_ALRSWAP_MASK)

Definition at line 144 of file fsl_wm8960.h.

◆ WM8960_IFACE1_ALRSWAP_MASK

#define WM8960_IFACE1_ALRSWAP_MASK   0x100

WM8960_IFACE1 ALRSWAP bit.

Definition at line 140 of file fsl_wm8960.h.

◆ WM8960_IFACE1_ALRSWAP_SHIFT

#define WM8960_IFACE1_ALRSWAP_SHIFT   0x08

Definition at line 141 of file fsl_wm8960.h.

◆ WM8960_IFACE1_BCLK_INVERT

#define WM8960_IFACE1_BCLK_INVERT   0x01

Definition at line 136 of file fsl_wm8960.h.

◆ WM8960_IFACE1_BCLK_NONINVERT

#define WM8960_IFACE1_BCLK_NONINVERT   0x00

Definition at line 135 of file fsl_wm8960.h.

◆ WM8960_IFACE1_BCLKINV

#define WM8960_IFACE1_BCLKINV (   x)    ((x << WM8960_IFACE1_BCLKINV_SHIFT) & WM8960_IFACE1_BCLKINV_MASK)

Definition at line 137 of file fsl_wm8960.h.

◆ WM8960_IFACE1_BCLKINV_MASK

#define WM8960_IFACE1_BCLKINV_MASK   0x80

WM8960_IFACE1 BCLKINV bit.

Definition at line 133 of file fsl_wm8960.h.

◆ WM8960_IFACE1_BCLKINV_SHIFT

#define WM8960_IFACE1_BCLKINV_SHIFT   0x07

Definition at line 134 of file fsl_wm8960.h.

◆ WM8960_IFACE1_DACCH_NORMAL

#define WM8960_IFACE1_DACCH_NORMAL   0x00

Definition at line 121 of file fsl_wm8960.h.

◆ WM8960_IFACE1_DACCH_SWAP

#define WM8960_IFACE1_DACCH_SWAP   0x01

Definition at line 122 of file fsl_wm8960.h.

◆ WM8960_IFACE1_DLRSWAP

#define WM8960_IFACE1_DLRSWAP (   x)    ((x << WM8960_IFACE1_DLRSWAP_SHIFT) & WM8960_IFACE1_DLRSWAP_MASK)

Definition at line 123 of file fsl_wm8960.h.

◆ WM8960_IFACE1_DLRSWAP_MASK

#define WM8960_IFACE1_DLRSWAP_MASK   0x20

WM8960_IFACE1 DLRSWAP bit.

Definition at line 119 of file fsl_wm8960.h.

◆ WM8960_IFACE1_DLRSWAP_SHIFT

#define WM8960_IFACE1_DLRSWAP_SHIFT   0x05

Definition at line 120 of file fsl_wm8960.h.

◆ WM8960_IFACE1_DSP_MODEA

#define WM8960_IFACE1_DSP_MODEA   0x00

Definition at line 114 of file fsl_wm8960.h.

◆ WM8960_IFACE1_DSP_MODEB

#define WM8960_IFACE1_DSP_MODEB   0x01

Definition at line 115 of file fsl_wm8960.h.

◆ WM8960_IFACE1_FORMAT

#define WM8960_IFACE1_FORMAT (   x)    ((x << WM8960_IFACE1_FORMAT_SHIFT) & WM8960_IFACE1_FORMAT_MASK)

Definition at line 98 of file fsl_wm8960.h.

◆ WM8960_IFACE1_FORMAT_DSP

#define WM8960_IFACE1_FORMAT_DSP   0x03

Definition at line 97 of file fsl_wm8960.h.

◆ WM8960_IFACE1_FORMAT_I2S

#define WM8960_IFACE1_FORMAT_I2S   0x02

Definition at line 96 of file fsl_wm8960.h.

◆ WM8960_IFACE1_FORMAT_LJ

#define WM8960_IFACE1_FORMAT_LJ   0x01

Definition at line 95 of file fsl_wm8960.h.

◆ WM8960_IFACE1_FORMAT_MASK

#define WM8960_IFACE1_FORMAT_MASK   0x03

WM8960_IFACE1 FORMAT bits.

Definition at line 92 of file fsl_wm8960.h.

◆ WM8960_IFACE1_FORMAT_RJ

#define WM8960_IFACE1_FORMAT_RJ   0x00

Definition at line 94 of file fsl_wm8960.h.

◆ WM8960_IFACE1_FORMAT_SHIFT

#define WM8960_IFACE1_FORMAT_SHIFT   0x00

Definition at line 93 of file fsl_wm8960.h.

◆ WM8960_IFACE1_LRCLK_INVERT_POL

#define WM8960_IFACE1_LRCLK_INVERT_POL   0x01

Definition at line 113 of file fsl_wm8960.h.

◆ WM8960_IFACE1_LRCLK_NORMAL_POL

#define WM8960_IFACE1_LRCLK_NORMAL_POL   0x00

Definition at line 112 of file fsl_wm8960.h.

◆ WM8960_IFACE1_LRP

#define WM8960_IFACE1_LRP (   x)    ((x << WM8960_IFACE1_LRP_SHIFT) & WM8960_IFACE1_LRP_MASK)

Definition at line 116 of file fsl_wm8960.h.

◆ WM8960_IFACE1_LRP_MASK

#define WM8960_IFACE1_LRP_MASK   0x10

WM8960_IFACE1 LRP bit.

Definition at line 110 of file fsl_wm8960.h.

◆ WM8960_IFACE1_LRP_SHIFT

#define WM8960_IFACE1_LRP_SHIFT   0x04

Definition at line 111 of file fsl_wm8960.h.

◆ WM8960_IFACE1_MASTER

#define WM8960_IFACE1_MASTER   0x01

Definition at line 129 of file fsl_wm8960.h.

◆ WM8960_IFACE1_MS

#define WM8960_IFACE1_MS (   x)    ((x << WM8960_IFACE1_MS_SHIFT) & WM8960_IFACE1_MS_MASK)

Definition at line 130 of file fsl_wm8960.h.

◆ WM8960_IFACE1_MS_MASK

#define WM8960_IFACE1_MS_MASK   0x40

WM8960_IFACE1 MS bit.

Definition at line 126 of file fsl_wm8960.h.

◆ WM8960_IFACE1_MS_SHIFT

#define WM8960_IFACE1_MS_SHIFT   0x06

Definition at line 127 of file fsl_wm8960.h.

◆ WM8960_IFACE1_SLAVE

#define WM8960_IFACE1_SLAVE   0x00

Definition at line 128 of file fsl_wm8960.h.

◆ WM8960_IFACE1_WL

#define WM8960_IFACE1_WL (   x)    ((x << WM8960_IFACE1_WL_SHIFT) & WM8960_IFACE1_WL_MASK)

Definition at line 107 of file fsl_wm8960.h.

◆ WM8960_IFACE1_WL_16BITS

#define WM8960_IFACE1_WL_16BITS   0x00

Definition at line 103 of file fsl_wm8960.h.

◆ WM8960_IFACE1_WL_20BITS

#define WM8960_IFACE1_WL_20BITS   0x01

Definition at line 104 of file fsl_wm8960.h.

◆ WM8960_IFACE1_WL_24BITS

#define WM8960_IFACE1_WL_24BITS   0x02

Definition at line 105 of file fsl_wm8960.h.

◆ WM8960_IFACE1_WL_32BITS

#define WM8960_IFACE1_WL_32BITS   0x03

Definition at line 106 of file fsl_wm8960.h.

◆ WM8960_IFACE1_WL_MASK

#define WM8960_IFACE1_WL_MASK   0x0C

WM8960_IFACE1 WL bits.

Definition at line 101 of file fsl_wm8960.h.

◆ WM8960_IFACE1_WL_SHIFT

#define WM8960_IFACE1_WL_SHIFT   0x02

Definition at line 102 of file fsl_wm8960.h.

◆ WM8960_IFACE2

#define WM8960_IFACE2   0x9

Definition at line 44 of file fsl_wm8960.h.

◆ WM8960_INBMIX1

#define WM8960_INBMIX1   0x2b

Definition at line 74 of file fsl_wm8960.h.

◆ WM8960_INBMIX2

#define WM8960_INBMIX2   0x2c

Definition at line 75 of file fsl_wm8960.h.

◆ WM8960_LADC

#define WM8960_LADC   0x15

Definition at line 54 of file fsl_wm8960.h.

◆ WM8960_LDAC

#define WM8960_LDAC   0xa

Definition at line 45 of file fsl_wm8960.h.

◆ WM8960_LINPATH

#define WM8960_LINPATH   0x20

Definition at line 64 of file fsl_wm8960.h.

◆ WM8960_LINVOL

#define WM8960_LINVOL   0x0

Define the register address of WM8960.

Definition at line 35 of file fsl_wm8960.h.

◆ WM8960_LOUT1

#define WM8960_LOUT1   0x2

Definition at line 37 of file fsl_wm8960.h.

◆ WM8960_LOUT2

#define WM8960_LOUT2   0x28

Definition at line 71 of file fsl_wm8960.h.

◆ WM8960_LOUTMIX

#define WM8960_LOUTMIX   0x22

Definition at line 66 of file fsl_wm8960.h.

◆ WM8960_MONO

#define WM8960_MONO   0x2a

Definition at line 73 of file fsl_wm8960.h.

◆ WM8960_MONOMIX1

#define WM8960_MONOMIX1   0x26

Definition at line 69 of file fsl_wm8960.h.

◆ WM8960_MONOMIX2

#define WM8960_MONOMIX2   0x27

Definition at line 70 of file fsl_wm8960.h.

◆ WM8960_NOISEG

#define WM8960_NOISEG   0x14

Definition at line 53 of file fsl_wm8960.h.

◆ WM8960_PLL1

#define WM8960_PLL1   0x34

Definition at line 83 of file fsl_wm8960.h.

◆ WM8960_PLL2

#define WM8960_PLL2   0x35

Definition at line 84 of file fsl_wm8960.h.

◆ WM8960_PLL3

#define WM8960_PLL3   0x36

Definition at line 85 of file fsl_wm8960.h.

◆ WM8960_PLL4

#define WM8960_PLL4   0x37

Definition at line 86 of file fsl_wm8960.h.

◆ WM8960_POWER1

#define WM8960_POWER1   0x19

Definition at line 58 of file fsl_wm8960.h.

◆ WM8960_POWER1_ADCL_MASK

#define WM8960_POWER1_ADCL_MASK   0x08

Definition at line 156 of file fsl_wm8960.h.

◆ WM8960_POWER1_ADCL_SHIFT

#define WM8960_POWER1_ADCL_SHIFT   0x03

Definition at line 157 of file fsl_wm8960.h.

◆ WM8960_POWER1_ADCR_MASK

#define WM8960_POWER1_ADCR_MASK   0x0

Definition at line 159 of file fsl_wm8960.h.

◆ WM8960_POWER1_ADCR_SHIFT

#define WM8960_POWER1_ADCR_SHIFT   0x02

Definition at line 160 of file fsl_wm8960.h.

◆ WM8960_POWER1_AINL_MASK

#define WM8960_POWER1_AINL_MASK   0x20

Definition at line 150 of file fsl_wm8960.h.

◆ WM8960_POWER1_AINL_SHIFT

#define WM8960_POWER1_AINL_SHIFT   0x05

Definition at line 151 of file fsl_wm8960.h.

◆ WM8960_POWER1_AINR_MASK

#define WM8960_POWER1_AINR_MASK   0x10

Definition at line 153 of file fsl_wm8960.h.

◆ WM8960_POWER1_AINR_SHIFT

#define WM8960_POWER1_AINR_SHIFT   0x04

Definition at line 154 of file fsl_wm8960.h.

◆ WM8960_POWER1_DIGENB_MASK

#define WM8960_POWER1_DIGENB_MASK   0x01

Definition at line 165 of file fsl_wm8960.h.

◆ WM8960_POWER1_DIGENB_SHIFT

#define WM8960_POWER1_DIGENB_SHIFT   0x00

Definition at line 166 of file fsl_wm8960.h.

◆ WM8960_POWER1_MICB_MASK

#define WM8960_POWER1_MICB_MASK   0x02

Definition at line 162 of file fsl_wm8960.h.

◆ WM8960_POWER1_MICB_SHIFT

#define WM8960_POWER1_MICB_SHIFT   0x01

Definition at line 163 of file fsl_wm8960.h.

◆ WM8960_POWER1_VREF_MASK

#define WM8960_POWER1_VREF_MASK   0x40

WM8960_POWER1.

Definition at line 147 of file fsl_wm8960.h.

◆ WM8960_POWER1_VREF_SHIFT

#define WM8960_POWER1_VREF_SHIFT   0x06

Definition at line 148 of file fsl_wm8960.h.

◆ WM8960_POWER2

#define WM8960_POWER2   0x1a

Definition at line 59 of file fsl_wm8960.h.

◆ WM8960_POWER2_DACL_MASK

#define WM8960_POWER2_DACL_MASK   0x100

WM8960_POWER2.

Definition at line 169 of file fsl_wm8960.h.

◆ WM8960_POWER2_DACL_SHIFT

#define WM8960_POWER2_DACL_SHIFT   0x08

Definition at line 170 of file fsl_wm8960.h.

◆ WM8960_POWER2_DACR_MASK

#define WM8960_POWER2_DACR_MASK   0x80

Definition at line 172 of file fsl_wm8960.h.

◆ WM8960_POWER2_DACR_SHIFT

#define WM8960_POWER2_DACR_SHIFT   0x07

Definition at line 173 of file fsl_wm8960.h.

◆ WM8960_POWER2_LOUT1_MASK

#define WM8960_POWER2_LOUT1_MASK   0x40

Definition at line 175 of file fsl_wm8960.h.

◆ WM8960_POWER2_LOUT1_SHIFT

#define WM8960_POWER2_LOUT1_SHIFT   0x06

Definition at line 176 of file fsl_wm8960.h.

◆ WM8960_POWER2_ROUT1_MASK

#define WM8960_POWER2_ROUT1_MASK   0x20

Definition at line 178 of file fsl_wm8960.h.

◆ WM8960_POWER2_ROUT1_SHIFT

#define WM8960_POWER2_ROUT1_SHIFT   0x05

Definition at line 179 of file fsl_wm8960.h.

◆ WM8960_POWER2_SPKL_MASK

#define WM8960_POWER2_SPKL_MASK   0x10

Definition at line 181 of file fsl_wm8960.h.

◆ WM8960_POWER2_SPKL_SHIFT

#define WM8960_POWER2_SPKL_SHIFT   0x04

Definition at line 182 of file fsl_wm8960.h.

◆ WM8960_POWER2_SPKR_MASK

#define WM8960_POWER2_SPKR_MASK   0x08

Definition at line 184 of file fsl_wm8960.h.

◆ WM8960_POWER2_SPKR_SHIFT

#define WM8960_POWER2_SPKR_SHIFT   0x03

Definition at line 185 of file fsl_wm8960.h.

◆ WM8960_POWER3

#define WM8960_POWER3   0x2f

Definition at line 78 of file fsl_wm8960.h.

◆ WM8960_POWER3_LMIC_MASK

#define WM8960_POWER3_LMIC_MASK   0x20

Definition at line 187 of file fsl_wm8960.h.

◆ WM8960_POWER3_LMIC_SHIFT

#define WM8960_POWER3_LMIC_SHIFT   0x05

Definition at line 188 of file fsl_wm8960.h.

◆ WM8960_POWER3_LOMIX_MASK

#define WM8960_POWER3_LOMIX_MASK   0x08

Definition at line 191 of file fsl_wm8960.h.

◆ WM8960_POWER3_LOMIX_SHIFT

#define WM8960_POWER3_LOMIX_SHIFT   0x03

Definition at line 192 of file fsl_wm8960.h.

◆ WM8960_POWER3_RMIC_MASK

#define WM8960_POWER3_RMIC_MASK   0x10

Definition at line 189 of file fsl_wm8960.h.

◆ WM8960_POWER3_RMIC_SHIFT

#define WM8960_POWER3_RMIC_SHIFT   0x04

Definition at line 190 of file fsl_wm8960.h.

◆ WM8960_POWER3_ROMIX_MASK

#define WM8960_POWER3_ROMIX_MASK   0x04

Definition at line 193 of file fsl_wm8960.h.

◆ WM8960_POWER3_ROMIX_SHIFT

#define WM8960_POWER3_ROMIX_SHIFT   0x02

Definition at line 194 of file fsl_wm8960.h.

◆ WM8960_RADC

#define WM8960_RADC   0x16

Definition at line 55 of file fsl_wm8960.h.

◆ WM8960_RDAC

#define WM8960_RDAC   0xb

Definition at line 46 of file fsl_wm8960.h.

◆ WM8960_RESET

#define WM8960_RESET   0xf

Definition at line 48 of file fsl_wm8960.h.

◆ WM8960_RINPATH

#define WM8960_RINPATH   0x21

Definition at line 65 of file fsl_wm8960.h.

◆ WM8960_RINVOL

#define WM8960_RINVOL   0x1

Definition at line 36 of file fsl_wm8960.h.

◆ WM8960_ROUT1

#define WM8960_ROUT1   0x3

Definition at line 38 of file fsl_wm8960.h.

◆ WM8960_ROUT2

#define WM8960_ROUT2   0x29

Definition at line 72 of file fsl_wm8960.h.

◆ WM8960_ROUTMIX

#define WM8960_ROUTMIX   0x25

Definition at line 68 of file fsl_wm8960.h.

Typedef Documentation

◆ wm8960_audio_format_t

wm8960 audio format

◆ wm8960_config_t

Initialize structure of WM8960.

◆ wm8960_handle_t

wm8960 codec handler

◆ wm8960_input_t

wm8960 input source

◆ wm8960_module_t

Modules in WM8960 board.

◆ wm8960_play_source_t

wm8960 play source

◆ wm8960_protocol_t

The audio data transfer protocol choice. WM8960 only supports I2S format and PCM format.

◆ wm8960_route_t

WM8960 data route. Only provide some typical data route, not all route listed. Note: Users cannot combine any routes, once a new route is set, the previous one would be replaced.

Enumeration Type Documentation

◆ _wm8960_audio_bit_width

audio bit width

Enumerator
kWM8960_AudioBitWidth16bit 

audio bit width 16

kWM8960_AudioBitWidth20bit 

audio bit width 20

kWM8960_AudioBitWidth24bit 

audio bit width 24

kWM8960_AudioBitWidth32bit 

audio bit width 32

Definition at line 287 of file fsl_wm8960.h.

◆ _wm8960_input

wm8960 input source

Enumerator
kWM8960_InputClosed 

Input device is closed

kWM8960_InputSingleEndedMic 

Input as single ended mic, only use L/RINPUT1

kWM8960_InputDifferentialMicInput2 

Input as differential mic, use L/RINPUT1 and L/RINPUT2

kWM8960_InputDifferentialMicInput3 

Input as differential mic, use L/RINPUT1 and L/RINPUT3

kWM8960_InputLineINPUT2 

Input as line input, only use L/RINPUT2

kWM8960_InputLineINPUT3 

Input as line input, only use L/RINPUT3

Definition at line 259 of file fsl_wm8960.h.

◆ _wm8960_module

Modules in WM8960 board.

Enumerator
kWM8960_ModuleADC 

ADC module in WM8960

kWM8960_ModuleDAC 

DAC module in WM8960

kWM8960_ModuleVREF 

VREF module

kWM8960_ModuleHP 

Headphone

kWM8960_ModuleMICB 

Mic bias

kWM8960_ModuleMIC 

Input Mic

kWM8960_ModuleLineIn 

Analog in PGA

kWM8960_ModuleLineOut 

Line out module

kWM8960_ModuleSpeaker 

Speaker module

kWM8960_ModuleOMIX 

Output mixer

Definition at line 201 of file fsl_wm8960.h.

◆ _wm8960_play_channel

wm8960 play channel

Enumerator
kWM8960_HeadphoneLeft 

wm8960 headphone left channel

kWM8960_HeadphoneRight 

wm8960 headphone right channel

kWM8960_SpeakerLeft 

wm8960 speaker left channel

kWM8960_SpeakerRight 

wm8960 speaker right channel

Definition at line 216 of file fsl_wm8960.h.

◆ _wm8960_play_source

wm8960 play source

Enumerator
kWM8960_PlaySourcePGA 

wm8960 play source PGA

kWM8960_PlaySourceInput 

wm8960 play source Input

kWM8960_PlaySourceDAC 

wm8960 play source DAC

Definition at line 225 of file fsl_wm8960.h.

◆ _wm8960_protocol

The audio data transfer protocol choice. WM8960 only supports I2S format and PCM format.

Enumerator
kWM8960_BusI2S 

I2S type

kWM8960_BusLeftJustified 

Left justified mode

kWM8960_BusRightJustified 

Right justified mode

kWM8960_BusPCMA 

PCM A mode

kWM8960_BusPCMB 

PCM B mode

Definition at line 249 of file fsl_wm8960.h.

◆ _wm8960_route

WM8960 data route. Only provide some typical data route, not all route listed. Note: Users cannot combine any routes, once a new route is set, the previous one would be replaced.

Enumerator
kWM8960_RouteBypass 

LINEIN->Headphone.

kWM8960_RoutePlayback 

I2SIN->DAC->Headphone.

kWM8960_RoutePlaybackandRecord 

I2SIN->DAC->Headphone, LINEIN->ADC->I2SOUT.

kWM8960_RouteRecord 

LINEIN->ADC->I2SOUT.

Definition at line 237 of file fsl_wm8960.h.

◆ _wm8960_sample_rate

audio sample rate definition

Enumerator
kWM8960_AudioSampleRate8KHz 

Sample rate 8000 Hz

kWM8960_AudioSampleRate11025Hz 

Sample rate 11025 Hz

kWM8960_AudioSampleRate12KHz 

Sample rate 12000 Hz

kWM8960_AudioSampleRate16KHz 

Sample rate 16000 Hz

kWM8960_AudioSampleRate22050Hz 

Sample rate 22050 Hz

kWM8960_AudioSampleRate24KHz 

Sample rate 24000 Hz

kWM8960_AudioSampleRate32KHz 

Sample rate 32000 Hz

kWM8960_AudioSampleRate44100Hz 

Sample rate 44100 Hz

kWM8960_AudioSampleRate48KHz 

Sample rate 48000 Hz

kWM8960_AudioSampleRate96KHz 

Sample rate 96000 Hz

kWM8960_AudioSampleRate192KHz 

Sample rate 192000 Hz

kWM8960_AudioSampleRate384KHz 

Sample rate 384000 Hz

Definition at line 270 of file fsl_wm8960.h.

Function Documentation

◆ WM8960_ConfigDataFormat()

status_t WM8960_ConfigDataFormat ( wm8960_handle_t handle,
uint32_t  sysclk,
uint32_t  sample_rate,
uint32_t  bits 
)

Configure the data format of audio data.

This function would configure the registers about the sample rate, bit depths.

Parameters
handleWM8960 handle structure pointer.
sysclksystem clock of the codec which can be generated by MCLK or PLL output.
sample_rateSample rate of audio file running in WM8960. WM8960 now supports 8k, 11.025k, 12k, 16k, 22.05k, 24k, 32k, 44.1k, 48k and 96k sample rate.
bitsBit depth of audio file (WM8960 only supports 16bit, 20bit, 24bit and 32 bit in HW).

Definition at line 533 of file fsl_wm8960.c.

◆ WM8960_Deinit()

status_t WM8960_Deinit ( wm8960_handle_t handle)

Deinit the WM8960 codec.

This function close all modules in WM8960 to save power.

Parameters
handleWM8960 handle structure pointer.

Definition at line 116 of file fsl_wm8960.c.

◆ WM8960_GetVolume()

uint32_t WM8960_GetVolume ( wm8960_handle_t handle,
wm8960_module_t  module 
)

Get the volume of different modules in WM8960.

This function gets the volume of WM8960 modules. Uses need to appoint the module. The function assume that left channel and right channel has the same volume.

Parameters
handleWM8960 handle structure.
moduleModule to set volume, it can be ADC, DAC, Headphone and so on.
Returns
Volume value of the module.

Definition at line 432 of file fsl_wm8960.c.

◆ WM8960_Init()

status_t WM8960_Init ( wm8960_handle_t handle,
const wm8960_config_t wm8960Config 
)

WM8960 initialize function.

The second parameter is NULL to WM8960 in this version. If users want to change the settings, they have to use wm8960_write_reg() or wm8960_modify_reg() to set the register value of WM8960. Note: If the codec_config is NULL, it would initialize WM8960 using default settings. The default setting: codec_config->route = kWM8960_RoutePlaybackandRecord codec_config->bus = kWM8960_BusI2S codec_config->master = slave

Parameters
handleWM8960 handle structure.
wm8960ConfigWM8960 configuration structure.

Definition at line 38 of file fsl_wm8960.c.

◆ WM8960_ModifyReg()

status_t WM8960_ModifyReg ( wm8960_handle_t handle,
uint8_t  reg,
uint16_t  mask,
uint16_t  val 
)

Modify some bits in the register using I2C.

Parameters
handleWM8960 handle structure.
regThe register address in WM8960.
maskThe mask code for the bits want to write. The bit you want to write should be 0.
valValue needs to write into the register.

Definition at line 630 of file fsl_wm8960.c.

◆ WM8960_ReadReg()

status_t WM8960_ReadReg ( uint8_t  reg,
uint16_t *  val 
)

Read register from WM8960 using I2C.

Parameters
regThe register address in WM8960.
valValue written to.

Definition at line 618 of file fsl_wm8960.c.

◆ WM8960_SetDataRoute()

status_t WM8960_SetDataRoute ( wm8960_handle_t handle,
wm8960_route_t  route 
)

Set audio data route in WM8960.

This function would set the data route according to route. The route cannot be combined, as all route would enable different modules. Note: If a new route is set, the previous route would not work.

Parameters
handleWM8960 handle structure.
routeAudio data route in WM8960.

Definition at line 201 of file fsl_wm8960.c.

◆ WM8960_SetJackDetect()

status_t WM8960_SetJackDetect ( wm8960_handle_t handle,
bool  isEnabled 
)

Enable/disable jack detect feature.

Parameters
handleWM8960 handle structure.
isEnabledEnable or disable moudles.

Definition at line 584 of file fsl_wm8960.c.

◆ WM8960_SetLeftInput()

status_t WM8960_SetLeftInput ( wm8960_handle_t handle,
wm8960_input_t  input 
)

Set left audio input source in WM8960.

Parameters
handleWM8960 handle structure.
inputAudio input source.

Definition at line 269 of file fsl_wm8960.c.

◆ WM8960_SetMasterSlave()

void WM8960_SetMasterSlave ( wm8960_handle_t handle,
bool  master 
)

Set WM8960 as master or slave.

Parameters
handleWM8960 handle structure.
master1 represent master, 0 represent slave.

Definition at line 128 of file fsl_wm8960.c.

◆ WM8960_SetModule()

status_t WM8960_SetModule ( wm8960_handle_t handle,
wm8960_module_t  module,
bool  isEnabled 
)

Enable/disable expected devices.

Parameters
handleWM8960 handle structure.
moduleModule expected to enable.
isEnabledEnable or disable moudles.

Definition at line 140 of file fsl_wm8960.c.

◆ WM8960_SetMute()

status_t WM8960_SetMute ( wm8960_handle_t handle,
wm8960_module_t  module,
bool  isEnabled 
)

Mute modules in WM8960.

Parameters
handleWM8960 handle structure.
moduleModules need to be mute.
isEnabledMute or unmute, 1 represent mute.

Definition at line 460 of file fsl_wm8960.c.

◆ WM8960_SetPlay()

status_t WM8960_SetPlay ( wm8960_handle_t handle,
uint32_t  playSource 
)

SET the WM8960 play source.

Parameters
handleWM8960 handle structure.
playSourceplay source , can be a value combine of kWM8960_ModuleHeadphoneSourcePGA, kWM8960_ModuleHeadphoneSourceDAC, kWM8960_ModulePlaySourceInput, kWM8960_ModulePlayMonoRight, kWM8960_ModulePlayMonoLeft.
Returns
kStatus_WM8904_Success if successful, different code otherwise..

Definition at line 649 of file fsl_wm8960.c.

◆ WM8960_SetProtocol()

status_t WM8960_SetProtocol ( wm8960_handle_t handle,
wm8960_protocol_t  protocol 
)

Set the audio transfer protocol.

WM8960 only supports I2S, left justified, right justified, PCM A, PCM B format.

Parameters
handleWM8960 handle structure.
protocolAudio data transfer protocol.

Definition at line 373 of file fsl_wm8960.c.

◆ WM8960_SetRightInput()

status_t WM8960_SetRightInput ( wm8960_handle_t handle,
wm8960_input_t  input 
)

Set right audio input source in WM8960.

Parameters
handleWM8960 handle structure.
inputAudio input source.

Definition at line 321 of file fsl_wm8960.c.

◆ WM8960_SetVolume()

status_t WM8960_SetVolume ( wm8960_handle_t handle,
wm8960_module_t  module,
uint32_t  volume 
)

Set the volume of different modules in WM8960.

This function would set the volume of WM8960 modules. Uses need to appoint the module. The function assume that left channel and right channel has the same volume.

Parameters
handleWM8960 handle structure.
moduleModule to set volume, it can be ADC, DAC, Headphone and so on.
volumeVolume value need to be set.

Definition at line 378 of file fsl_wm8960.c.

◆ WM8960_WriteReg()

status_t WM8960_WriteReg ( wm8960_handle_t handle,
uint8_t  reg,
uint16_t  val 
)

Write register to WM8960 using I2C.

Parameters
handleWM8960 handle structure.
regThe register address in WM8960.
valValue needs to write into the register.

Definition at line 605 of file fsl_wm8960.c.

Variable Documentation

◆ bitWidth

uint32_t _wm8960_audio_format::bitWidth

bit width

Definition at line 300 of file fsl_wm8960.h.

◆ bus

wm8960_protocol_t wm8960_config::bus

Audio transfer protocol

Definition at line 307 of file fsl_wm8960.h.

◆ config

const wm8960_config_t* _wm8960_handle::config

wm8904 config pointer

Definition at line 322 of file fsl_wm8960.h.

◆ enableSpeaker

bool wm8960_config::enableSpeaker

True means enable class D speaker as output, false means no

Definition at line 310 of file fsl_wm8960.h.

◆ format

wm8960_audio_format_t wm8960_config::format

Audio format

Definition at line 308 of file fsl_wm8960.h.

◆ i2cConfig

codec_i2c_config_t wm8960_config::i2cConfig

i2c configuration

Definition at line 315 of file fsl_wm8960.h.

◆ i2cHandle

uint8_t _wm8960_handle::i2cHandle[WM8960_I2C_HANDLER_SIZE]

i2c handle

Definition at line 323 of file fsl_wm8960.h.

◆ leftInputSource

wm8960_input_t wm8960_config::leftInputSource

Left input source for WM8960

Definition at line 311 of file fsl_wm8960.h.

◆ master_slave

bool wm8960_config::master_slave

Master or slave.

Definition at line 309 of file fsl_wm8960.h.

◆ mclk_HZ

uint32_t _wm8960_audio_format::mclk_HZ

master clock frequency

Definition at line 298 of file fsl_wm8960.h.

◆ playSource

wm8960_play_source_t wm8960_config::playSource

play source

Definition at line 313 of file fsl_wm8960.h.

◆ rightInputSource

wm8960_input_t wm8960_config::rightInputSource

Right input source for wm8960

Definition at line 312 of file fsl_wm8960.h.

◆ route

wm8960_route_t wm8960_config::route

Audio data route.

Definition at line 306 of file fsl_wm8960.h.

◆ sampleRate

uint32_t _wm8960_audio_format::sampleRate

sample rate

Definition at line 299 of file fsl_wm8960.h.

◆ slaveAddress

uint8_t wm8960_config::slaveAddress

wm8960 device address

Definition at line 314 of file fsl_wm8960.h.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:09