gdmatest_omap32.h

来自「OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI」· C头文件 代码 · 共 508 行 · 第 1/2 页

H
508
字号
//                                    DMA_OCPT2    
//                                    DMA_RHEA_API 
//                                    
//                   SrcAdd           Address of the source
//
//                   DestPort         see SrcPort
//
//                   DestAdd          Address of the destination
//
// RETURN VALUE : IS_OK or NOT_OK if something fail
//
//--------------------------------------------------------------------------------
void DMAT_ConfigPort_OMAP32( UWORD32 ChannelNumber,
			 UWORD32 SrcPort,
			 UWORD32 SrcAdd,
			 UWORD32 DestPort,
			 UWORD32 DestAdd);

//-------------------------------------------------------------------------------
// NAME         : DMATEST_Transfer_OMAP32       
//
// DESCRIPTION  : Prepare the data in the source and the destination of the DMA transfer
//                then launch the transfer.
//
// 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_OMAP32   
//
// RETURN VALUE : IS_OK or NOT_OK if something fail
//
//--------------------------------------------------------------------------------
BOOL DMAT_Transfert_OMAP32( UWORD16 ChannelNumber );

//-------------------------------------------------------------------------------
// 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);

//-------------------------------------------------------------------------------
// 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);
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);
//-------------------------------------------------------------------------------
// NAME         : DMAT_PatternFill
//
// DESCRIPTION  : Fills a buffer with an incremental pattern
//
// PARAMETERS   :  UWORD32 start_address
//                 UWORD32 length    -- size in elements of the buffer to be filled
//                 UWPRD32 pattern   -- starting pattern
//                 UWORD32 increment -- increment after filling each element
//                 UWORD8 size       -- size of the element (can be the following types)
//                                   -- DMA_TYPE_32_BITS, DMA_TYPE_16_BITS,DMA_TYPE_8_BITS
//               
// RETURN VALUE : None
//
//--------------------------------------------------------------------------------
void  DMAT_PatternFill (UWORD32 start_address, 
                          UWORD32 length,
                          UWORD32 pattern, 
                          UWORD32 increment, 
                          UWORD8 size);

//-------------------------------------------------------------------------------
// NAME         : DMAT_CheckData
//
// DESCRIPTION  : Check a buffer for an incremental pattern
//
// PARAMETERS   :  UWORD32 start_address
//                 UWORD32 length    -- size in elements of the buffer to be checked
//                 UWPRD32 pattern   -- starting pattern
//                 UWORD32 increment -- increment after comparing an element
//                 UWORD8 size       -- size of the element (can be the following types)
//                                   -- DMA_TYPE_32_BITS, DMA_TYPE_16_BITS,DMA_TYPE_8_BITS
//               
// RETURN VALUE : -1 if the check fails, 0 otherwise
//
//--------------------------------------------------------------------------------
int  DMAT_CheckData   (UWORD32 start_address, 
                          UWORD32 length,
                          UWORD32 pattern, 
                          UWORD32 increment, 
                          UWORD8 size);




void DMAT_ConfigureRheaMemTransfert_OMAP32(UWORD16 ChannelNumb,
        UWORD32 SrcPort, // DMA_EMIFF,DMA_EMIFS,DMA_OCPT1,DMA_RHEA,DMA_OCPT2,DMA_RHEA_API           
        UWORD32 SrcAdd,
        UWORD32 DestPort, // DMA_EMIFF,DMA_EMIFS,DMA_OCPT1,DMA_RHEA,DMA_OCPT2,DMA_RHEA_API           
        UWORD32 DestAdd, 
        UWORD8  RheaPerifSize,    // DMA_TYPE_8_BITS,DMA_TYPE_16_BITS
        UWORD16 LengthInByte,
        UWORD8  dir_sync_numb);

void DMAT_ConfigureRheaMemTransfertFrameMode_OMAP32(
        UWORD16 ChannelNumb,
        UWORD32 SrcPort, UWORD32 SrcAdd,
        UWORD32 DestPort, UWORD32 DestAdd, 
        UWORD8  RheaPerifSize,  // DMA_TYPE_8_BITS,DMA_TYPE_16_BITS
        UWORD16 FrameLengthInByte,
        UWORD16 NumberOfFrame,
        UWORD8  dir_sync_numb);

