📄 ad1847.h
字号:
/*
* Copyright (c) 1995,1996,1997 by TriMedia Technologies.
*
* +------------------------------------------------------------------+
* | This software is furnished under a license and may only be used |
* | and copied in accordance with the terms and conditions of such |
* | a license and with the inclusion of this copyright notice. This |
* | software or any other copies of this software may not be provided|
* | or otherwise made available to any other person. The ownership |
* | and title of this software is not transferred. |
* | |
* | The information in this software is subject to change without |
* | any prior notice and should not be construed as a commitment by |
* | TriMedia Technologies. |
* | |
* | this code and information is provided "as is" without any |
* | warranty of any kind, either expressed or implied, including but |
* | not limited to the implied warranties of merchantability and/or |
* | fitness for any particular purpose. |
* +------------------------------------------------------------------+
*
* Module name : ad1847.h 1.4
*
* Last update : 00:34:44 - 97/03/25
*
* Description :
*
* Header file designed for use by the device library board support package.
*
* Initialize and control routines for ad1847 audio codec.
* There are three sections to this file:
* Section 1: Support code common to all 1847 modes.
* Section 2: Master version functions
* Section 3: Slave version functions
*
* In master mode, the 1847 masters the IIS bus.
* In slave mode, TM-1 masters the IIS bus.
*
* Revision :
* Built for the TCS 1.1 release
*
*
*/
#ifndef _AD1847_H_
#define _AD1847_H_
#include <tmlib/tmtypes.h>
#include <tm1/tmAvFormats.h>
#if defined(__cplusplus)
extern "C" {
#endif /* defined(__cplusplus) */
#define AD1847_SUPPORTED_STREAM_FORMATS (atfNone | atfLinearPCM)
#define AD1847_SUPPORTED_PCM_OUT_FORMATS (apfNone | apfMono16 | apfStereo16)
#define AD1847_SUPPORTED_PCM_IN_FORMATS (apfNone | apfMono16 | apfStereo16)
#define AD1847_MAX_SRATE 50000
#define AD1847_MIN_SRATE 4000
#define AD1847_INPUT_MAX_VOLUME 2250
#define AD1847_INPUT_MIN_VOLUME 0
#define AD1847_OUTPUT_MAX_VOLUME 0
#define AD1847_OUTPUT_MIN_VOLUME (-9600)
#define TM_IREF_IIC_EXPANDER_ADDRESS (0x70)
#define AD1847_SRC_LINE1 0x00 /* = aaaLineInput */
#define AD1847_SRC_AUX1 0x40 /* = aaaMicInput */
#define AD1847_SRC_LINE2 0x80 /* CD on IRef board */
#define AD1847_SRC_AUX2 0xc0 /* = aaaAuxInput2 */
/*******************************************************
* Initializes the AD1847.
*/
extern tmLibdevErr_t ad1847MasterInit(tmAudioPcmFormat_t pcmFormat, Float sRate);
/*******************************************************
* Shut down the AD1847.
*/
extern tmLibdevErr_t ad1847Term(void);
/*******************************************************
* Resets the AD1847 and writes the old values into its
* internal registers. This function must be called after
* changing the sample rate because the AD1847 can hang after
* its external claock changed.
*/
extern tmLibdevErr_t ad1847Reset(Float sRate);
/*******************************************************
* Choose one of four sources
* Set input gain in 100th db. Range 0 to 2250.
*/
extern tmLibdevErr_t ad1847ConfigureInput(int src, int lvol, int rvol);
/*******************************************************
* volumes given in 100th db.
* vol < -9600 implies mute.
* Part has 1.5db resolution.
* flags is not used.
* Max is 0db (0)
*/
extern tmLibdevErr_t ad1847ConfigureOutput(int lgain, int rgain);
/* mutes the DACs of the AD1847 */
extern tmLibdevErr_t ad1847MuteOutput(void);
#if defined(__cplusplus)
}
#endif /* defined(__cplusplus) */
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -