📄 blndma.c
字号:
//=============================================================// 文件名称: BLNDMA.c// 功能描述: BLNDMA相关程序// 维护记录: 2007-01-16 v1.0//=============================================================#include "SPCE3200_Register.h"#include "SPCE3200_Constant.h"/************************************************************************** * * * Function Name: BlnDmaStart_linear2linear_Dma * * * * Purposes: * * * * Descriptions: * * * * Arguments: * * src_addr : source address (28 bits) * * dest_addr : destination address (28 bits) * * trans_width : transfer width, maximum = 2048 * * trans_heigh : transfer heigh, maximum = 2048 * * transparent_mode : (0:disable, 1:enable) * * color_key : (16 bits) * * mode : (0:polling mode, 1:interrupt mode) * * * * Returns: * * * * See also: * * * **************************************************************************/void BlnDmaStart_linear2linear_Dma( unsigned int src_addr, unsigned int dest_addr, unsigned int trans_width, unsigned int trans_heigh, unsigned char transparent_mode, unsigned int color_key, unsigned char mode ){ *P_BLNDMA_SOURCEA_SA=src_addr; *P_BLNDMA_DESTINATION_SA=dest_addr; *P_BLNDMA_WIDTH_HEIGHT=(trans_heigh<<16)+trans_width; *P_BLNDMA_FILTER_PATTERN=color_key; *P_BLNDMA_ADDR_MODE=(*P_BLNDMA_ADDR_MODE&0xfffefffe); if (mode==0) { *P_BLNDMA_INT_STATUS=0x00000000; if (transparent_mode==0) { *P_BLNDMA_MODE_CTRL1=0x01000001; } else { *P_BLNDMA_MODE_CTRL1=0x01010001; } while (*P_BLNDMA_INT_STATUS==0x00000100) { // print1("BLNDMA Busy\n"); } } if (mode==1) { *P_BLNDMA_INT_STATUS=0x00010000; if (transparent_mode==0) { *P_BLNDMA_MODE_CTRL1=0x01000001; } else { *P_BLNDMA_MODE_CTRL1=0x01010001; } } }/************************************************************************** * * * Function Name: BlnDmaStart_linear2block_Dma * * * * Purposes: * * * * Descriptions: * * * * Arguments: * * src_addr : source address (28 bits) * * dest_base_addr : destination baseaddress (28 bits) * * dest_offset_x : (11 bits), maximum = 2048 * * dest_offset_y : (11 bits), maximum = 2048 * * trans_width : transfer width, maximum = 2048 * * trans_heigh : transfer heigh, maximum = 2048 * * dest_bg_width : (3 bits) * * 0 : 256 * * 1 : 320 * * 2 : 512 * * 3 : 640 * * 4 : 1024 * * 5 : 2048 * * 6,7 : reserved * * dest_bg_heigh : (3 bits) * * 0 : 240 * * 1 : 256 * * 2 : 480 * * 3 : 512 * * 4 : 1024 * * 5 : 2048 * * 6,7 : reserved * * transparent_mode : (0:disable, 1:enable) * * color_key : (16 bits) * * mode : (0:polling mode, 1:interrupt mode) * * * * Returns: * * * * See also: * * * **************************************************************************/void BlnDmaStart_linear2block_Dma( unsigned int src_addr, unsigned int dest_base_addr, unsigned int dest_offset_x, unsigned int dest_offset_y, unsigned char dest_bg_width, unsigned char dest_bg_heigh, unsigned int trans_width, unsigned int trans_heigh, unsigned char transparent_mode, unsigned int color_key, unsigned char mode ){ *P_BLNDMA_SOURCEA_SA=src_addr; *P_BLNDMA_DESTINATION_BA=dest_base_addr; *P_BLNDMA_DESTINATION_OA=(dest_offset_y<<16)+dest_offset_x; *P_BLNDMA_DESTINATION_BACKGROUND=(dest_bg_heigh<<8)+dest_bg_width; *P_BLNDMA_WIDTH_HEIGHT=(trans_heigh<<16)+trans_width; *P_BLNDMA_FILTER_PATTERN=color_key; *P_BLNDMA_ADDR_MODE=((*P_BLNDMA_ADDR_MODE|0x00010000)&0xfffffffe); if (mode==0) { *P_BLNDMA_INT_STATUS=0x00000000; if (transparent_mode==0) { *P_BLNDMA_MODE_CTRL1=0x01000001; } else { *P_BLNDMA_MODE_CTRL1=0x01010001; } } if (mode==1) { *P_BLNDMA_INT_STATUS=0x00010000; if (transparent_mode==0) { *P_BLNDMA_MODE_CTRL1=0x01000001; } else { *P_BLNDMA_MODE_CTRL1=0x01010001; } } }/************************************************************************** * * * Function Name: BlnDmaStart_block2block_Dma * * * * Purposes: * * * * Descriptions: * * * * Arguments: * * src_base_addr : source A base address (28 bits) * * src_offset_x : (11 bits), maximum = 2048 * * src_offset_y : (11 bits), maximum = 2048 * * dest_base_addr : destination base address (28 bits) * * dest_offset_x : (11 bits), maximum = 2048 * * dest_offset_y : (11 bits), maximum = 2048 * * trans_width : transfer width, maximum = 2048 * * trans_heigh : transfer heigh, maximum = 2048 * * src_bg_width/dest_bg_width : (3 bits) * * 0 : 256 * * 1 : 320 * * 2 : 512 * * 3 : 640 * * 4 : 1024 * * 5 : 2048 * * 6,7 : reserved * * src_bg_heigh/dest_bg_heigh : (3 bits) * * 0 : 240 * * 1 : 256 * * 2 : 480 * * 3 : 512 * * 4 : 1024 * * 5 : 2048 * * 6,7 : reserved * * transparent_mode : (0:disable, 1:enable) * * color_key : (16 bits) * * mode : (0:polling mode, 1:interrupt mode) * * * * Returns: * * * * See also: * * * **************************************************************************/void BlnDmaStart_block2block_Dma( unsigned int src_base_addr, unsigned int src_offset_x, unsigned int src_offset_y, unsigned char src_bg_width, unsigned char src_bg_heigh, unsigned int dest_base_addr, unsigned int dest_offset_x, unsigned int dest_offset_y, unsigned char dest_bg_width, unsigned char dest_bg_heigh, unsigned int trans_width, unsigned int trans_heigh, unsigned char transparent_mode, unsigned int color_key, unsigned char mode ){ *P_BLNDMA_SOURCEA_BA=src_base_addr; *P_BLNDMA_SOURCEA_OA=(src_offset_y<<16)+src_offset_x; *P_BLNDMA_SOURCEA_BACKGROUND=(src_bg_heigh<<8)+src_bg_width; *P_BLNDMA_DESTINATION_BA=dest_base_addr; *P_BLNDMA_DESTINATION_OA=(dest_offset_y<<16)+dest_offset_x; *P_BLNDMA_DESTINATION_BACKGROUND=(dest_bg_heigh<<8)+dest_bg_width; *P_BLNDMA_WIDTH_HEIGHT=(trans_heigh<<16)+trans_width; *P_BLNDMA_FILTER_PATTERN=color_key; *P_BLNDMA_ADDR_MODE=(*P_BLNDMA_ADDR_MODE|0x00010001); if (mode==0) { *P_BLNDMA_INT_STATUS=0x00000000; if (transparent_mode==0) { *P_BLNDMA_MODE_CTRL1=0x01000001; } else { *P_BLNDMA_MODE_CTRL1=0x01010001; } } if (mode==1) { *P_BLNDMA_INT_STATUS=0x00010000; if (transparent_mode==0) { *P_BLNDMA_MODE_CTRL1=0x01000001; } else { *P_BLNDMA_MODE_CTRL1=0x01010001; } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -