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

📄 systemservicesinstall.c

📁 使用Usb cy7c68013与DSP通信
💻 C
字号:

#include    "system.h"
#include    <drivers/adi_ppi.h>			// PPI driver includes

#include    "ezkitutilities.h"

#include    "semaphores.h"

//#include 	"adi_net2272.h"				// NET2272 device driver includes
//#include 	"video_656.h" 
//#include    "YUV.h"

//#include    "adi_net2272.h"				// NET2272 device driver includes
//#include	"usr_routines.h"

#include 	"system_services_install.h"

//local data and handles

// DMA Manager data :base memory +
//					 memory for 1 PPI DMA channel +
//					 memory for 2 MEMDMA channels (USB driver) +
//					 memory for 2 MEMDMA channels (YUV to Video Frame)
static u8 DMAMgrData[ADI_DMA_BASE_MEMORY + (ADI_DMA_CHANNEL_MEMORY * 5)];

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

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

// Interrupt Manager data
static u8 IntMgrData[                      (ADI_INT_SECONDARY_MEMORY * 0)];	// storage for interrupt manager

ADI_DCB_HANDLE			DCBManagerHandle;		// handle to the callback service Manager
ADI_DMA_MANAGER_HANDLE 	DMAManagerHandle;		// handle to the DMA Manager
ADI_DEV_MANAGER_HANDLE 	DeviceManagerHandle;	// handle to the Device Manager


// prototypes (local)
//static ADI_INT_HANDLER(ExceptionHandler);	// exception handler
//static ADI_INT_HANDLER(HWErrorHandler);		// hardware error handler
//static void NET2272_Callback(void *AppHandle, u32  Event, void *pArg);	// NETCHIP callback handler
//static void PPI_Callback_Out(void *AppHandle, u32  Event, void *pArg);		// PPI callback handler (output)
static void PPI_Callback_In(void *AppHandle, u32  Event, void *pArg);		// PPI callback handler (input)
static void MDMA1_Callback(void *AppHandle, u32  Event, void *pArg);		// MEMDMA stream callback handler

// ISR counters
volatile int                Counter_MEMDMA          = 0;
volatile int                Counter_PPI             = 0;
volatile int                Error_MEMDMA            = 0;
volatile int                Error_PPI               = 0;
volatile int                Flag_MEMDMA             = 0;
volatile int                Flag_PPI                = 0;
volatile int                Nested_MEMDMA           = 0;
volatile int                Nested_PPI              = 0;


void install_system_services(void)
{
	u32 ResponseCount;			// response counter

	// initialize the Interrupt Manager and hook the exception and hardware error interrupts
	ezErrorCheck(adi_int_Init(IntMgrData, sizeof(IntMgrData), &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
	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));

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

	return;
}

⌨️ 快捷键说明

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