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

📄 omap30_sysdma.h

📁 有关于USB的一些主机端驱动
💻 H
📖 第 1 页 / 共 3 页
字号:
    //----------------------
  UWORD32    DestAdd;

    //DMA_CEN 
    //----------------------
  UWORD16     EltNumber;

    //DMA_CFN 
    //----------------------
  UWORD16     FrameNumber;

    //DMA_CEI 
    //----------------------
  UWORD16     EltIndex;

    //DMA_CFI 
    //----------------------
  UWORD16     FrameIndex;

}
CHANNEL_DESCRIPTOR ;


//   LCD Channel DMA descriptor structure
typedef struct
{

   //DMA_LCD_CTRL
   //--------------------
  BIT    FrameMode:1;
  BIT    FrameItIe:1;
  BIT    BusErrorItIe:1;
  BIT    Frame1ItCond:1;
  BIT    Frame2ItCond:1;
  BIT    BusErrorItCond:1;
  BIT    LcdSrc:1;

   //DMA_LCD_TOP_F1
   //-----------------------
  UWORD32    LcdTopF1;

   //DMA_LCD_BOT_F1
   //-----------------------
  UWORD32    LcdBotF1;

   //DMA_LCD_TOP_F2
   //-----------------------
  UWORD32    LcdTopF2;

   //DMA_LCD_BOT_F2
   //-----------------------
  UWORD32    LcdBotF2;


}
LCD_CHANNEL_DESCRIPTOR ;


//  Complete DMA Structure
typedef struct
{

   //Global register
   //--------------------
  BIT   Autogating_on:1;
  BIT   Free:1;

  CHANNEL_DESCRIPTOR     DmaChannel[DMA_NUMBER_OF_CHANNEL];
  LCD_CHANNEL_DESCRIPTOR LcdChannel;

}
DMA_SYSTEM_STRUCT ;

//   Macro to access the DMA REGISTERS                      -
#define DMA_ACC(global,ch_select,reg_select)      REG16((SYSDMA_BASE_ADDR | (global<<10) | (ch_select<<6) | (reg_select<<1))  )

// global values
#define  NO_GLOB_REG            0
#define  GLOB_REG               1

// initialize or verify mode
#define  INITIALIZE_MEM         1
#define  VERIFY_MEM             0

// reg_select when GLOBAL_REG
#define  DMA_GCR                  0
#define  DMA_SUB                  1

#define     DMA_FREE_RUNNING        0x1
#define     DMA_SUSPEND_RUNNING     0x0
#define     DMA_AUTOGATE_ON         0x1
#define     DMA_AUTOGATE_OFF        0x0

// reg_select when NON_GLOBAL_REG
#define  DMA_CSDP                  0x0
#define  DMA_CCR                   0x1
#define  DMA_CICR                  0x2
#define  DMA_CSR                   0x3
#define  DMA_CSSA_L                0x4
#define  DMA_CSSA_U                0x5
#define  DMA_CDSA_L                0x6
#define  DMA_CDSA_U                0x7
#define  DMA_CEN                   0x8
#define  DMA_CFN                   0x9
#define  DMA_CFI                   0xA
#define  DMA_CEI                   0xB
#define  DMA_PCNT                  0xC

// reg_select when LCD_CHANNEL
#define  DMA_LCD_CTRL              0x0
#define  DMA_LCD_TOP_F1_L          0x1
#define  DMA_LCD_TOP_F1_U          0x2
#define  DMA_LCD_BOT_F1_L          0x3
#define  DMA_LCD_BOT_F1_U          0x4
#define  DMA_LCD_TOP_F2_L          0x5
#define  DMA_LCD_TOP_F2_U          0x6
#define  DMA_LCD_BOT_F2_L          0x7
#define  DMA_LCD_BOT_F2_U          0x8

#define     DMA_WITH_RHEA           0x0
#define     DMA_WITH_API            0x1
#define     DMA_FRAME_SYNCHRONIZED 0x1
#define     DMA_ELT_SYNCHRONIZED   0x0
#define     DMA_HIGH_PRIORITY      0x1
#define     DMA_LOW_PRIORITY       0x0
#define     DMA_ENABBLE_TRANSFERT  0x1
#define     DMA_DISABLE_TRANSFERT  0x0
#define     DMA_AUTOINIT_ON        0x1
#define     DMA_AUTOINIT_OFF       0x0
#define     DMA_FORCE_FLUSH        0x1
#define     DMA_NO_FLUSH           0x0
#define     DMA_ADD_CONSTANT       0x0
#define     DMA_ADD_POSTINC        0x1
#define     DMA_ADD_SINGLE_INDEX   0x2
#define     DMA_ADD_DOUBINDEX      0x3
#define     DMA_INT_ABSENT           0
#define     DMA_INT_PRESENT          1
#define     DMA_MEMWIDTH_8           0
#define     DMA_MEMWIDTH_16          1
#define     DMA_MEMWIDTH_32          2
#define     DMA_SDRAM              0x0
#define     DMA_EMIF               0x1
#define     DMA_IMIF               0x2
#define     DMA_RHEA               0x3
#define     DMA_LOCAL              0x4
#define     DMA_RHEA_API           0x5
#define     DMA_PACKING            0x1
#define     DMA_NO_PACKING         0x0
#define     DMA_SINGLE_BURST       0x0
#define     DMA_BURST_4            0x2
#define     DMA_BURST_8            0x3
#define     DMA_NOT_SYNC           0x0
#define     DMA_SYNC_1             0x1
#define     DMA_SYNC_2             0x2
#define     DMA_SYNC_3             0x3
#define     DMA_SYNC_4             0x4
#define     DMA_SYNC_5             0x5
#define     DMA_SYNC_7             0x7
#define     DMA_LCD_FRAMEMODE_ONEFRAME  0
#define     DMA_LCD_FRAMEMODE_TWOFRAME  1

//-------------------------------------------------------------------------------
//
//  FUNCTIONS
//
//-------------------------------------------------------------------------------

//-------------------------------------------------------------------------------
// NAME         : DMA_SetupSystemDma       
// DESCRIPTION  : Init the SystemDma Structure and Set The debugging mode
// PARAMETERS   : WithOrWithoutFree       DMA_FREE_RUNNING
//                                        DMA_SUSPEND_RUNNING 
// RETURN VALUE : None
//--------------------------------------------------------------------------------
void DMA_SetupSystemDma(BOOL WithOrWithoutFree );

//-------------------------------------------------------------------------------
// NAME         : DMA_SetupChannel       
// DESCRIPTION  : Copy the channel structure at the right place in the registers of the
//                specified 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_LCD 
// RETURN VALUE : None
//--------------------------------------------------------------------------------
void DMA_SetupChannel(UWORD16 ChannelNumber);

//-------------------------------------------------------------------------------
// NAME         : DMA_ReadGlobalReg       
// DESCRIPTION  : Read the contents of the global register
// PARAMETERS   : None
// RETURN VALUE : None
//--------------------------------------------------------------------------------
void DMA_ReadGlobalReg(GLOBAL_REGISTER* Global);

//-------------------------------------------------------------------------------
// NAME         : DMA_GetCondBitsInterrupt       
// DESCRIPTION  : Get back the condition bits of the specified 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_LCD
// RETURN VALUE : None
//--------------------------------------------------------------------------------
void DMA_GetCondBitsInterrupt(UWORD16 ChannelNumber);

//-------------------------------------------------------------------------------
// NAME         : DMA_EnableChannel       
// DESCRIPTION  : Enable the specified 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_LCD 
// RETURN VALUE : None
//--------------------------------------------------------------------------------
void DMA_EnableChannel(UWORD16 ChannelNumber);

//-------------------------------------------------------------------------------
// NAME         : DMA_EnableIntFlags
// DESCRIPTION  : Setup interrupt flags in the channel structure specified
// 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
// PARAMETERS   : TimeoutIntEnable    ENABLE or DISABLE
//                DropIntEnable               "
//                HalfFrameIntEnable          "
//                FrameIntEnable              "
//                LastFrameIntEnable          "
//                BlockIntEnable              "
// RETURN VALUE : IS_OK or NOT_OK if something fail
//--------------------------------------------------------------------------------
void DMA_EnableIntFlags(UWORD16 ChannelNumber,
                        UWORD32 TimeoutIntEnable,
                        UWORD32 DropIntEnable,
                        UWORD32 HalfFrameIntEnable,
                        UWORD32 FrameIntEnable,
                        UWORD32 LastFrameIntEnable,
                        UWORD32 BlockIntEnable);

//-------------------------------------------------------------------------------
// NAME         : DMA_EnableLcdIntFlags
// DESCRIPTION  : Setup interrupt flags in the channel structure specified
// PARAMETERS   : FrameItIe          ENABLE or DISABLE
//                BusErrorItIe                "
// RETURN VALUE : IS_OK or NOT_OK if something fail
//--------------------------------------------------------------------------------

void DMA_EnableLcdIntFlags(UWORD32 FrameItIe,
                           UWORD32 BusErrorItIe);
                           
//-------------------------------------------------------------------------------
// NAME         : DMA_LcdFrameMode
//
// 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 DMA_LcdFrameMode(UWORD32 FrMode);                     

//-------------------------------------------------------------------------------
// NAME         : DMA_LcdConfigPort
//
// DESCRIPTION  : Setup lcd channel port configuration
//
// PARAMETERS   : SrcPort          DMA_LCD_SDRAM_SRC  
//                                 DMA_LCD_IMIF_SRC   
//
//                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 DMA_LcdConfigPort(UWORD32 SrcPort,
			   UWORD32 AddTop1,
			   UWORD32 AddBot1,
			   UWORD32 AddTop2,
			   UWORD32 AddBot2);
			   
#endif /* _OMAP30_SYSDMA__H_ */

⌨️ 快捷键说明

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