fpga device driver design guide on windows 7 embedded · 2013-12-17 · fpga device driver design...

73
Guangzhou ZHIYUAN Electronics Co.,LTD FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang

Upload: others

Post on 13-May-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

Guangzhou ZHIYUAN Electronics Co.,LTD

FPGA Device Driver

Design Guide on

Windows 7 Embedded

Yunrui Zhang

Page 2: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

Contents

Driver Installation 1

2 Driver Library

Driver Design Guide 3

Page 3: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

② Select “PCI Device”.

① Open device manager.

Page 4: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

③ Right click on “PCI

Device“;

Select “Update Driver

Software…”.

Page 5: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

④ Select "Browse

my computer for

driver software”.

Page 6: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

⑤ Click “Browse...” to

select the driver path.

Then click “Next”.

Page 7: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

⑥ select “Install

this driver software

anyway”.

Page 8: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

⑦ After installation

is complete:

Click “Close” to

return.

Page 9: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

Driver for “PCI Device” is

successfully installed :

a). The “ArCore Chipset System

Driver” will appear under the

“System devices”;

b). Several devices are enumerated

by “ArCore Chipset System Driver”.

Page 10: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

The steps to install drivers for

these devices are similar to

those for “PCI Device” (See

Step ② to Step ⑦).

⑧ Install drivers for the

“other devices”.

Page 11: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

1. Driver Installation

After installation is

complete:

a). A new type of device

class is added: "ArCore

Chipset Device“.

Page 12: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2. Driver Library

ADC Device Object 1

2 DAC Device Object

3 GPIO Device Object

4 Video Capture And Net

Page 13: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• The method to operate ADC devices:

AiCreate

AiClose

Initialize

GetADCInfo

GetDeviceName

Start

Stop

RegisterADCallback

Page 14: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Create an ADC device object with device index :

DWORD __stdcall

AiCreate(

IAiObject** ppIAiObj,

int Index

);

Page 15: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameters Meaning

ppIAiObj Pointer to a Pointer to the IAiObject

Index The index of ADC device

Parameters of AiCreate:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 16: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

struct IAiObject {

virtual DWORD __stdcall Initialize(

IN void *pContext) = 0;

virtual DWORD __stdcall RegisterADCallback(

IN AD_CONVERT_CALLBACK pADCallback,

IN void *pADContext) = 0;

virtual DWORD __stdcall GetADCInfo(

IN OUT int *ByteWidth,

IN OUT int *BitWidth) = 0;

virtual DWORD __stdcall GetDeviceName(

IN OUT void* lpszName,

IN OUT DWORD* pdwReqiredSize) = 0;

virtual DWORD __stdcall Start() = 0;

virtual DWORD __stdcall Stop() = 0;

};

Prototype of

IAiObject:

Page 17: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Close a specified ADC device object:

void __stdcall

AiClose(

IAiObject* pIAiObj

);

Page 18: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameters Meaning

ppIAiObj Pointer to the IAiObject

Parameters of AiClose:

Return Value:

None value to return.

Page 19: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Initialize device function:

DWORD __stdcall

Initialize(

void* pContext,

);

Page 20: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameters Meaning

pContext Reserved ,must be NULL

Parameters of Initialize:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 21: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Read ADC Device information function:

DWORD __stdcall

GetADCInfo(

int* ByteWidth,

int* BitWidth

);

Page 22: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameters Meaning

ByteWidth Pointer to the number of the bytes for

the data returned by the ADC

BitWidth Pointer to the number of bits of the

ADC device

Parameters of GetADCInfo:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 23: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Read ADC device name function:

DWORD __stdcall

GetDeviceName(

void* lpszName,

DWORD* pdwReqiredSize

);

Page 24: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameter Meaning

lpszName Pointer to the device name

pdwReqiredSize Pointer to the number of bytes

required for the device name

Parameters of GetDeviceName:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 25: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Start A/D Conversion function:

DWORD __stdcall Start();

Page 26: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameters of Start:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

None Parameters to input.

Page 27: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Stop A/D conversion function:

DWORD __stdcall Stop();

Page 28: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameters of Stop:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

None Parameters to input.

Page 29: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Register A/D data convert handler callback routine :

DWORD __stdcall

RegisterADCallback(

AD_CONVERT_CALLBACK pADCallback,

void* pADContext

);

Page 30: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameter Meaning

pADCallback Specifies the entry point for the user-

supplied A/D data convert handler

callback routine

pADContext Pointer to a user-determined context

to pass to the A/D data convert

handler callback routine

Parameters of RegisterADCallback :

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 31: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

• Prototype of A/D data convert handler

routine :

void (__stdcall

*AD_CONVERT_CALLBACK)(

DWORD dwRawData,

void* Context

);

Page 32: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.1 ADC Device Object

Parameter Meaning

dwRawData The raw data get from the AD

converter

pADContext Pointer to a user-determined context

Parameters of AD_CONVERT_CALLBACK:

Return Value:

None value to return.

Page 33: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

• Method to operate DAC device:

AoCreate

AoClose

Initialize

SendAoData

Page 34: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

• Create a DAC device object with device index :

DWORD __stdcall

AoCreate(

IAoObject** ppIAoObj,

int Index

);

Page 35: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

Parameters Meaning

ppIAoObj Pointer to a Pointer to the IAoObject

Index The index of DAC device

Parameters of AoCreate:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 36: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

struct IAoObject

{

virtual DWORD __stdcall Initialize(

IN void *pContext) = 0;

virtual DWORD __stdcall SendAoData(

IN USHORT *pTxBuffer,

IN unsigned long dwBufferSize) = 0;

};

Prototype of IAoObject :

Page 37: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

• Close a specified DAC device object:

void __stdcall

AoClose(

IAoObject* pIAoObj

);

Page 38: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

Parameters Meaning

ppIAoObj Pointer to the IAoObject

Parameters of AoClose:

Return Value:

None value to return.

Page 39: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

• Initialize device function:

DWORD __stdcall

Initialize(

void* pContext,

);

Page 40: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

Parameters Meaning

pContext Reserved ,must be NULL

Parameters of Initialize:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 41: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

• Write data to DAC function:

DWORD __stdcall

SendAoData(

USHORT * pTxBuffer,

unsigned long dwBufferSize

);

Page 42: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.2 DAC Device Object

Parameter Meaning

pTxBuffer Pointer to the DAC write buffer

dwBufferSize The size of the DAC write buffer

Parameters of SendAoData:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 43: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Method to operate GPIO interfaces:

GpioCreate

GpioClose

Initialize

RegisterEventProc

SetLEDState

GetLEDState

Page 44: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Create a GPIO device object with device index :

DWORD __stdcall

GpioCreate(

IGpioObject** ppIGpioObj,

int Index

);

Page 45: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Parameters Meaning

ppIGpioObj Pointer to a Pointer to the

IGpioObject

Index The index of GPIO device

Parameters of GpioCreate :

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 46: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

struct IGpioObject {

virtual DWORD __stdcall Initialize(

void *pContext) = 0;

virtual DWORD __stdcall RegisterEventProc(

GPIO_EVENT_PROC_ROUTINE

pEventProcRoutine,

void *pEventProcContext) = 0;

virtual DWORD __stdcall SetLEDState(

DWORD State) = 0;

virtual DWORD __stdcall GetLEDState(

DWORD* pSate) = 0;

};

Prototype of IGpioObject :

Page 47: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Close a specified GPIO device object:

void __stdcall

GpioClose(

IGpioObject* pIGpioObj

);

Page 48: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Parameters Meaning

pIGpioObj Pointer to the IGpioObject

Parameters of GpioClose :

Return Value:

None value to return.

Page 49: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Initialize device function:

DWORD __stdcall

Initialize(

void* pContext,

);

Page 50: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Parameters Meaning

pContext Reserved ,must be NULL

Parameters of Initialize:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 51: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Register GPIO event handler callback routine :

DWORD __stdcall

RegisterEventProc(

GPIO_EVENT_PROC_ROUTINE pEventProcRoutine,

void* pEventProcContext

);

Page 52: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Parameter Meaning

pEventProcRoutine Specifies the entry point for the user-

supplied GPIO event handler callback

routine

pEventProcContext Pointer to a user-determined context

to pass to the GPIO event handler

callback routine

Parameters of RegisterEventProc:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 53: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Prototype of GPIO event handler callback routine :

