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

📄 gdmatest_omap32.c

📁 OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI的双核处理器
💻 C
📖 第 1 页 / 共 5 页
字号:

                //DMA_CCR2
                //-----------------------
                Chptr->CFE = ConstantFillEnable;
                Chptr->TCE = TransparentEnable;
                Chptr->BSE = BlockSynchronizationEnable;
	        Chptr->PSE = PacketSizecsfi;	      // NEW FEATURE WHICH HAS TO BE DEFINE IN gdma_omap32.h

                //DMA_LCH_CTRL 
                //----------------------
                Chptr->LCH_TYPE = LogicalChannelType;
                Chptr->LCH_INTERLEAVE_DIS = LogicalChannelInterleave;
	return(True);	
}
	
//-------------------------------------------------------------------------------
// NAME         : DMAT_InitWithPattern       
//
// DESCRIPTION  : Setup everything which is involved with data in the channel
//                
// PARAMETERS   : ChannelNumber       DMA_CHANNEL_0   
//                                    DMA_CHANNEL_1   
//                                    DMA_CHANNEL_2   
//                                    DMA_CHANNEL_3   
//                                    DMA_CHANNEL_4   
//                                    DMA_CHANNEL_5   
//                                    DMA_CHANNEL_6   
//                                    DMA_CHANNEL_7   
//                                    DMA_CHANNEL_8   
//                                    DMA_CHANNEL_9   
//                                    DMA_CHANNEL_10   
//                                    DMA_CHANNEL_11   
//                                    DMA_CHANNEL_12   
//                                    DMA_CHANNEL_13   
//                                    DMA_CHANNEL_14   
//                                    DMA_CHANNEL_15   
//
//                                    DMA_CHANNEL_LCD 
//
//                Config              See DMA_CONFIG... labels in dmatest.h
//
//
// RETURN VALUE : IS_OK or NOT_OK if something fail
//
//--------------------------------------------------------------------------------
BOOL DMAT_InitWithPattern_OMAP32( UWORD16 ChannelNumber ,
                              UWORD16 Pattern,
                              UWORD8 Eltype,
                              UWORD8 SrcPack,
                              UWORD8 DestPack,
                              UWORD8 SrcBurst,
                              UWORD8  DestBurst,
                              UWORD8  SyncNumb,
                              UWORD8  EventSync,
                              UWORD8  Priority,
                              UWORD8  Autoinit,
                              UWORD8  OMAP31Disable,
                              UWORD8  SrcAmode,
                              UWORD8  DestAmode, 
                              UWORD16  EltNumber,
                              UWORD16  FrameNumber,
                              UWORD16  EltIndex,
                              UWORD16  FrameIndex,
                              UWORD16  DestElementIndex,
                              UWORD32  Color,               
                              UWORD8   ConstantFillEnable,
                              UWORD8   TransparentEnable,
                              UWORD8   BlockSynchronizationEnable,
                              UWORD8   LogicalChannelType,
                              UWORD8   LogicalChannelInterleave)
{
CHANNEL_DESCRIPTOR_OMAP32* Chptr;

 Chptr=&(SystemDma_omap32.DmaChannel[ChannelNumber]);
 Chptr->Pattern = Pattern;
                //DMA_CSDP
                //--------------------
                Chptr->TypeSize = Eltype;
                
                Chptr->SrcPack = SrcPack;
                Chptr->DestPack = DestPack;
                
                Chptr->SrcBurst = SrcBurst;
                Chptr->DestBurst = DestBurst;
                
                //DMA_CCR
                //-----------------------
                Chptr->SyncNumb = SyncNumb;
                Chptr->EventSync = EventSync;//fs
                Chptr->Priority = Priority;
                //  Chptr->Enable = ;
                Chptr->Autoinit = Autoinit;
                Chptr->OMAP31Disable = OMAP31Disable;
                
                Chptr->SrcAddressMode = SrcAmode;
                Chptr->DestAddressMode = DestAmode;
                
                //DMA_CEN 
                //----------------------
                Chptr->EltNumber = EltNumber;
                
                //DMA_CFN 
                //----------------------
                Chptr->FrameNumber = FrameNumber;
                
                //DMA_CEI 
                //----------------------
                Chptr->EltIndex = EltIndex;
                
                //DMA_CFI 
                //----------------------
                Chptr->FrameIndex = FrameIndex;

                //DMA_CDEI 
                //----------------------
                Chptr->DEltIndex = DestElementIndex;

                //DMA_COLOR 
                //----------------------
                Chptr->COLOR = Color;

                //DMA_CCR2
                //-----------------------
                Chptr->CFE = ConstantFillEnable;
                Chptr->TCE = TransparentEnable;
                Chptr->BSE  = BlockSynchronizationEnable;

                //DMA_LCH_CTRL 
                //----------------------
                Chptr->LCH_TYPE = LogicalChannelType;
                Chptr->LCH_INTERLEAVE_DIS = LogicalChannelInterleave;
	return(True);
}

BOOL DMAT_LcdInitWithPattern(UWORD16 ChannelNumber ,
                              UWORD16 Pattern,
                              UWORD8 B1Eltype,
                              UWORD8 B2Eltype,
                              UWORD8 B1Pack,
                              UWORD8 B2Pack,
                              UWORD8 B1Burst,
                              UWORD8 B2Burst,
                              UWORD8 Priority,
                              UWORD8 Autoinit,
                              UWORD8 OMAP31Disable,
                              UWORD8 Repeat,
                              UWORD8 B1Amode,
                              UWORD8 B2Amode, 
                              UWORD16  B1EltNumber,
                              UWORD16  B1FrameNumber,
                              UWORD16  B1EltIndex,
                              UWORD32  B1FrameIndex,
                              UWORD16  B2EltNumber,
                              UWORD16  B2FrameNumber,
                              UWORD16  B2EltIndex,
                              UWORD32  B2FrameIndex)

{
LCD_CHANNEL_DESCRIPTOR_OMAP32* Chptr;

 Chptr=&(SystemDma_omap32.LcdChannel);
 Chptr->Pattern = Pattern;
                //DMA_CSDP
                //--------------------
                Chptr->TypeSize_B1 = B1Eltype;
                Chptr->TypeSize_B2 = B2Eltype;
                Chptr->B1_Pack = B1Pack;
                Chptr->B2_Pack = B2Pack;
                Chptr->B1_Burst = B1Burst;
                Chptr->B2_Burst = B2Burst;
                
                //DMA_CCR
                //-----------------------
                Chptr->Priority = Priority;
                Chptr->Autoinit = Autoinit;
                Chptr->Repeat   = Repeat;
                Chptr->OMAP31Disable = OMAP31Disable;
                Chptr->B1AddressMode = B1Amode;
                Chptr->B2AddressMode = B2Amode;
                
                //DMA_EI_B1
                //-----------------------
                Chptr->LcdSrcEI_B1 = B1EltIndex;
                
                //DMA_EI_B2 
                //----------------------
                Chptr->LcdSrcEI_B2 = B2EltIndex;
                
                //DMA_FI_B1 
                //----------------------
                Chptr->LcdSrcFI_B1 = B1FrameIndex;
                
                //DMA_FI_B2 
                //----------------------
                Chptr->LcdSrcFI_B2 = B2FrameIndex;

                //DMA_EN_B1 
                //----------------------
                Chptr->LcdSrcEN_B1 = B1EltNumber;

                //DMA_EN_B2 
                //----------------------
                Chptr->LcdSrcEN_B2 = B2EltNumber;

                //DMA_FN_B1
                //-----------------------
                Chptr->LcdSrcFN_B1 = B1FrameNumber;

                //DMA_FN_B2 
                //----------------------
                Chptr->LcdSrcFN_B2 = B2FrameNumber;
	return(True);
}

