9 #define CODEC_0DB_GAIN 0x0008
10 #define CODEC_MAX_ATTN 0x003f
11 #define CODEC_MUTE 0x8000U
14 /* Control function defines */
15 #define CODEC_CTL_4SPKR 0x00U /* 4-spkr output mode enable */
16 #define CODEC_CTL_MICBOOST 0x01U /* Mic boost (+30 dB) enable */
17 #define CODEC_CTL_PWRDOWN 0x02U /* power-down mode */
18 #define CODEC_CTL_DOSMODE 0x03U /* A/D sync to DAC1 */
20 /* Timeout waiting for: */
21 #define CODEC_ERR_WIP_TIMEOUT -1 /* write in progress complete */
22 #define CODEC_ERR_DATA_TIMEOUT -2 /* data ready */
23 #define CODEC_ERR_SRC_NOT_BUSY_TIMEOUT -3 /* SRC not busy */
24 #define CODEC_ERR_SRC_SYNC_TIMEOUT -4 /* state #1 */
26 /* Function to inform CODEC module which AC97 vendor ID to expect */
27 void CodecSetVendorId (char *tbuf
);
29 /* CODEC Mixer and Mode control function prototypes */
31 int CodecRead (DEV_STRUCT
* pCC
, u16_t wAddr
, u16_t
*data
);
32 int CodecWrite (DEV_STRUCT
* pCC
, u16_t wAddr
, u16_t wData
);
33 void CodecSetSrcSyncState (int state
);
34 int CodecWriteUnsynced (DEV_STRUCT
* pCC
, u16_t wAddr
, u16_t wData
);
35 int CodecReadUnsynced (DEV_STRUCT
* pCC
, u16_t wAddr
, u16_t
*data
);
38 This function initializes the CODEC to a default mode.
40 int CODECInit( DEV_STRUCT
* pCC
);