//-------------------------------------------------------------------------------
// NAME         : DMAT_ConfigureRheaMemTransfertFrameMode_double_index_add_OMAP32
// DESCRIPTION  : Configure a dma transfer synchronised (on element) 
//                between Rhea Perif -> Memory or Memory -> Rhea Perif
//                in multiframe mode with double index addressing mode
//                Enable  block it (end of transfer it)
// 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   //
//                   SrcPort          	DMA_SDRAM    
//                                    	DMA_EMIF     
//                                    	DMA_IMIF     
//                                    	DMA_RHEA     
//                                    	DMA_LOCAL    
//                                    	DMA_RHEA_API 
//                   SrcAdd           	Address of the source
//                   DestPort         	see SrcPort
//                   DestAdd          	Address of the destination
//                   RheaPerifSize  	DMA_TYPE_8_BITS,DMA_TYPE_16_BITS,DMA_TYPE_32_BITS
//                   FrameLengthInByte size in byte of the frame
//                   NumberOfFrame   	number of frame
//                   dir_sync_numb   	No synchro of dma request
//                   Dst_frame_index    Destination frame index
//                   Dst_elemt_index    Destination element index
//                   Src_frame_index    Source frame index
//                   Src_elemt_index    Source element index
//                   
// RETURN VALUE : None
//--------------------------------------------------------------------------------
void DMAT_ConfigureRheaMemTransfertFrameMode_double_ind_OMAP32(
              UWORD16 ChannelNumb, 
					    UWORD32 SrcPort, 
					    UWORD32 SrcAdd,
					    UWORD32 DestPort, 
					    UWORD32 DestAdd,
					    UWORD8  RheaPerifSize, 
					    UWORD16 FrameLengthInByte,
					    UWORD16 NumberOfFrame,
					    UWORD8  dir_sync_numb,
					    UWORD16 Dst_frame_index,
					    UWORD16 Dst_elemt_index,
					    UWORD16 Src_frame_index,
					    UWORD16 Src_elemt_index);
					    
//-------------------------------------------------------------------------------
// NAME         : DMAT_ConfigureRheaMemTransfertPacketMode_OMAP32
// DESCRIPTION  : Configure a dma transfer synchronised on Packet Transfer(Sub frame transfer)
// 
//              IF 	 DMA_CCR.OMAP_3_1_Compatible_disable = '1' 
//           AND DMA_CCR.sync /= "00000" 
//           AND DMA_CCR.fs = '1' 
//           AND DMA_CCR2.bs = '1'
//		THEN
//		                  (DMA Logical Channel is in Packet Synchronized Transfer Mode)
//        IF DMA_CCR2 [8] = '1' THEN
//                     	Number_of_Element_in_Packet <= DMA_CSFI [15:0]
//        ELSE
//                      	Number_of_Element_in_Packet <= DMA_CDFI [15:0]
//  NOTES:
// 1)	DMA Packet_Data_Size for each DMA Request
// Packet_Data_Size = Number_of_Element_in_Packet * Element_Size  
//                              = Peripheral_FIFO_size
//
//   If DMA Packet_Data_Size is aligned on DMA Channel Block_Data_Size boundary,
//      Then DMA will transfer the last data in Channel Block Boundary, and stop at block     boundary for the last Packet_DMA Request.
// 2)	DMA Packet_Data_Transfer is not affect DMA Channel Capabilities of  pack, burst, preempting, interleave 
// If DMA Channel packet/burst access across Packet Boundary, Then DMA Hardware will automatically split this Pack/Burst access into a multiple smaller accesses, which will be aligned on Packet Boundary. Otherwise, DMA will transfer data as usual pack/burst access. Burst will not cross the frame boundary.
// 3)	DMA Packet_Data_Transfer is available for all Logical Channel (LCH-P, LCH-PD, LCH-2D) with Hardware Synchronized Capability in OMAP_3.3 GDMA Programming Model, not in OMAP_3.1 GDMA Programming Model.
// 4)   IF number of Element in packet = 0, Then DMA Hardware will automatically assign to 1.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DMAT_ConfigureRheaMemTransfertPacketMode_OMAP32 (
  UWORD16 ChannelNumb,
  UWORD32 SrcPort,
  UWORD32 SrcAdd,
  UWORD32 DestPort,
  UWORD32 DestAdd,
  UWORD8  RheaPerifSize,
  UWORD16 FrameLengthInByte,
  UWORD16 NumberOfFrame,
  UWORD16 Number_of_Element_in_Packet,
  UWORD8  dir_sync_numb);					    

#endif

⌨️ 快捷键说明

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