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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? streaming.c

?? ADI公司blackfin DSP開發(fā)板BF533 EZ-KIT LITE附帶的全部原代碼
?? C
字號:
/*********************************************************************************

Copyright(c) 2004 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.  

$RCSfile: Streaming.c,v $
$Revision: 1.2 $
$Date: 2007/03/28 17:51:22 $

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


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

Include files

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

#include <services\services.h>				// system services
#include <drivers\adi_dev.h>				// device manager includes
#include <drivers\ppi\adi_ppi.h>			// ppi driver includes

#include "ezkitutilities.h"	// EZ-Kit utilities
#include "adi_itu656.h"		// ITU656 utilities


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

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_DEFERRED_CALLBACKS	// enables deferred callbacks

//#define USE_LOOPBACK				// enabled chained with loopback



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

Enumerations and defines

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

// ADSP-BF533/537 have only 1 PPI called PPI0
// ADSP-BF561 has 2, PPI0 connected to video decoder, PPI1 to video encoder
#if defined(__ADSPBF561__)
#define ENCODER_PPI (1)
#else
#define ENCODER_PPI (0)
#endif


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

// color patterns
static u8 black[]     = {0x80,0x10,0x80,0x10};	// Black pixel ycbcr format
static u8 blue[]      = {0xF0,0x29,0x6E,0x29};    // Blue pixel ycbcr format
static u8 red[]       = {0x5A,0x51,0xF0,0x51};    // Red pixel ycbcr format
static u8 megenta[]   = {0xCA,0x6A,0xDE,0x6A};	// Megenta pixel ycbcr format
static u8 green[]     = {0x36,0x91,0x22,0x91};	// Green pixel ycbcr format
static u8 cyan[]      = {0xA6,0xAA,0x10,0xAA};    // Cyan pixel ycbcr format
static u8 yellow[]    = {0x10,0xD2,0x92,0xD2};	// Yellow pixel ycbcr format
static u8 white[]     = {0x80,0xEB,0x80,0xEB};	// White pixel ycbcr format


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

Static data

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

// Create two areas in SDRAM that will each hold an NTSC frame that will be
// sent out to the monitor.
//      For single-core processors, we can define the frames right here but
//      for dual-core processors, we need to declare them here but define
//      them in the sml3 project so that they get placed in SDRAM properly

#if defined(__ADSPBF561__)
extern u8 PingFrame[];
extern u8 PongFrame[];
#else
static u8 PingFrame[ADI_ITU656_NTSC_LINE_WIDTH * ADI_ITU656_NTSC_HEIGHT];
static u8 PongFrame[ADI_ITU656_NTSC_LINE_WIDTH * ADI_ITU656_NTSC_HEIGHT];
#endif



// 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
{
		ezErrorCheck(1);
		return(ADI_INT_RESULT_PROCESSED);
}
		
	
static ADI_INT_HANDLER(HWErrorHandler)		// hardware error handler
{
		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
	}
	
	// return
}




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


void main(void) {

	
	ADI_DEV_CMD_VALUE_PAIR ConfigurationTable [] = {		// table of PPI driver configuration values
#if defined(USE_LOOPBACK)
		{ ADI_DEV_CMD_SET_DATAFLOW_METHOD, 			(void *)ADI_DEV_MODE_CHAINED_LOOPBACK	},
#else
		{ ADI_DEV_CMD_SET_DATAFLOW_METHOD, 			(void *)ADI_DEV_MODE_CHAINED			},
#endif
		{ ADI_PPI_CMD_SET_CONTROL_REG,	 			(void *)0x0082							},
		{ ADI_PPI_CMD_SET_LINES_PER_FRAME_REG,		(void *)ADI_ITU656_NTSC_HEIGHT          },
		{ 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 EZ-Kit
#if defined(__ADSPBF561__)
	ezInit(2);
#else
	ezInit(1);
#endif
	
	// turn off all LEDs
	ezTurnOffAllLEDs();
	
	// 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));
	
	// initialize the Deferred Callback Manager and setup a queue
#if defined(USE_DEFERRED_CALLBACKS)
	ezErrorCheck(adi_dcb_Init(&DCBMgrData[0], ADI_DCB_QUEUE_SIZE, &ResponseCount, NULL));
	ezErrorCheck(adi_dcb_Open(14, &DCBMgrData[ADI_DCB_QUEUE_SIZE], (ADI_DCB_ENTRY_SIZE)*4, &ResponseCount, &DCBManagerHandle));
#else
	DCBManagerHandle = NULL;
#endif

	//Initialize the flag service, memory is not passed because callbacks are not being used
	ezErrorCheck(adi_flag_Init(NULL, 0, &ResponseCount, NULL));
	//enable all LEDS
	for (i = EZ_FIRST_LED; i < EZ_NUM_LEDS; i++){
        ezInitLED(i);
	}
	

	// 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 the two frames and make them both different colors

	//NtscVideoOutFrameBuffInit(PingFrame);
	adi_itu656_FrameFormat (PingFrame,ADI_ITU656_NTSC_IL);
	
	//NtscVideoOutFrameBuffInit(PongFrame);
	adi_itu656_FrameFormat (PongFrame,ADI_ITU656_NTSC_IL);
	
	//FillFrame (PingFrame, YELLOW);
	adi_itu656_FrameFill (PingFrame,ADI_ITU656_NTSC_IL,yellow);
	
	//FillFrame (PongFrame, BLUE);
	adi_itu656_FrameFill (PongFrame,ADI_ITU656_NTSC_IL,blue);

	// 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 = (ADI_ITU656_NTSC_LINE_WIDTH/2);
		PingBuffer[i].XModify = 2;
		PingBuffer[i].YCount = ADI_ITU656_NTSC_HEIGHT;
		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 = (ADI_ITU656_NTSC_LINE_WIDTH/2);
		PongBuffer[i].XModify = 2;
		PongBuffer[i].YCount = ADI_ITU656_NTSC_HEIGHT;
		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;
	
	// enable video encoder (717x)
	ezEnableVideoEncoder();
		
	// give the decoder time to sync
	ezDelay(300);
		
	// open the PPI driver for output
	ezErrorCheck(adi_dev_Open(DeviceManagerHandle, &ADIPPIEntryPoint, ENCODER_PPI, 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));
	
	// keep going until the last push button is pressed
	while (ezIsButtonPushed(EZ_LAST_BUTTON) == FALSE) ;
		
	// close the Device Manager
	ezErrorCheck(adi_dev_Terminate(DeviceManagerHandle));
	
	// close down the DMA Manager
	ezErrorCheck(adi_dma_Terminate(DMAManagerHandle));
	
	// close down the Deferred Callback Manager
#if defined(USE_DEFERRED_CALLBACKS)
	ezErrorCheck(adi_dcb_Terminate());
#endif

// return
}






?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费看日韩精品| 国产日韩欧美一区二区三区综合| 国产一区二区精品久久91| 亚洲精品国产第一综合99久久| 日韩一级欧美一级| 93久久精品日日躁夜夜躁欧美| 日韩精品乱码免费| 亚洲日本在线a| 久久精品人人做人人综合| 欧美精品xxxxbbbb| 91福利在线播放| 成人激情黄色小说| 韩国v欧美v日本v亚洲v| 丝袜美腿亚洲一区| 亚洲一区二区在线免费看| 国产精品嫩草99a| 欧美精品一区二区久久久| 欧美一区二区福利视频| 欧美最新大片在线看| av激情亚洲男人天堂| 国产精品一品二品| 国产精品一区在线观看你懂的| 人人爽香蕉精品| 午夜电影网一区| 午夜国产精品影院在线观看| 亚洲一区二区三区视频在线| 亚洲欧美另类图片小说| 日韩av一区二区在线影视| 精品美女一区二区三区| 欧美精品在欧美一区二区少妇| 色婷婷精品久久二区二区蜜臀av| 成人综合婷婷国产精品久久 | 欧美日韩黄色影视| 91久久人澡人人添人人爽欧美| 91美女蜜桃在线| 日本韩国欧美在线| 色噜噜狠狠色综合中国| 一本色道久久综合精品竹菊| 色综合中文字幕| 色婷婷久久久综合中文字幕| 91蜜桃在线观看| 欧美在线视频你懂得| 欧美日韩精品系列| 3d动漫精品啪啪一区二区竹菊| 91精品国产91综合久久蜜臀| 6080国产精品一区二区| 日韩欧美一卡二卡| 国产日韩欧美综合一区| 成人免费小视频| 亚洲国产精品天堂| 日本va欧美va瓶| 国产麻豆成人精品| 99精品热视频| 欧美精品日日鲁夜夜添| 日韩欧美一级片| 日本一区二区综合亚洲| 自拍视频在线观看一区二区| 亚洲一区二区三区自拍| 美女网站色91| www..com久久爱| 欧亚洲嫩模精品一区三区| 制服丝袜亚洲精品中文字幕| 久久这里只有精品6| 亚洲欧美自拍偷拍色图| 午夜影院久久久| 激情图区综合网| 99r精品视频| 91精品在线观看入口| 久久久亚洲精品石原莉奈| 亚洲欧美日韩一区二区| 美日韩一级片在线观看| 99久久99久久综合| 欧美一区二区三区免费视频| 国产蜜臀av在线一区二区三区| 亚洲制服丝袜av| 国产一区二区三区黄视频| 色吧成人激情小说| 337p粉嫩大胆噜噜噜噜噜91av| 成人欧美一区二区三区视频网页| 日韩1区2区日韩1区2区| 成人国产亚洲欧美成人综合网| 欧美蜜桃一区二区三区| 中文字幕av在线一区二区三区| 性做久久久久久久免费看| 国产大陆精品国产| 欧美日韩激情一区二区三区| 国产欧美综合色| 日本午夜一区二区| 日本精品一区二区三区四区的功能| 欧美一区二区久久| 亚洲精品免费电影| 国产精品影音先锋| 欧美一级免费大片| 一区二区三区四区不卡在线| 国产一区二区伦理片| 3atv一区二区三区| 一卡二卡欧美日韩| 成人一级片网址| 久久天天做天天爱综合色| 午夜精品一区在线观看| 色婷婷激情综合| 欧美国产精品一区二区三区| 青草国产精品久久久久久| 在线观看91视频| 亚洲欧美综合另类在线卡通| 国产精品亚洲一区二区三区在线| 欧美一区二区三区免费在线看 | 国产精品拍天天在线| 日本成人在线网站| 欧美色男人天堂| 亚洲精品成人精品456| 成人开心网精品视频| 久久久久久久久免费| 美女国产一区二区三区| 8x8x8国产精品| 天天操天天干天天综合网| 日本电影欧美片| 成人欧美一区二区三区白人 | 日韩精品一区在线观看| 五月天中文字幕一区二区| 欧美午夜电影一区| 一区二区三区不卡在线观看| 91在线精品一区二区| 国产精品毛片无遮挡高清| 国产精品12区| 欧美激情综合五月色丁香小说| 国产一区二区三区香蕉 | 亚洲三级在线观看| 91丨九色丨蝌蚪丨老版| 亚洲女同一区二区| 色94色欧美sute亚洲线路一久| 亚洲视频免费看| 色香色香欲天天天影视综合网| 亚洲欧洲av另类| 日本乱码高清不卡字幕| 亚洲一区成人在线| 欧美精品乱码久久久久久| 日韩高清一区在线| 欧美一区二区大片| 紧缚奴在线一区二区三区| 久久精品水蜜桃av综合天堂| 国产福利一区在线| 亚洲色图另类专区| 欧美日韩精品免费| 男女男精品视频网| 久久久久国色av免费看影院| 国产成人综合精品三级| 国产精品国产三级国产三级人妇| 色视频一区二区| 日韩专区中文字幕一区二区| 精品精品国产高清一毛片一天堂| 日韩电影在线观看网站| 不卡电影一区二区三区| 欧美国产欧美综合| 色拍拍在线精品视频8848| 亚洲国产人成综合网站| 日韩一二三四区| 国产麻豆一精品一av一免费| 国产精品美女www爽爽爽| 91黄色在线观看| 天天影视网天天综合色在线播放| 2024国产精品| 91麻豆产精品久久久久久 | 亚洲色图一区二区| 欧美日韩精品久久久| 激情五月婷婷综合| 亚洲三级免费观看| 日韩三级免费观看| gogo大胆日本视频一区| 婷婷成人激情在线网| 久久久精品欧美丰满| 欧洲一区在线电影| 精品一区免费av| 亚洲青青青在线视频| 日韩午夜电影av| 91丝袜美女网| 国产suv一区二区三区88区| www..com久久爱| 日韩精彩视频在线观看| 国产午夜亚洲精品不卡| 欧美日免费三级在线| 国产精品综合av一区二区国产馆| 中文字幕字幕中文在线中不卡视频| 91精品国产色综合久久不卡电影 | 久久久精品影视| 国产精品色婷婷| 欧美精品黑人性xxxx| bt欧美亚洲午夜电影天堂| 日本vs亚洲vs韩国一区三区| 亚洲欧美一区二区在线观看| 欧美不卡在线视频| 欧美日韩一级视频| 成人av网址在线| 麻豆成人久久精品二区三区小说| 一区二区三区不卡在线观看| 日本一区二区三区四区| 欧美不卡一区二区三区四区| 精品视频1区2区3区| 91在线无精精品入口| 高清在线成人网|