⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nim.h

📁 用于TM1300/PNX1300系列DSP(主要用于视频处理)的设备库的源码
💻 H
字号:
/*
 * Copyright (c) 1997, 1998 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              : nim.h    1.10
 *
 *  Last update              : 18:52:02 - 00/11/09          
 *
 *  Description              : 
 *
 *  Control functions for audio/video on the NIM daughter board 
 *  This include file is designed to be exported only to the 
 *  board support package.
 *
 *  Revision                 :
 *		
 *      
 *
 */

#ifndef _NIM_H_
#define _NIM_H_

#include <tmlib/tmtypes.h>
/* for the AI board type definitions */
#include <tm1/tmAIboard.h>

#include "nim_iic.h"

#if defined (__cplusplus)
extern "C" {

#endif /* __cplusplus */

#define NIM_SUPPORTED_AUDIO_IN_TYPES       (atfLinearPCM | atf1937)
#define NIM_SUPPORTED_AUDIO_IN_SUBTYPES    (apfStereo16)
#define NIM_SUPPORTED_AUDIO_ADAPTERS       (aaaNone | aaaLineInput | aaaDigitalInput | aaaAuxInput1)

/* INPUT_IIC_EXPANDER_ADDRESS
   address 0x72     : Input IIC expander is in NIM board 
   
   bit 0    Tuner audio (1= enable, 0 = disable)
   bit 1    Analog audio (1 = enable, 0 = disable)
   bit 2    copyprotection
   bit 3    powerdown
   bit 4    lock/unlock
   bit 5    48.0 kHz
   bit 6    44.1 kHz
   bit 7    32.0 kHz
*/
#define     NIM_TDA1315_IN_IIC_TUNER_AUDIO     (0x01)
#define     NIM_TDA1315_IN_IIC_ANALOG_AUDIO    (0x02)
#define     NIM_TDA1315_IN_IIC_COPY_PROTECTION (0x04)
#define     NIM_TDA1315_IN_IIC_POWERDOWN       (0x08)
#define     NIM_TDA1315_IN_IIC_LOCK            (0x10)
#define     NIM_TDA1315_IN_IIC_FREQUENCY_MASK  (0xE0)
#define     NIM_TDA1315_IN_IIC_44100_HZ        (0xA0)
#define     NIM_TDA1315_IN_IIC_48000_HZ        (0xC0)
#define     NIM_TDA1315_IN_IIC_32000_HZ        (0x60)

/* VIDMUX_IIC_EXPANDER_ADDRESS 
 address 0x76   : NIM INPUT MUX (in NIM board)
 bit 0  Din L3 mode
 bit 1  Din L3 clock
 bit 2  Din L3 data
 bit 3  Din L3 strobe
 bit 4  unused
 bit 5  Vin_0   00 : 7112 I port, 01 : J8, 10 : J7, 11 : 7112 X port
 bit 6  Vin_1
 bit 7  Vin Mux (1 = tristate, 0 = enable)
*/

#define     NIM_INPUT_L3_MODE                   (0x01)
#define     NIM_INPUT_L3_CLOCK                  (0x02)
#define     NIM_INPUT_L3_DATA                   (0x04)
#define     NIM_INPUT_L3_STROBE                 (0x08)
#define     NIM_INPUT_VIN_MASK                  (0x60)
#define     NIM_INPUT_VIN_MUX                   (0x80)

/* AUDIO_SELECT_ID_EXPANDER_ADDRESS 

 bit 0 audio in select 0
 bit 1 audio in select 1  00 analog audio; 01 tuner audio; 1x digital audio
 bit 2 not used
 bit 3 not used
 bit 4 not used
 bit 5 nim ID 0
 bit 6 nim ID 1
 bit 7 nim ID 2
*/

#define NIM_AUDIO_SELECT_MASK    0x03
#define NIM_AUDIO_SELECT_ANALOG  0x00
#define NIM_AUDIO_SELECT_TUNER   0x01
#define NIM_AUDIO_SELECT_DIGITAL 0x02
#define NIM_ID_MASK              0xe0

extern tmLibdevErr_t nim_AI1_Init(boardAIParam_t *param);  
extern tmLibdevErr_t nim_AI1_Term(void);
extern tmLibdevErr_t nim_AI1_Start(void);
extern tmLibdevErr_t nim_AI1_Stop(void);
extern tmLibdevErr_t nim_AI1_SetSrate(Float sRate);
extern tmLibdevErr_t nim_AI1_GetSrate(Float *sRate);
extern tmLibdevErr_t nim_AI1_SetInput(tmAudioAnalogAdapter_t input);
extern tmLibdevErr_t nim_AI1_GetInput(tmAudioAnalogAdapter_t *input);
extern tmLibdevErr_t nim_AI1_GetFormat(tmAudioFormat_t *inputFormat);
extern tmLibdevErr_t nim_AI1_Config(UInt32 subaddr, Pointer value);

extern tmLibdevErr_t nim_AI2_Init(boardAIParam_t *param);  
extern tmLibdevErr_t nim_AI2_Term(void);
extern tmLibdevErr_t nim_AI2_Start(void);
extern tmLibdevErr_t nim_AI2_Stop(void);
extern tmLibdevErr_t nim_AI2_SetSrate(Float sRate);
extern tmLibdevErr_t nim_AI2_GetSrate(Float *sRate);
extern tmLibdevErr_t nim_AI2_SetInput(tmAudioAnalogAdapter_t input);
extern tmLibdevErr_t nim_AI2_GetInput(tmAudioAnalogAdapter_t *input);
extern tmLibdevErr_t nim_AI2_GetFormat(tmAudioFormat_t *inputFormat);
extern tmLibdevErr_t nim_AI2_Config(UInt32 subaddr, Pointer value);

#if defined(__cplusplus)
}
#endif /* __cplusplus */

#endif /* _NIM_AUDIO_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -