亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? coreb_main.c

?? BlackFin DSP(ADSP) LCD 文字overlay 顯示源碼
?? C
字號:
/*********************************************************************************

Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved. 

This software is proprietary and confidential.  By using this software you agree
to the terms of the associated Analog Devices License Agreement.  


Please refer to the "README.txt" file for a description of this example.

*********************************************************************************/


/*********************************************************************

Include files

*********************************************************************/

#include <services/services.h>
#include <drivers/adi_dev.h>
#include <drivers/adi_ppi.h>
#include <ezkitutilities.h>
#include "main.h"


/*********************************************************************

User configurations:

Callbacks can be either "live" meaning they happen at hardware interrupt
time, or "deferred" meaning that the Deferred Callback Service is used
to make callbacks at a lower priority interrupt level.  Deferred 
callbacks usually allow the system to process data more efficiently with
lower interrupt latencies.  

The macro below can be used to toggle between "live" and "deferred"
callbacks.  All drivers and system services that make callbacks into an 
application are passed a handle to a callback service.  If that handle
is NULL, then live callbacks are used.  If that handle is non-NULL, 
meaning the handle is a real handle into a deferred callback service, 
then callbacks are deferred using the given callback service.  

The other user controlled macro is the USE_LOOPBACK macro.  When enabled
the example will setup the buffer chains to use the chained with loopback
mode rather than the chained mode.  When loopback is enabled, buffers
are continually reused and never have to be requeued.  When loopback
is disabled, buffers must be requeued by the application or else the 
driver will starve for data.  

*********************************************************************/
#define USE_LOOPBACK			// enabled chained with loopback

/*********************************************************************

Enumerations and defines

*********************************************************************/

#define NUM_BUFFERS (30)		// frame change rate = (NUM_BUFFERS/30)/second

/*********************************************************************

Static data

*********************************************************************/

// variable for synchronizing cores
extern testset_t adi_pwr_lockvar;

// Two areas in external memory that will each hold an frame that will be
// sent out to the LCD, defined in sml3.dlb
extern char PingFrame[];
extern char PongFrame[];

// Area in memory which holds the 24-bit BMP file
extern char Image_BMP[];

// Overlay String
char text_buf[32] = " 0:00";

// Create two buffer chains.  One chain will be used for one of the frames,
// the other chain for the other frame.
ADI_DEV_2D_BUFFER PingBuffer[NUM_BUFFERS];
ADI_DEV_2D_BUFFER PongBuffer[NUM_BUFFERS];

// DMA Manager data (base memory + memory for 1 DMA channel)
static u8 DMAMgrData[ADI_DMA_BASE_MEMORY + (ADI_DMA_CHANNEL_MEMORY * 1)];

// Deferred Callback Manager data (memory for 1 service plus 4 posted callbacks)
#if defined(USE_DEFERRED_CALLBACKS)
static u8 DCBMgrData[ADI_DCB_QUEUE_SIZE + (ADI_DCB_ENTRY_SIZE)*4];
#endif

// Device Manager data (base memory + memory for 1 device)
static u8 DevMgrData[ADI_DEV_BASE_MEMORY + (ADI_DEV_DEVICE_MEMORY * 1)];

// Handle to the PPI driver
static ADI_DEV_DEVICE_HANDLE 	DriverHandle;


/*********************************************************************

	Function:	ExceptionHandler
			HWErrorHandler

	Description:	We should never get an exception or hardware error, 
			but just in case we'll catch them and simply turn 
			on all the LEDS should one ever occur.

*********************************************************************/

static ADI_INT_HANDLER(ExceptionHandler)	// exception handler
{
	// passing a 1 to ezErrorCheck forces the LED's to indicate an error condition
	ezErrorCheck(1);
	return(ADI_INT_RESULT_PROCESSED);
}
		
	
static ADI_INT_HANDLER(HWErrorHandler)		// hardware error handler
{
	// passing a 1 to ezErrorCheck forces the LED's to indicate an error condition
	ezErrorCheck(1);
	return(ADI_INT_RESULT_PROCESSED);
}



/*********************************************************************

	Function:	Callback

	Description:	Each type of callback event has it's own unique ID 
			so we can use a single callback function for all 
			callback events.  The switch statement tells us 
			which event has occurred.
					
			In the example, we'll get a callback when the PPI 
			has completed processing of the last buffer in the 
			Ping and Pong buffer chains.  If loopback is enabled, 
			the device driver will automatically reuse the buffer 
			chains so there's really nothing to do, in fact, 
			generating the callback	in the first place is 
			unnecessary.  However, if loopback is not used, the 
			callback function must requeue the chain that just 
			finished in order to keep the device driver saturated 
			with data.  
										
			Note that in the device driver model, in order to 
			generate a callback for buffer completion, the 
			CallbackParameter of the buffer must be set to a non-NULL 
			value.  That non-NULL value is then passed to the 
			callback function as the pArg parameter.  In this example,
			the CallbackParameter is set to be the address of the 
			first buffer in the chain.  That allows	the callback 
			function to requeue the whole chain since even though 
			the callback was generated by the last buffer in the chain,
			the pArg parameter contains the address of the first buffer
			in the chain.  See the code in the "main()" function 
			below for more information.  

*********************************************************************/


static void Callback(
	void *AppHandle,
	u32  Event,
	void *pArg)
{
	
	ADI_DEV_BUFFER *pBuffer;			// pointer to the buffer that was processed
	
	// CASEOF (event type)
	switch (Event) {
		
		// CASE (buffer processed)
		case ADI_DEV_EVENT_BUFFER_PROCESSED:
		
			// when the buffer chain was created, the CallbackParameter value for the buffer
			// that was generating the callback was set to be the address of the first buffer
			// in the chain.  So here in the callback that value is passed in as the pArg
			// parameter.  
			pBuffer = (ADI_DEV_BUFFER *)pArg;
			
			// if loopback is enabled, the driver will continually reuse the buffers so there's
			// really nothing to do.  in fact, we really don't need to generate callbacks at all
			// if loopback is enabled.  if loopback is disabled though, we need to requeue the 
			// the buffer chain that just finished
#if defined(USE_LOOPBACK)
#else
			ezErrorCheck(adi_dev_Write(DriverHandle, ADI_DEV_2D, pArg));
#endif
			break;
			
		// CASE (an error)
		case ADI_DEV_EVENT_DMA_ERROR_INTERRUPT:
		case ADI_PPI_EVENT_ERROR_INTERRUPT:
		
			// turn on all LEDs and wait for help
			ezTurnOnAllLEDs();
			while (1) ;
			
	// ENDCASE
	}
	
}

/****************************************************************************
  Function:	Init_Timers	
				
  Set up timers for PWM mode to control HSYNC and VSYNC.  Do notenale them here.
******************************************************************************/