void (__stdcall*

GPIO_EVENT_PROC_ROUTINE)(

int Event,

int wParam,

int lParam,

void* Context

);

Page 54: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Parameter Meaning

Event Event message type

wParam Status of the switch or buttons

lParam Switch message : reserved

Button message : the index of the

button, if more than one button’s state

is changed or there are one or more

buttons are held, lParam will be

negative one

Context Pointer to a user-determined context

Parameters of GPIO_EVENT_PROC_ROUTINE:

Return Value:

None value to return.

Page 55: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Event type Meaning

GPIO_SWITCH_CHANGED Switch statue is changed

GPIO_BUTTON_DOWN Button down

GPIO_BUTTON_UP Button up

The enumeration values of Event:

Page 56: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Set LED state:

DWORD __stdcall

SetLEDState(

DWORD State

);

Page 57: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Parameters Meaning

State The lower 8 bits of pSate are

corresponding to the states of 8 LEDs

Parameters of SetLEDState:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 58: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

• Get LED state:

DWORD __stdcall

GetLEDState(

DWORD* pState

);

Page 59: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.3 GPIO Device Object

Parameters Meaning

pState The lower 8 bits of pSate are

corresponding to the states of 8 LEDs

Parameters of GetLEDState:

Return Value:

Return zreo if there is no error occurred, otherwise return non-zero value.

Page 60: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

2.4 Video Capture And Net

Video Capture

NET

DirectShow. Refer to platform SDK Documentation.

Windows Sockets. Refer to platform SDK Documentation.

Page 61: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Hardware Architecture

Driver Stack of FPGA Device

Supported Drivers And Driver Type

Driver Development Tools

Implement A Driver

Summary Driver Design Guide

Page 62: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Intel® Atom™

Processor

Intel® Atom™ E6x5C

Altera® Arria® IIEP2AGXE6XX FPGA

PCIe

COMe Connector 2

I/O

Ban

k 7

I/O

Ban

k 6

4Buttons

4Switches

8Leds

VideoDecoder

AnalogVideoInput

10-bit DAC

10Msps

8-bitADC

10Msps

12-bit ADC

400Ksps

PHY

Altera TSE

Hardware Architecture

Page 63: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Driver Stack of FPGA Device

PCI Bus

(pci.sys)

FPGA

(arcore.sys)

ADC

(aradc.sys)

DAC

(ardac.sys)

GPIO

(argpio.sys)

VIDEO

(arvideo.sys)

NET

(arndis.sys)

Parent Device

Child Device

Page 64: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

ZLG Supported Drivers

ADC — One 8bit ADC and 12bit ADC Input

DAC — One 10bit DAC Output

GPIO — 8 LED Output, 4 Button Input, 4 Switch Input

Video Capture — AVStream minidriver

Net Driver — NDIS miniport driver

Bus Driver — FPGA bus driver, ArCore.sys

Page 65: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Hardware

Kernel / HAL

Device Driver

API DLL

Application

User

Kernel

Generic WDM Device Driver Overview

DDI (Device Driver Interface)

API (Application Interface)

Page 66: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Video Capture Driver Overview

Port Class Stream Class AVStream

Ks

audio

minidrivers

DVD video

capture

audio or video

minidrivers

Microsoft

supplied

Vendor

supplied

Page 67: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

NDIS miniport

Net Card

NDIS Interface

Transport Driver

Interface (TDI)

LAN Protocols Native Media

Aware Protocol

Vendor

supplied

Net Device Driver Overview

Microsoft

supplied

Page 68: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Driver Development Tools

WDK Version 7600.16385.0

WinDbg or Other Debug Tools

Visual Studio (optional)

ESDC Hardware Platform

System Symbols (for debugging driver)

Page 69: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Implement ADC/DAC Drivers

ADC/DAC Running After Power On

ADC/DAC No FIFO, No Interrupt Generated

Driver Must Polling the ADC/DAC

Assume Bus Driver is Working as Design

Page 70: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net

3. Driver Design Guide

Build ADC/DAC Drivers

Page 71: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net
Page 72: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net
Page 73: FPGA Device Driver Design Guide on Windows 7 Embedded · 2013-12-17 · FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang . Contents ... 4 Video Capture And Net