//-------------------------------------------------------------------------------
// NAME         : DMAT_ChainingSetup       
//
// DESCRIPTION  : Setup Chaining for the logical channels
//                
// PARAMETERS   : ChannelNumber       DMA_CHANNEL_0   
//                                    DMA_CHANNEL_1   
//                                    DMA_CHANNEL_2   
//                                    DMA_CHANNEL_3   
//                                    DMA_CHANNEL_4   
//                                    DMA_CHANNEL_5   
//                                    DMA_CHANNEL_6   
//                                    DMA_CHANNEL_7   
//                                    DMA_CHANNEL_8   
//                                    DMA_CHANNEL_9   
//                                    DMA_CHANNEL_10   
//                                    DMA_CHANNEL_11   
//                                    DMA_CHANNEL_12   
//                                    DMA_CHANNEL_13   
//                                    DMA_CHANNEL_14   
//                                    DMA_CHANNEL_15   
//
//                Config              See DMA_CONFIG... labels in dmatest.h
//
//
// RETURN VALUE : IS_OK or NOT_OK if something fail
//
//--------------------------------------------------------------------------------
BOOL DMAT_ChainingSetup( UWORD16 ChannelNumber ,
                              UWORD8 NextLogicalChannel, BIT ChainingEnable)
{
CHANNEL_DESCRIPTOR_OMAP32* Chptr;

	Chptr=&(SystemDma_omap32.DmaChannel[ChannelNumber]);
	Chptr->NXTLCH_ID = NextLogicalChannel;
	Chptr->ENABLE_LNK = ChainingEnable;
	return(True);
}

//-------------------------------------------------------------------------------
// NAME         : DMAT_LcdConfigPort_OMAP32       
//
// DESCRIPTION  : Setup lcd channel port configuration
//                
// PARAMETERS	: SrcPort          DMA_LCD_EMIFF_SRC
//                                 DMA_LCD_OCPT1_SRC
//                                 DMA_LCD_OCPT2_SRC
//                                    
//                DestPort         
//
//                AddTop1          Start address of the source for the 1st frame
//                AddBot1          End address of the source for the 1st frame
//
//                AddTop2          Start address of the source for the 2nd frame
//                AddBot2          End address of the source for the 2nd frame
//
// RETURN VALUE : IS_OK or NOT_OK if something fail
//
//--------------------------------------------------------------------------------
void DMAT_LcdConfigPort_OMAP32(UWORD32 SrcPort,
               UWORD32 DestPort,
			   UWORD32 AddTop1,
			   UWORD32 AddBot1,
			   UWORD32 AddTop2,
			   UWORD32 AddBot2)

{
LCD_CHANNEL_DESCRIPTOR_OMAP32* Chptr;

  Chptr=&(SystemDma_omap32.LcdChannel);
                
  //DMA Source
  //--------------------
  Chptr->LcdSrc = SrcPort;

  //DMA Destination
  //--------------------
  Chptr->LcdDest = DestPort;

  //DMA Addresses
  //--------------------
  Chptr->LcdTopB1 = AddTop1;
  Chptr->LcdBotB1 = AddBot1;
  Chptr->LcdTopB2 = AddTop2;
  Chptr->LcdBotB2 = AddBot2;
}

//-------------------------------------------------------------------------------
// NAME         : DMAT_LcdFrameMode_OMAP32
//
// DESCRIPTION  : Setup lcd channel frame mode
//
// PARAMETERS   : FrMode        DMA_LCD_FRAMEMODE_ONEFRAME
//                              DMA_LCD_FRAMEMODE_TWOFRAME
//
// RETURN VALUE : IS_OK or NOT_OK if something fail
//
//--------------------------------------------------------------------------------
void DMAT_LcdFrameMode_OMAP32(UWORD32 FrMode)
{
LCD_CHANNEL_DESCRIPTOR_OMAP32* Chptr;

  Chptr=&(SystemDma_omap32.LcdChannel);
                
  //DMA Frame

⌨️ 快捷键说明

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