void InitTimers(void)
{
	//HSYNC
	//Setting up command table for Timer 10
	ADI_TMR_GP_CMD_VALUE_PAIR Timer10ConfigurationTable [] = {
		{ ADI_TMR_GP_CMD_SET_TIMER_MODE,			(void *)0x01			},
		{ ADI_TMR_GP_CMD_SET_COUNT_METHOD,			(void *)TRUE			},
		{ ADI_TMR_GP_CMD_SET_INPUT_SELECT,			(void *)TRUE			},
		{ ADI_TMR_GP_CMD_SET_CLOCK_SELECT,			(void *)TRUE			},
		{ ADI_TMR_GP_CMD_RUN_DURING_EMULATION,		(void *)TRUE			},
		{ ADI_TMR_GP_CMD_SET_PERIOD,				(void *)800				},
		{ ADI_TMR_GP_CMD_SET_WIDTH, 				(void *)96				},
		{ ADI_TMR_GP_CMD_END,						NULL					}, 
	};
	//VSYNC	
	//Setting up command table for Timer 11
	ADI_TMR_GP_CMD_VALUE_PAIR Timer11ConfigurationTable [] = {
		{ ADI_TMR_GP_CMD_SET_TIMER_MODE,			(void *)0x01			},
		{ ADI_TMR_GP_CMD_SET_COUNT_METHOD,			(void *)TRUE			},
		{ ADI_TMR_GP_CMD_SET_INPUT_SELECT,			(void *)TRUE			},
		{ ADI_TMR_GP_CMD_SET_CLOCK_SELECT,			(void *)TRUE			},
		{ ADI_TMR_GP_CMD_RUN_DURING_EMULATION,		(void *)TRUE			},
		{ ADI_TMR_GP_CMD_SET_PERIOD,				(void *)420000			},
		{ ADI_TMR_GP_CMD_SET_WIDTH, 				(void *)1600 			},
		{ ADI_TMR_GP_CMD_END,						NULL					}, 
	};
	//Open Timer 10 for access
	adi_tmr_Open(ADI_TMR_GP_TIMER_10);
	//Program timer 10 with Timer 10 table
	adi_tmr_GPControl(ADI_TMR_GP_TIMER_10, ADI_TMR_GP_CMD_TABLE, Timer10ConfigurationTable);
	//Open Timer 11 for access
	adi_tmr_Open(ADI_TMR_GP_TIMER_11);
	//Program timer 11 with Timer 11 table
	adi_tmr_GPControl(ADI_TMR_GP_TIMER_11, ADI_TMR_GP_CMD_TABLE, Timer11ConfigurationTable);
}


/*********************************************************************
*
*	Function:	main
*
*********************************************************************/


