📄 sru.h
字号:
//==============================================================================
//
// SRU.h (c) Copyright 2003 Analog Devices, Inc. All rights reserved.
//
// This include file contains a list of macro "defines" to enable the
// programmer to use symbolic names for ADSP-21262/21266 SRU
// This is intended to simplify patching in the Signal Routing Unit (SRU)
//
// 28.AUG.2003 - KM - Created
// 26.SEP.2003 - GL - Modified to add the bit names from the manual
// This allows programming of the SRU without the macro.
// The new definitions begin at line 8989
// - Modified comments to be in line with apps header files
// 22.OCT.2003 - Changed DAI_PB*_I_TIMER*_O_PB_ENCODING and DAI_PB*_I_FLAG10_O_PB_ENCODING
// to DAI_PB*_I_TIMER*_O_ENCODING and DAI_PB*_I_FLAG10_O_ENCODING to agree
// with HRM.
// 24.OCT.2003 - BM - Bit names from the manual overlap with originally defined bitnames.
// added a commented macro definition for those who desire to not use
// the SRU(OUT,IN) macro. Uncomment the #define NO_SRU_MACRO if you
// desire to use this file without the SRU macro.
// 15.DEC.2003 - KM - Added redundant entries to account for typos in HRM and
// compatability with legacy examples: MISCB_x_O = MISCBx_O,
// SPORTx_Db_O = SPORTx_DA_O, SPORTx_Db_O = SPORTx_DB_O,
// (in HRM Appendix B Group E: DAI_Pxx_O = DAI_PBxx_O),
// added FLAGxx_I, TIMERx_I and DAI_INT_xx in Group E
//==============================================================================
#ifndef __SRU_H___
#define __SRU_H___
//Uncomment the follwing #define if you do not desire to use the SRU(OUT,IN) macro
//and instead desire to write code performing the same function. In most cases,
//this #define should remain commented.
//#define NO_SRU_MACRO
#ifndef NO_SRU_MACRO
//==============================================================================
//
// The actual macro
//
//==============================================================================
#ifdef _LANGUAGE_C
#define SRU(OUT,IN) \
* (volatile int *) IN##_##OUT##_REG &= IN##_MASK; \
* (volatile int *) IN##_##OUT##_REG |= (IN##_##OUT##_ENCODING >> IN##_SHIFT); \
#else
#define SRU(OUT,IN) \
r0 = dm(IN##_##OUT##_REG); \
r1 = IN##_MASK; \
r0 = r0 and r1; \
r1 = IN##_##OUT##_ENCODING; \
r0 = r0 OR LSHIFT r1 BY IN##_SHIFT; \
dm(IN##_##OUT##_REG) = r0;
#endif
/*============================================================================*
* *
* GROUP A *
* *
*============================================================================*/
//------------------------------------------------------------------------------
// Group A: Input bitfield masks & shifts
//------------------------------------------------------------------------------
#define SPORT0_CLK_I_MASK 0xFFFFFFE0
#define SPORT0_CLK_I_SHIFT 0
#define SPORT1_CLK_I_MASK 0xFFFFFC1F
#define SPORT1_CLK_I_SHIFT 5
#define SPORT2_CLK_I_MASK 0xFFFF83FF
#define SPORT2_CLK_I_SHIFT 10
#define SPORT3_CLK_I_MASK 0xFFF07FFF
#define SPORT3_CLK_I_SHIFT 15
#define SPORT4_CLK_I_MASK 0xFE0FFFFF
#define SPORT4_CLK_I_SHIFT 20
#define SPORT5_CLK_I_MASK 0xC1FFFFFF
#define SPORT5_CLK_I_SHIFT 25
#define IDP0_CLK_I_MASK 0xFFF07FFF
#define IDP0_CLK_I_SHIFT 15
#define PDAP_CLK_I_MASK 0xFFF07FFF
#define PDAP_CLK_I_SHIFT 15
#define IDP1_CLK_I_MASK 0xFE0FFFFF
#define IDP1_CLK_I_SHIFT 20
#define IDP2_CLK_I_MASK 0xC1FFFFFF
#define IDP2_CLK_I_SHIFT 25
#define IDP3_CLK_I_MASK 0xFFFFFFE0
#define IDP3_CLK_I_SHIFT 0
#define IDP4_CLK_I_MASK 0xFFFFFC1F
#define IDP4_CLK_I_SHIFT 5
#define IDP5_CLK_I_MASK 0xFFFF83FF
#define IDP5_CLK_I_SHIFT 10
#define IDP6_CLK_I_MASK 0xFFF07FFF
#define IDP6_CLK_I_SHIFT 15
#define IDP7_CLK_I_MASK 0xFE0FFFFF
#define IDP7_CLK_I_SHIFT 20
#define PCG_EXTA_I_MASK 0xFFFFFFE0
#define PCG_EXTA_SHIFT 0
#define PCG_EXTB_I_MASK 0xFFFFFC1F
#define PCG_EXTB_I_SHIFT 5
//------------------------------------------------------------------------------
// Group A: Bitfield encodings
//------------------------------------------------------------------------------
#define SPORT0_CLK_I_DAI_PB01_O_ENCODING 0x00
#define SPORT1_CLK_I_DAI_PB01_O_ENCODING 0x00
#define SPORT2_CLK_I_DAI_PB01_O_ENCODING 0x00
#define SPORT3_CLK_I_DAI_PB01_O_ENCODING 0x00
#define SPORT4_CLK_I_DAI_PB01_O_ENCODING 0x00
#define SPORT5_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP0_CLK_I_DAI_PB01_O_ENCODING 0x00
#define PDAP_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP1_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP2_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP3_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP4_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP5_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP6_CLK_I_DAI_PB01_O_ENCODING 0x00
#define IDP7_CLK_I_DAI_PB01_O_ENCODING 0x00
#define PCG_EXTA_I_DAI_PB01_O_ENCODING 0x00
#define PCG_EXTB_I_DAI_PB01_O_ENCODING 0x00
#define SPORT0_CLK_I_DAI_PB02_O_ENCODING 0x01
#define SPORT1_CLK_I_DAI_PB02_O_ENCODING 0x01
#define SPORT2_CLK_I_DAI_PB02_O_ENCODING 0x01
#define SPORT3_CLK_I_DAI_PB02_O_ENCODING 0x01
#define SPORT4_CLK_I_DAI_PB02_O_ENCODING 0x01
#define SPORT5_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP0_CLK_I_DAI_PB02_O_ENCODING 0x01
#define PDAP_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP1_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP2_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP3_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP4_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP5_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP6_CLK_I_DAI_PB02_O_ENCODING 0x01
#define IDP7_CLK_I_DAI_PB02_O_ENCODING 0x01
#define PCG_EXTA_I_DAI_PB02_O_ENCODING 0x01
#define PCG_EXTB_I_DAI_PB02_O_ENCODING 0x01
#define SPORT0_CLK_I_DAI_PB03_O_ENCODING 0x02
#define SPORT1_CLK_I_DAI_PB03_O_ENCODING 0x02
#define SPORT2_CLK_I_DAI_PB03_O_ENCODING 0x02
#define SPORT3_CLK_I_DAI_PB03_O_ENCODING 0x02
#define SPORT4_CLK_I_DAI_PB03_O_ENCODING 0x02
#define SPORT5_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP0_CLK_I_DAI_PB03_O_ENCODING 0x02
#define PDAP_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP1_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP2_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP3_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP4_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP5_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP6_CLK_I_DAI_PB03_O_ENCODING 0x02
#define IDP7_CLK_I_DAI_PB03_O_ENCODING 0x02
#define PCG_EXTA_I_DAI_PB03_O_ENCODING 0x02
#define PCG_EXTB_I_DAI_PB03_O_ENCODING 0x02
#define SPORT0_CLK_I_DAI_PB04_O_ENCODING 0x03
#define SPORT1_CLK_I_DAI_PB04_O_ENCODING 0x03
#define SPORT2_CLK_I_DAI_PB04_O_ENCODING 0x03
#define SPORT3_CLK_I_DAI_PB04_O_ENCODING 0x03
#define SPORT4_CLK_I_DAI_PB04_O_ENCODING 0x03
#define SPORT5_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP0_CLK_I_DAI_PB04_O_ENCODING 0x03
#define PDAP_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP1_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP2_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP3_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP4_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP5_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP6_CLK_I_DAI_PB04_O_ENCODING 0x03
#define IDP7_CLK_I_DAI_PB04_O_ENCODING 0x03
#define PCG_EXTA_I_DAI_PB04_O_ENCODING 0x03
#define PCG_EXTB_I_DAI_PB04_O_ENCODING 0x03
#define SPORT0_CLK_I_DAI_PB05_O_ENCODING 0x04
#define SPORT1_CLK_I_DAI_PB05_O_ENCODING 0x04
#define SPORT2_CLK_I_DAI_PB05_O_ENCODING 0x04
#define SPORT3_CLK_I_DAI_PB05_O_ENCODING 0x04
#define SPORT4_CLK_I_DAI_PB05_O_ENCODING 0x04
#define SPORT5_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP0_CLK_I_DAI_PB05_O_ENCODING 0x04
#define PDAP_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP1_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP2_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP3_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP4_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP5_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP6_CLK_I_DAI_PB05_O_ENCODING 0x04
#define IDP7_CLK_I_DAI_PB05_O_ENCODING 0x04
#define PCG_EXTA_I_DAI_PB05_O_ENCODING 0x04
#define PCG_EXTB_I_DAI_PB05_O_ENCODING 0x04
#define SPORT0_CLK_I_DAI_PB06_O_ENCODING 0x05
#define SPORT1_CLK_I_DAI_PB06_O_ENCODING 0x05
#define SPORT2_CLK_I_DAI_PB06_O_ENCODING 0x05
#define SPORT3_CLK_I_DAI_PB06_O_ENCODING 0x05
#define SPORT4_CLK_I_DAI_PB06_O_ENCODING 0x05
#define SPORT5_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP0_CLK_I_DAI_PB06_O_ENCODING 0x05
#define PDAP_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP1_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP2_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP3_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP4_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP5_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP6_CLK_I_DAI_PB06_O_ENCODING 0x05
#define IDP7_CLK_I_DAI_PB06_O_ENCODING 0x05
#define PCG_EXTA_I_DAI_PB06_O_ENCODING 0x05
#define PCG_EXTB_I_DAI_PB06_O_ENCODING 0x05
#define SPORT0_CLK_I_DAI_PB07_O_ENCODING 0x06
#define SPORT1_CLK_I_DAI_PB07_O_ENCODING 0x06
#define SPORT2_CLK_I_DAI_PB07_O_ENCODING 0x06
#define SPORT3_CLK_I_DAI_PB07_O_ENCODING 0x06
#define SPORT4_CLK_I_DAI_PB07_O_ENCODING 0x06
#define SPORT5_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP0_CLK_I_DAI_PB07_O_ENCODING 0x06
#define PDAP_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP1_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP2_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP3_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP4_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP5_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP6_CLK_I_DAI_PB07_O_ENCODING 0x06
#define IDP7_CLK_I_DAI_PB07_O_ENCODING 0x06
#define PCG_EXTA_I_DAI_PB07_O_ENCODING 0x06
#define PCG_EXTB_I_DAI_PB07_O_ENCODING 0x06
#define SPORT0_CLK_I_DAI_PB08_O_ENCODING 0x07
#define SPORT1_CLK_I_DAI_PB08_O_ENCODING 0x07
#define SPORT2_CLK_I_DAI_PB08_O_ENCODING 0x07
#define SPORT3_CLK_I_DAI_PB08_O_ENCODING 0x07
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -