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

📄 uda1341ts.h

📁 OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI的双核处理器
💻 H
字号:
//=====================================================================  
//      TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION             
// Property of Texas Instruments -- For Unrestricted Internal Use Only   
// Unauthorized reproduction and/or distribution is strictly prohibited  
// This product is protected under copyright law and trade secret law as 
// an unpublished work.Created 1987,(C) Copyright 1997 Texas Instruments.
// All rights reserved.                                                  
//=====================================================================  

#ifndef UDA1341TS_H
#define UDA1341TS_H

#include "mapping.h"
#include "gpio_a9.h"




//---------------------------------------------------------
//NAME        : <LIB_function_name>
//DESCRIPTION : 
//PARAMETERS  : 
//RETURN VALUE: 
//LIMITATIONS :
//---------------------------------------------------------

typedef enum {
  SHORT_MESSAGE,
  EXTENDED_MESSAGE
}message_length;

typedef struct {     
    UWORD8 ex_address;
    UWORD8 ex_data;
} ex_message_t;

typedef struct {
  message_length type;
  UWORD8 adresse;
  union {          
    UWORD8 data;
    ex_message_t ex_message;
  }param; 
} codec_message_t;

//----------------------
// Registers address    
//----------------------

#define DATA_0_ADDR               0x14	// direct and extended addressing registers address
#define DATA_1_ADDR               0x15	//only for peak level reading 
#define STATUS_ADDR               0x16	// statut registers address

#define DATA_0_EXTENDED_ADDR_MASK 0xC0 
#define DATA_0_EXTENDED_DATA_MASK 0xD0 

//-------------------
// status register   
//-------------------

// STATUS_CONTROL BITS
#define STATUS_CONTROL_0          0x00
#define STATUS_CONTROL_1          0x80

//  STATUS_CONTROL_0  register bit                       
//  BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0
//  0    | RST  | SC1  | SC0  | IF2  | IF1  | IF0  | DC  

#define NO_RST 0x00	//0 no reset 
#define RST    0x40	//1 reset 

#define SC_512FS 0x00	// system clock setting
#define SC_384FS 0x10	//sc1 sc0         
#define SC_256FS 0x20	// 0   0 512fs    
			// 0   1 384fs    
			// 1   0 256fs    
			// 1   1 not used 


#define IF_I2S 0x00	//IF2 IF1 IF0 FUNCTION 
			// 0   0   0 I 2 S-bus 
			// 0   0   1 LSB-justified 16 bits 
			// 0   1   0 LSB-justified 18 bits 
			// 0   1   1 LSB-justified 20 bits 
			// 1   0   0 MSB-justified 
			// 1   0   1 LSB-justified 16 bits input and MSB-justified output 
			// 1   1   0 LSB-justified 18 bits input and MSB-justified output 
			// 1   1   1 LSB-justified 20 bits input and MSB-justified output

 
#define DC_FILTER_OFF 0x00	// DC FUNCTION         
#define DC_FILTER_ON  0x01	// 0   no DC-filtering 
				// 1   DC-filtering    

//  STATUS_CONTROL_1  register bit                       
//  BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0
//  1    | OGS  | IGS  | PAD  | PDA  | DS   | PC1  | PC0 


#define OGS_OFF 0x00	//GAIN OF DAC 
#define OGS_ON  0x40	// 0 0dB 
			// 1 6dB 

#define IGS_OFF 0x00	//GAIN OF ADC 
#define IGS_ON  0x20	// 0 0dB 
			// 1 6dB 

#define PAD_NON_INV 0x00	// POLARITY OF ADC 
#define PAD_INV     0x10	// 0 non-inverting 
				// 1 inverting 

#define PDA_NON_INV 0x00	// POLARITY OF DAC 
#define PDA_INV     0x08	// 0 non-inverting 
				// 1 inverting 

#define SINGLE_SPEED 0x00	//double speed setting 
#define DOUBLE_SPEED 0x04	// 0 single speed playback 
				// 1 double speed playback 


#define PLAY		    0x01	// power control  
#define RECORD              0x02	// PC1 PC0 ADC DAC
#define PLAY_AND_RECORD_OFF 0x00	//  0   0  off off
#define PLAY_AND_RECORD_ON  0x03	//  0   1  off on 
					//  1   0  on off 
					//  1   1  on on  

// MIC sensitivity

#define MIC_MIXER_ADDR 0x02

#define MIC_MINUS3   0x00
#define MIC_0        0x04
#define MIC_PLUS3    0x08
#define MIC_PLUS6    0x0C
#define MIC_PLUS9    0x10
#define MIC_PLUS15   0x14
#define MIC_PLUS27   0x18

//---------------------------------------------------------
//NAME        : UDA_SendDataToCodec                     
//DESCRIPTION : configure the codec using the L3 interface 
//PARAMETERS  : None                                       
//RETURN VALUE: None                                       
//LIMITATIONS : None                                       
//---------------------------------------------------------

void UDA_SendDataToCodec(codec_message_t message);

//---------------------------------------------------------
//NAME        : UDA_ConfigForSoundRecording             
//DESCRIPTION : configure UDA1341 for recording            
//PARAMETERS  : None                                       
//RETURN VALUE: None                                       
//LIMITATIONS : None                                       
//---------------------------------------------------------

void UDA_ConfigForSoundRecording(void);
 
//---------------------------------------------------------
//NAME        : UDA_ConfigForSoundRecording             
//DESCRIPTION : configure UDA1341 for playing              
//PARAMETERS  : None                                       
//RETURN VALUE: None                                       
//LIMITATIONS : None                                       
//---------------------------------------------------------

void UDA_ConfigForSoundPlaying(void);


#endif

⌨️ 快捷键说明

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