void main(void) {
	int COUNTER_S = 0;
	int COUNTER_M = 0;
	
	ADI_DEV_CMD_VALUE_PAIR ConfigurationTable [] = {	// table of PPI driver configuration values
		{ ADI_DEV_CMD_SET_DATAFLOW_METHOD, 		(void *)ADI_DEV_MODE_CHAINED_LOOPBACK },
		{ ADI_PPI_CMD_SET_CONTROL_REG,			(void *)0xB81E		},
		{ ADI_PPI_CMD_SET_DELAY_COUNT_REG,		(void *)143			},
		{ ADI_PPI_CMD_SET_TRANSFER_COUNT_REG,	(void *)639			},
		{ ADI_DEV_CMD_SET_STREAMING,			(void *)TRUE		},
		{ ADI_DEV_CMD_END,						NULL				},
	};

	ADI_DCB_HANDLE			DCBManagerHandle;	// handle to the callback service
	ADI_DMA_MANAGER_HANDLE 	DMAManagerHandle;	// handle to the DMA Manager
	ADI_DEV_MANAGER_HANDLE 	DeviceManagerHandle;	// handle to the Device Manager
	ADI_DEV_2D_BUFFER 		Buffer2D;			// buffer to be sent to PPI Driver
	u32 					ResponseCount;		// response counter
	int						i;					// counter
	
	// Initialize the power management module
	ADI_PWR_COMMAND_PAIR pwrConfig[] = {
		{ ADI_PWR_CMD_SET_EZKIT,   (void*)ADI_PWR_EZKIT_BF561_600MHZ },
		{ ADI_PWR_CMD_SET_AUTO_SYNC_ENABLED, NULL },								
		{ ADI_PWR_CMD_SET_SYNC_LOCK_VARIABLE, (void*)&adi_pwr_lockvar },
		{ ADI_PWR_CMD_END, 0}
	};
	ezErrorCheck(adi_pwr_Init(pwrConfig));
	
	// Initialize buttons and LED's
	ezInit();
	ezTurnOnAllLEDs();

	// initialize the Interrupt Manager and hook the exception and hardware error interrupts
	ezErrorCheck(adi_int_Init(NULL, 0, &ResponseCount, NULL));

	ezErrorCheck(adi_int_CECHook(3, ExceptionHandler, NULL, FALSE));
	ezErrorCheck(adi_int_CECHook(5, HWErrorHandler, NULL, FALSE));
	
	DCBManagerHandle = NULL;

	// initialize the DMA Manager
	ezErrorCheck(adi_dma_Init(DMAMgrData, sizeof(DMAMgrData), &ResponseCount, &DMAManagerHandle, NULL));
	
	// initialize the Device Manager
	ezErrorCheck(adi_dev_Init(DevMgrData, sizeof(DevMgrData), &ResponseCount, &DeviceManagerHandle, NULL));
	
	// Initialize Canvas
	ezErrorCheck(Overlay_init(PingFrame));
	
	// initialize the two frames and fill them with 16-bit versions of the 24-bit BMP image
	ezErrorCheck(Create_Data(PingFrame,Image_BMP));
	ezErrorCheck(Overlay_main(PingFrame,text_buf));
	
	ezErrorCheck(Create_Data(PongFrame,Image_BMP));
	ezErrorCheck(Overlay_main(PongFrame,text_buf));
	
	// create a buffer chain that points to the PingFrame.  Each buffer points to the same PingFrame
	// so the PingFrame will be displayed NUM_BUFFERS times.  NUM_BUFFERS is sized to 
	// keep the display busy for 1 second.  Place a callback on only the last buffer
	// in the chain.  Make the CallbackParameter (the value that gets passed to the callback
	// function as the pArg parameter) point to the first buffer in the chain.  This way, when
	// the callback goes off, the callback function can requeue the whole chain if the loopback
	// mode is off.  
	for (i = 0; i < NUM_BUFFERS; i++) {
		PingBuffer[i].Data = PingFrame;
		PingBuffer[i].ElementWidth = 2;
		PingBuffer[i].XCount = 640;
		PingBuffer[i].XModify = 2;
		PingBuffer[i].YCount = 525;
		PingBuffer[i].YModify = 2;
		PingBuffer[i].CallbackParameter = NULL;
		PingBuffer[i].pNext = &PingBuffer[i + 1];
	}
	PingBuffer[NUM_BUFFERS - 1].CallbackParameter = &PingBuffer[0];
	PingBuffer[NUM_BUFFERS - 1].pNext = NULL;
	
	// now do the same for the Pong buffers
	for (i = 0; i < NUM_BUFFERS; i++) {
		PongBuffer[i].Data = PongFrame;
		PongBuffer[i].ElementWidth = 2;
		PongBuffer[i].XCount = 640;
		PongBuffer[i].XModify = 2;
		PongBuffer[i].YCount = 525;
		PongBuffer[i].YModify = 2;
		PongBuffer[i].CallbackParameter = NULL;
		PongBuffer[i].pNext = &PongBuffer[i + 1];
	}
	PongBuffer[NUM_BUFFERS - 1].CallbackParameter = &PongBuffer[0];
	PongBuffer[NUM_BUFFERS - 1].pNext = NULL;
	
	// initialize the Timer manager
	InitTimers();
	
	// open the PPI driver for output
	ezErrorCheck(adi_dev_Open(DeviceManagerHandle, &ADIPPIEntryPoint, 1, NULL, &DriverHandle, ADI_DEV_DIRECTION_OUTBOUND, DMAManagerHandle, DCBManagerHandle, Callback));
		
	// configure the PPI driver with the values from the configuration table
   	ezErrorCheck(adi_dev_Control(DriverHandle, ADI_DEV_CMD_TABLE, ConfigurationTable));
		
	// give the device the Ping and Pong buffer chains
	ezErrorCheck(adi_dev_Write(DriverHandle, ADI_DEV_2D, (ADI_DEV_BUFFER *)PingBuffer));
	ezErrorCheck(adi_dev_Write(DriverHandle, ADI_DEV_2D, (ADI_DEV_BUFFER *)PongBuffer));
	
	// enable data flow
	ezErrorCheck(adi_dev_Control(DriverHandle, ADI_DEV_CMD_SET_DATAFLOW, (void *)TRUE));
	
	//enable timer 10 and timer 11
	adi_tmr_GPGroupEnable(ADI_TMR_GP_TIMER_10 | ADI_TMR_GP_TIMER_11,TRUE);		
	
	while (1) {
		idle();
		if(COUNTER_S <=9){
			sprintf ( text_buf,"%2i:0%i",COUNTER_M, COUNTER_S);
		}else{
			sprintf ( text_buf,"%2i:%i",COUNTER_M, COUNTER_S);
		}
		if(COUNTER_S == 0) sprintf ( text_buf,"%2i:00",COUNTER_M);
		ezErrorCheck(Overlay_main(PingFrame,text_buf));

		idle();
		if(COUNTER_S <=9){
			sprintf ( text_buf,"%2i:0%i",COUNTER_M, COUNTER_S);
		}else{
			sprintf ( text_buf,"%2i:%i",COUNTER_M, COUNTER_S);
		}
		if(COUNTER_S == 0) sprintf ( text_buf,"%2i:00",COUNTER_M);
		ezErrorCheck(Overlay_main(PongFrame,text_buf));
		
		if(COUNTER_S == 59)
		{
			COUNTER_S = 0;
			COUNTER_M++;
		}else{
			COUNTER_S++;
		}
	}
}






?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美美女黄视频| 亚洲免费成人av| 亚洲欧美一区二区三区极速播放| 亚洲亚洲人成综合网络| 国产一区二区美女诱惑| 欧美日韩一区三区四区| 日本一区二区三区在线不卡| 美女在线一区二区| 欧美日韩国产影片| 亚洲精品第一国产综合野| 成人高清视频在线| 久久精品一区蜜桃臀影院| 蜜臀av性久久久久蜜臀aⅴ四虎 | 亚洲免费看黄网站| 国产精品2024| 精品国产一区二区三区久久影院| 亚洲自拍偷拍网站| 91免费观看视频| 欧美国产精品中文字幕| 国产一区二区伦理片| 91精品国产一区二区三区蜜臀| 一二三四社区欧美黄| 99久久婷婷国产精品综合| 亚洲国产成人在线| 成人动漫视频在线| 综合电影一区二区三区 | 欧美精品乱码久久久久久按摩| 亚洲青青青在线视频| 国产成人免费在线| 国产亚洲一区二区在线观看| 国产老女人精品毛片久久| 久久婷婷久久一区二区三区| 捆绑调教一区二区三区| 欧美va亚洲va国产综合| 国产呦萝稀缺另类资源| 国产日韩精品一区二区浪潮av| 粉嫩绯色av一区二区在线观看| 国产三级精品三级在线专区| 国产成人精品午夜视频免费| 中文字幕av在线一区二区三区| 99久久国产综合色|国产精品| 国产精品白丝在线| 色呦呦国产精品| 亚洲大片一区二区三区| 7777精品伊人久久久大香线蕉超级流畅 | 欧美日韩国产高清一区二区三区| 午夜精品久久久久久久| 日韩欧美中文字幕精品| 国内不卡的二区三区中文字幕| 欧美国产综合一区二区| 一本到一区二区三区| 亚洲1区2区3区4区| 亚洲精品一区二区三区福利| 成人精品鲁一区一区二区| 亚洲欧美一区二区三区孕妇| 91麻豆精品国产无毒不卡在线观看| 毛片基地黄久久久久久天堂| 国产亚洲欧美日韩在线一区| 91美女片黄在线观看91美女| 亚洲成人综合网站| 精品国产三级a在线观看| 国产精品一区二区在线观看不卡 | 91精品啪在线观看国产60岁| 蓝色福利精品导航| 国产精品久久毛片av大全日韩| 欧美探花视频资源| 韩国毛片一区二区三区| 尤物av一区二区| 2021国产精品久久精品| 色8久久精品久久久久久蜜| 捆绑变态av一区二区三区| 国产精品国产三级国产普通话99| 欧美日韩精品三区| 国产成人亚洲综合a∨婷婷图片| 亚洲在线中文字幕| 日本一区二区免费在线| 欧美人xxxx| 99精品在线免费| 国产精品一区二区三区乱码| 亚洲综合色婷婷| 欧美国产日韩在线观看| 欧美一区二区三区四区高清| 波多野结衣亚洲一区| 激情深爱一区二区| 亚洲国产精品欧美一二99| 国产精品国产三级国产aⅴ原创| 日韩一二三四区| 欧洲另类一二三四区| 成人国产视频在线观看| 国产在线精品一区二区夜色| 亚洲bt欧美bt精品| 亚洲欧美国产高清| 日本一区二区视频在线| 精品国内二区三区| 在线播放91灌醉迷j高跟美女 | 国产一区999| 蜜桃一区二区三区在线观看| 亚洲一卡二卡三卡四卡五卡| 国产精品久久福利| 中文字幕精品—区二区四季| 26uuu精品一区二区| 日韩欧美精品在线| 日韩天堂在线观看| 欧美日韩在线播| 91国产免费观看| 色婷婷综合久久久中文一区二区| www.欧美日韩| 成人av资源在线| 91在线云播放| 色www精品视频在线观看| www.亚洲精品| 色综合天天综合在线视频| 欧美日韩一区二区在线观看视频| 99精品欧美一区二区三区小说| 丰满放荡岳乱妇91ww| 成人一区在线观看| 不卡av在线免费观看| 91丨porny丨户外露出| 91麻豆123| 欧美日韩卡一卡二| 日韩一区二区视频| 日韩欧美你懂的| 久久九九久久九九| 国产精品久久久99| 亚洲男人天堂一区| 午夜成人在线视频| 极品少妇一区二区三区精品视频| 麻豆国产一区二区| 国产91清纯白嫩初高中在线观看| 99久久综合精品| 日本久久一区二区三区| 欧美剧情电影在线观看完整版免费励志电影 | 91精品国产色综合久久ai换脸| 91麻豆精品国产91久久久 | 亚洲四区在线观看| 午夜欧美电影在线观看| 老司机精品视频在线| 国产91精品一区二区麻豆网站| 99久久精品费精品国产一区二区| 欧洲精品在线观看| 精品国产在天天线2019| 中文字幕一区二区5566日韩| 亚洲欧美电影院| 精品在线免费观看| 99这里只有久久精品视频| 欧美日韩激情在线| 国产亚洲综合av| 亚洲一区二区三区四区在线免费观看| 日韩不卡一区二区| 99久免费精品视频在线观看 | 国产欧美日韩综合| 亚洲电影第三页| 国产黑丝在线一区二区三区| 91美女视频网站| 久久久久久久久久久电影| 亚洲国产精品久久久男人的天堂| 久久精品国产在热久久| 91色九色蝌蚪| 久久久久国产成人精品亚洲午夜| 亚洲女同一区二区| 韩国av一区二区| 欧美日韩一区二区不卡| 欧美韩国日本综合| 久久99蜜桃精品| 欧美在线三级电影| 国产精品网站一区| 经典三级一区二区| 欧美日本不卡视频| 亚洲欧美偷拍另类a∨色屁股| 欧美日韩极品在线观看一区| 国产欧美日本一区二区三区| 五月综合激情婷婷六月色窝| 成人小视频免费在线观看| 欧美一区二区三区人| 一区二区三区精品在线| 高清成人免费视频| 精品国产一区二区三区忘忧草| 亚洲午夜久久久久久久久电影网 | 91精品免费观看| 亚洲男同性恋视频| 99在线精品视频| 中文成人综合网| 国产成人精品免费在线| 2021国产精品久久精品| 日本欧美肥老太交大片| 欧美日韩国产另类不卡| 亚洲最新视频在线观看| 99视频超级精品| 国产精品二三区| 91在线观看污| 亚洲欧美色综合| 91蜜桃免费观看视频| 中文字幕一区二区三区四区不卡| 国产99久久久国产精品潘金| 亚洲精品一区二区三区精华液| 久久电影网站中文字幕| 欧美mv日韩mv亚洲| 激情五月播播久久久精品| 26uuu成人网一区二区三区| 久久91精品国产91久久小草|