ANALOG DEVICES W4.5 Service Manual

W4.5
Device Drivers and System Services Manual
for Blackfin® Processors
Analog Devices, Inc.
Revision 2.1, August 2006
Part Number
82-000430-01
a
©2006 Analog Devices, Inc., ALL RIGHTS RESERVED. This document may not be reproduced in any form without prior, express written consent from Analog Devices, Inc.
Printed in the USA.
Disclaimer
Analog Devices, Inc. reserves the right to change this product without prior notice. Information furnished by Analog Devices is believed to be accurate and reliable. However, no responsibility is assumed by Analog Devices for its use; nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by impli cation or otherwise under the patent rights of Analog Devices, Inc.
Trademark and Service Mark Notice
The Analog Devices logo, Blackfin, the Blackfin logo, EZ-KIT Lite, SHARC, TigerSHARC, and VisualDSP++ are registered trademarks of Analog Devices, Inc.
-
All other brand and product names are trademarks or service marks of their respective owners.

CONTENTS

PREFACE
Purpose of This Manual ................................................................ xxv
Intended Audience ........................................................................ xxv
Manual Contents Description ...................................................... xxvi
Technical or Customer Support ................................................... xxvii
Supported Processors .................................................................. xxviii
Product Information .................................................................. xxviii
MyAnalog.com ..................................................................... xxviii
Processor Product Information ................................................ xxix
Related Documents ................................................................ xxix
Online Technical Documentation ............................................ xxx
Accessing Documentation From the Web ............................. xxx
Viewing Help Files ............................................................. xxxi
Printed Manuals ..................................................................... xxxi
VisualDSP++ Documentation Set ....................................... xxxi
Hardware Tools Manuals ................................................... xxxii
Processor Manuals ............................................................. xxxii
Data Sheets ....................................................................... xxxii
Notation Conventions ................................................................. xxxii
VisualDSP++ 4.5 Device Drivers and System iii Services Manual for Blackfin Processors
CONTENTS

INTRODUCTION

System Services Overview ............................................................. 1-2
General ................................................................................... 1-3
Application Interface ............................................................... 1-7
Dependencies .......................................................................... 1-8
Initialization ......................................................................... 1-10
Termination .......................................................................... 1-10
System Services Directory and File Structure .......................... 1-11
Accessing the System Services API ..................................... 1-11
Linking in the System Services Library .............................. 1-13
Rebuilding the System Services Library ............................. 1-15
Examples .......................................................................... 1-16
Dual Core Considerations ................................................. 1-16
RTOS Considerations ................................................................. 1-17
Interoperability of System Services with VDK ........................ 1-17
Deployment of Services within a multi-threaded application .. 1-19
Device Driver Overview .............................................................. 1-20
Application Interface ............................................................. 1-21
Device Driver Architecture .................................................... 1-22
Interaction with System Services ....................................... 1-24
Initialization ......................................................................... 1-24
Termination .......................................................................... 1-24
Device Driver Directory and File Structure ............................ 1-25
Accessing the Device Driver API ....................................... 1-26
iv VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
CONTENTS
Device Driver File Locations ............................................. 1-27
Linking in the Device Driver Library ................................. 1-28
Rebuilding the Device Driver Library ................................ 1-29
Examples on Distribution .................................................. 1-31

INTERRUPT MANAGER

Introduction ................................................................................. 2-2
Interrupt Manager Initialization .................................................... 2-4
Interrupt Manager Termination ..................................................... 2-5
Core Event Controller Functions ................................................... 2-6
adi_int_CECHook() Function ................................................. 2-6
adi_int_CECUnhook() Function ............................................. 2-8
Interrupt Handlers .................................................................. 2-8
System Interrupt Controller Functions .......................................... 2-9
adi_int_SICDisable() ............................................................. 2-10
adi_int_SICEnable() .............................................................. 2-10
adi_int_SICGetIVG() ............................................................ 2-10
adi_int_SICInterruptAsserted() ............................................. 2-10
adi_int_SICSetIVG() ............................................................. 2-11
adi_int_SICWakeup() ............................................................ 2-11
Protecting Critical Code Regions ................................................. 2-12
Modifying IMASK ...................................................................... 2-14
Examples .................................................................................... 2-15
File Structure .............................................................................. 2-15
Interrupt Manager API Reference ................................................ 2-17
VisualDSP++ 4.5 Device Drivers and System v Services Manual for Blackfin Processors
CONTENTS
Notation Conventions ........................................................... 2-17
adi_int_Init .......................................................................... 2-18
adi_int_Terminate ................................................................ 2-19
adi_int_CECHook ................................................................ 2-20
adi_int_CECUnhook ............................................................ 2-22
adi_int_ClearIMaskBits ........................................................ 2-24
adi_int_EnterCriticalRegion .................................................. 2-26
adi_int_ExitCriticalRegion .................................................... 2-28
adi_int_SICDisable ............................................................... 2-29
adi_int_SICEnable ................................................................ 2-30
adi_int_SICGetIVG .............................................................. 2-31
adi_int_SICInterruptAsserted ................................................ 2-32
adi_int_SICSetIVG .............................................................. 2-33
adi_int_SetIMaskBits ............................................................ 2-34
adi_int_SICWakeup .............................................................. 2-36

POWER MANAGEMENT MODULE

Introduction ................................................................................. 3-2
PM Module Operation – Getting Started ...................................... 3-3
Dual Core Considerations ............................................................. 3-7
Simple Method of Making it Work .......................................... 3-7
Synchronization Requirement .................................................. 3-8
Running Applications on One Core Only ................................ 3-9
Running Applications on Both Cores ..................................... 3-10
Synchronization between Cores ............................................. 3-11
vi VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
CONTENTS
The Built-in Lock variable and Linking Considerations .......... 3-12
SDRAM Initialization Prior to Loading an Executable ................. 3-15
Power Management API Reference .............................................. 3-18
Notation Conventions ........................................................... 3-18
adi_pwr_AdjustFreq .............................................................. 3-19
adi_pwr_Control ................................................................... 3-21
adi_pwr_GetConfigSize ......................................................... 3-23
adi_pwr_GetFreq .................................................................. 3-24
adi_pwr_GetPowerMode ....................................................... 3-25
adi_pwr_GetPowerSaving ...................................................... 3-26
adi_pwr_Init ......................................................................... 3-27
adi_pwr_LoadConfig ............................................................. 3-33
adi_pwr_Reset ....................................................................... 3-35
adi_pwr_SaveConfig .............................................................. 3-36
adi_pwr_SetFreq ................................................................... 3-37
adi_pwr_SetMaxFreqForVolt ................................................. 3-39
adi_pwr_SetPowerMode ........................................................ 3-40
adi_pwr_SetVoltageRegulator ................................................ 3-42
Public Data Types and Enumerations ........................................... 3-46
ADI_PWR_COMMAND ..................................................... 3-46
ADI_PWR_COMMAND_PAIR ........................................... 3-52
ADI_PWR_CSEL ................................................................. 3-53
ADI_PWR_DF ..................................................................... 3-54
ADI_PWR_EZKIT ............................................................... 3-55
VisualDSP++ 4.5 Device Drivers and System vii Services Manual for Blackfin Processors
CONTENTS
ADI_PWR_INPUT_DELAY ................................................ 3-56
ADI_PWR_OUTPUT_DELAY ............................................ 3-57
ADI_PWR_MODE .............................................................. 3-58
ADI_PWR_PACKAGE_KIND ............................................. 3-59
ADI_PWR_PCC133_COMPLIANCE .................................. 3-60
ADI_PWR_PROC_KIND .................................................... 3-61
ADI_PWR_RESULT ............................................................ 3-62
ADI_PWR_SSEL .................................................................. 3-64
ADI_PWR_VDDEXT .......................................................... 3-65
ADI_PWR_VLEV ................................................................ 3-66
ADI_PWR_VR_CANWE ..................................................... 3-67
ADI_PWR_VR_CKELOW ................................................... 3-68
ADI_PWR_VR_CLKBUFOE ............................................... 3-69
ADI_PWR_VR_FREQ ......................................................... 3-70
ADI_PWR_VR_GAIN ......................................................... 3-71
ADI_PWR_VR_PHYWE ..................................................... 3-72
ADI_PWR_VR_WAKE ........................................................ 3-73
PM Module Macros .................................................................... 3-74

EXTERNAL BUS INTERFACE UNIT MODULE

Introduction ................................................................................. 4-2
Using the EBIU Module ............................................................... 4-3
EBIU API Reference ..................................................................... 4-6
Notation Conventions ............................................................. 4-6
adi_ebiu_AdjustSDRAM ......................................................... 4-8
viii VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
CONTENTS
adi_ebiu_Control .................................................................... 4-9
adi_ebiu_GetConfigSize ........................................................ 4-12
adi_ebiu_Init ........................................................................ 4-13
adi_ebiu_LoadConfig ............................................................ 4-17
adi_ebiu_SaveConfig ............................................................. 4-18
Public Data Types and Enumerations ........................................... 4-19
ADI_EBIU_RESULT ............................................................ 4-20
ADI_EBIU_SDRAM_BANK_VALUE ................................... 4-22
ADI_EBIU_TIME ................................................................ 4-23
ADI_EBIU_TIMING_VALUE ............................................. 4-24
Setting Control Values in the EBIU Module ................................ 4-25
ADI_EBIU_COMMAND ..................................................... 4-25
ADI_EBIU_COMMAND_PAIR ........................................... 4-29
Command Value Enumerations ............................................. 4-29
ADI_EBIU_SDRAM_EZKIT ........................................... 4-29
ADI_EBIU_SDRAM_ENABLE ........................................ 4-29
ADI_EBIU_SDRAM_BANK_SIZE .................................. 4-30
ADI_EBIU_SDRAM_BANK_COL_WIDTH ................... 4-30
ADI_EBIU_SDRAM_MODULE_TYPE .......................... 4-31
ADI_EBIU_CMD_SET_SDRAM_SCTLE ....................... 4-32
ADI_EBIU_SDRAM_EMREN ......................................... 4-33
ADI_EBIU_SDRAM_PASR ............................................. 4-33
ADI_EBIU_SDRAM_TCSR ............................................. 4-33
ADI_EBIU_SDRAM_SRFS .............................................. 4-34
VisualDSP++ 4.5 Device Drivers and System ix Services Manual for Blackfin Processors
CONTENTS
ADI_EBIU_SDRAM_EBUFE .......................................... 4-34
ADI_EBIU_SDRAM_PUPSD .......................................... 4-35
ADI_EBIU_SDRAM_PSM .............................................. 4-35
ADI_EBIU_SDRAM_FBBRW ......................................... 4-36
ADI_EBIU_SDRAM_CDDBG ........................................ 4-36

DEFERRED CALLBACK MANAGER

Introduction ................................................................................. 5-2
Using the Deferred Callback Manager ........................................... 5-3
Interoperability With an RTOS ..................................................... 5-8
adi_dcb_Forward .................................................................... 5-8
adi_dcb_RegisterISR ............................................................. 5-10
Handling Critical Regions within Callbacks ........................... 5-10
DCB Manager API Reference ...................................................... 5-12
Notation Conventions ........................................................... 5-12
adi_dcb_Close ...................................................................... 5-13
adi_dcb_Control ................................................................... 5-14
adi_dcb_Init ......................................................................... 5-17
adi_dcb_Open ...................................................................... 5-19
adi_dcb_Post ........................................................................ 5-21
adi_dcb_Remove ................................................................... 5-24
adi_dcb_Terminate ............................................................... 5-25
Public Data Types and Macros .................................................... 5-26
ADI_DCB_CALLBACK_FN ................................................ 5-27
ADI_DCB_COMMAND_PAIR ........................................... 5-28
x VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
ADI_DCB_COMMAND ...................................................... 5-29
ADI_DCB_ENTRY_HDR .................................................... 5-30
ADI_DCB_RESULT ............................................................. 5-31

DMA MANAGER

Introduction ................................................................................. 6-2
Theory of Operation ..................................................................... 6-4
Overview ................................................................................ 6-4
DMA Manager Initialization ................................................... 6-5
DMA Manager Termination ................................................... 6-6
Memory DMA and Peripheral DMA ........................................ 6-6
Controlling Memory Streams ................................................... 6-7
Opening Memory Streams ................................................... 6-8
Memory Transfers ............................................................... 6-8
One-Dimensional Transfers (Linear Transfers) ................. 6-9
Two-Dimensional Transfers ........................................... 6-10
Closing Memory Streams .................................................. 6-11
Controlling DMA Channels .................................................. 6-11
Opening DMA Channels .................................................. 6-11
Single Transfers ............................................................. 6-13
Circular Transfers .......................................................... 6-15
Large Descriptor Chaining Model .................................. 6-17
Small Descriptor Chaining Model ................................. 6-21
Arrays of Descriptors ..................................................... 6-21
Configuring a DMA Channel ............................................ 6-22
VisualDSP++ 4.5 Device Drivers and System xi Services Manual for Blackfin Processors
Closing a DMA Channel .................................................. 6-22
Transfer Completions ............................................................ 6-23
Polling ............................................................................. 6-23
Callbacks .......................................................................... 6-23
Memory Stream Callbacks ............................................ 6-24
Circular Transfer Callbacks ........................................... 6-24
Descriptor Callbacks ..................................................... 6-25
Descriptor-Based Sub-Modes ................................................. 6-25
Loopback Sub-Mode ......................................................... 6-25
Streaming Sub-Mode ........................................................ 6-26
DMA Channel to Peripheral Mapping ................................... 6-27
Sensing a Mapping ........................................................... 6-28
Setting a Mapping ............................................................ 6-28
Interrupts ............................................................................. 6-28
Hooking Interrupts ........................................................... 6-29
Unhooking Interrupts ....................................................... 6-29
Two-Dimensional DMA ........................................................ 6-30
DMA manager API Reference ..................................................... 6-33
Notation Conventions ........................................................... 6-33
adi_dma_Buffer .................................................................... 6-35
adi_dma_Close ..................................................................... 6-37
adi_dma_Control .................................................................. 6-38
adi_dma_GetMapping .......................................................... 6-41
adi_dma_Init ........................................................................ 6-42
xii VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
adi_dma_MemoryClose ......................................................... 6-43
adi_dma_MemoryCopy ......................................................... 6-44
adi_dma_MemoryCopy2D .................................................... 6-46
adi_dma_MemoryOpen ......................................................... 6-48
adi_dma_Open ..................................................................... 6-50
adi_dma_Queue .................................................................... 6-53
adi_dma_SetMapping ............................................................ 6-54
adi_dma_Terminate ............................................................... 6-55
Public Data Structures, Enumerations and Macros ....................... 6-56
Data Types ............................................................................ 6-57
ADI_DMA_CHANNEL_HANDLE ................................. 6-57
ADI_DMA_DESCRIPTOR_UNION/ADI_DMA_DESCRIPTOR_
HANDLE ...................................................................... 6-57
ADI_DMA_STREAM_HANDLE .................................... 6-58
Data Structures ..................................................................... 6-58
ADI_DMA_2D_TRANSFER ........................................... 6-58
ADI_DMA_CONFIG_REG ............................................. 6-59
ADI_DMA_DESCRIPTOR_ARRAY ................................ 6-59
ADI_DMA_DESCRIPTOR_LARGE ................................ 6-59
ADI_DMA_DESCRIPTOR_SMALL ................................ 6-60
General Enumerations ........................................................... 6-60
ADI_DMA_CHANNEL_ID ............................................ 6-60
ADI_DMA_EVENT ......................................................... 6-60
ADI_DMA_MODE ......................................................... 6-61
ADI_DMA_PMAP ........................................................... 6-61
VisualDSP++ 4.5 Device Drivers and System xiii Services Manual for Blackfin Processors
ADI_DMA_RESULT ....................................................... 6-62
ADI_DMA_STREAM_ID ............................................... 6-62
ADI_DMA_CONFIG_REG Field Values .............................. 6-63
ADI_DMA_DMA2D ....................................................... 6-63
ADI_DMA_DI_EN ......................................................... 6-63
ADI_DMA_DI_SEL ........................................................ 6-63
ADI_DMA_EN ............................................................... 6-63
ADI_DMA_WDSIZE ...................................................... 6-63
ADI_DMA_WNR ............................................................ 6-64
DMA Commands ................................................................. 6-64

PROGRAMMABLE FLAG SERVICE

Introduction ................................................................................. 7-2
Operation .................................................................................... 7-3
Initialization ........................................................................... 7-4
Termination ............................................................................ 7-4
Flag IDs .................................................................................. 7-5
Flag Control Functions ........................................................... 7-5
adi_flag_Open() ................................................................. 7-5
adi_flag_Close() ................................................................. 7-5
adi_flag_SetDirection() ....................................................... 7-6
adi_flag_Set() ..................................................................... 7-6
adi_flag_Clear() .................................................................. 7-6
adi_flag_Toggle() ................................................................ 7-6
adi_flag_Sense() ................................................................. 7-6
xiv VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
Callbacks ................................................................................ 7-6
adi_flag_InstallCallback() .................................................... 7-7
adi_flag_RemoveCallback() ................................................. 7-9
adi_flag_SuspendCallbacks() ............................................... 7-9
adi_flag_ResumeCallbacks() ................................................ 7-9
adi_flag_SetTrigger() ........................................................... 7-9
Coding Example ...................................................................... 7-9
Initialization ..................................................................... 7-10
Opening a Flag ................................................................. 7-10
Setting the Direction ......................................................... 7-11
Controlling an Output Flag ............................................... 7-11
Sensing the Value of a Flag ................................................ 7-12
Installing a Callback Function ........................................... 7-12
Suspending and Resuming Callbacks ................................. 7-13
Removing Callbacks .......................................................... 7-13
Termination ...................................................................... 7-14
Flag Service API Reference .......................................................... 7-14
Notation Conventions ........................................................... 7-14
adi_flag_Clear ....................................................................... 7-15
adi_flag_Close ....................................................................... 7-16
adi_flag_Init ......................................................................... 7-17
adi_flag_Open ....................................................................... 7-19
adi_flag_SetDirection ............................................................ 7-20
adi_flag_Terminate ................................................................ 7-21
VisualDSP++ 4.5 Device Drivers and System xv Services Manual for Blackfin Processors
adi_flag_Set .......................................................................... 7-22
adi_flag_Toggle ..................................................................... 7-23
adi_flag_Sense ...................................................................... 7-24
adi_flag_InstallCallback ........................................................ 7-25
adi_flag_RemoveCallback ...................................................... 7-27
adi_flag_SuspendCallbacks .................................................... 7-28
adi_flag_ResumeCallbacks .................................................... 7-29
adi_flag_SetTrigger ............................................................... 7-30
Public Data Types, Enumerations and Macros ............................. 7-31
ADI_FLAG_ID .................................................................... 7-31
Associated Macros ............................................................ 7-32
ADI_FLAG_RESULT ........................................................... 7-32
ADI_FLAG_EVENT ............................................................ 7-33
ADI_FLAG_TRIGGER ........................................................ 7-33
ADI_FLAG_TRIGGER ........................................................ 7-34
ADI_FLAG_EVENT ............................................................ 7-34

TIMER SERVICE

Introduction ................................................................................. 8-2
Operation .................................................................................... 8-3
Initialization ........................................................................... 8-3
Termination ............................................................................ 8-4
Timer IDs ............................................................................... 8-4
Basic Timer Functions ............................................................. 8-4
adi_tmr_Open() ................................................................. 8-4
xvi VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
adi_tmr_Close() .................................................................. 8-5
adi_tmr_Reset() .................................................................. 8-5
General-Purpose Timer Functions ............................................ 8-5
adi_tmr_GPControl() ......................................................... 8-5
adi_tmr_GPGroupEnable() ................................................. 8-6
Core Timer Functions ............................................................. 8-6
adi_tmr_CoreControl() ....................................................... 8-6
Watchdog Timer Functions ...................................................... 8-6
adi_tmr_WatchdogControl() ............................................... 8-7
Peripheral Timer Functions ...................................................... 8-7
adi_tmr_GetPeripheralID() ................................................. 8-7
Callbacks ................................................................................ 8-7
adi_tmr_InstallCallback() .................................................... 8-8
adi_tmr_RemoveCallback() ................................................. 8-9
Coding Example .................................................................... 8-10
Initialization ..................................................................... 8-10
Opening a Timer .............................................................. 8-10
Configuring a Timer ......................................................... 8-11
Enabling and Disabling Timers ......................................... 8-12
Installing a Callback Function ........................................... 8-13
Removing Callbacks .......................................................... 8-14
Termination ...................................................................... 8-15
Timer Service API Reference ....................................................... 8-16
Notation Conventions ........................................................... 8-16
VisualDSP++ 4.5 Device Drivers and System xvii Services Manual for Blackfin Processors
adi_tmr_Init ......................................................................... 8-17
adi_tmr_Open ...................................................................... 8-18
adi_tmr_Terminate ............................................................... 8-19
adi_tmr_Close ...................................................................... 8-20
adi_tmr_Reset ....................................................................... 8-21
adi_tmr_CoreControl ........................................................... 8-22
adi_tmr_WatchdogControl ................................................... 8-23
adi_tmr_GPControl .............................................................. 8-24
adi_tmr_GPGroupEnable ..................................................... 8-25
adi_tmr_InstallCallback ........................................................ 8-27
adi_tmr_RemoveCallback ..................................................... 8-29
adi_tmr_GetPeripheralID ...................................................... 8-30
Public Data Types, Enumerations and Macros ............................. 8-31
Timer IDs ............................................................................. 8-31
Associated Macros ............................................................ 8-32
ADI_TMR_RESULT ............................................................ 8-32
ADI_TMR_EVENT ............................................................. 8-33
ADI_TMR_CORE_CMD .................................................... 8-33
ADI_TMR_WDOG_CMD .................................................. 8-34
ADI_TMR_GP_CMD .......................................................... 8-35

PORT CONTROL SERVICE

Introduction ................................................................................. 9-2
Using the Port Control Manager ................................................... 9-2
Port Control Manager API Reference ............................................ 9-4
xviii VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
Notation Conventions ............................................................. 9-5
adi_ports_Init ......................................................................... 9-6
adi_ports_Terminate ................................................................ 9-7
adi_ports_EnablePPI ............................................................... 9-8
adi_ports_EnableSPI ............................................................... 9-9
adi_ports_EnableSPORT ....................................................... 9-10
adi_ports_EnableUART ......................................................... 9-11
adi_ports_EnableCAN ........................................................... 9-12
adi_ports_EnableTimer ......................................................... 9-13
adi_ports_EnableGPIO ......................................................... 9-15
Public Data Types, Enumerations and Macros .............................. 9-17
ADI_PORTS_RESULT ......................................................... 9-17
Directive Enumeration Values ................................................ 9-17

DEVICE DRIVER MANAGER

Device Driver Model Overview ................................................... 10-4
Using the Device Manager .......................................................... 10-7
Device Manager Overview ..................................................... 10-7
Theory of Operation ............................................................. 10-8
Data ................................................................................. 10-9
Initializing the Device Manager ....................................... 10-10
Device Manager Termination .......................................... 10-11
Opening a Device ........................................................... 10-11
Configuring a Device ...................................................... 10-12
Dataflow Method ........................................................ 10-13
VisualDSP++ 4.5 Device Drivers and System xix Services Manual for Blackfin Processors
Enabling Dataflow ...................................................... 10-16
Providing Buffers to a Device .......................................... 10-16
Closing a Device ............................................................. 10-18
Callbacks ........................................................................ 10-18
Initialization Sequence .................................................... 10-18
Stackable Drivers ............................................................ 10-19
Deciding on a Dataflow Method ............................................... 10-20
Chained without Loopback ................................................. 10-20
Chained with Loopback ...................................................... 10-20
Circular ............................................................................. 10-20
Sequential With and Without Loopback .............................. 10-21
Creating One Dimensional Buffers ........................................... 10-21
Creating Two Dimensional Buffers ............................................ 10-25
Creating Circular Buffers .......................................................... 10-28
Creating One Dimensional Sequential Buffers ........................... 10-30
Device Manager Design ............................................................ 10-32
Device Manager API Description ......................................... 10-33
Memory Usage Macros ................................................... 10-34
Handles .......................................................................... 10-34
Dataflow Enumerations .................................................. 10-34
Command IDs ............................................................... 10-35
Callback Events .............................................................. 10-35
Return Codes ................................................................. 10-35
Circular Buffer Callback Options .................................... 10-36
xx VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
Buffer Data Types ........................................................... 10-36
Physical Driver Entry Point ............................................. 10-37
API Function Definitions ................................................ 10-37
Device Manager Code ......................................................... 10-37
Data Structures ............................................................... 10-37
Static Data ...................................................................... 10-38
Static Function Declarations ............................................ 10-38
API Functional Description ............................................. 10-38
adi_dev_Init Functional Description ........................... 10-39
adi_dev_Open Functional Description ........................ 10-39
adi_dev_Close Functional Description ......................... 10-40
adi_dev_Read Functional Description .......................... 10-40
adi_dev_Write Functional Description ......................... 10-41
adi_dev_Control Functional Description ..................... 10-42
Static Functions .............................................................. 10-45
PDDCallback ............................................................. 10-45
DMACallback ............................................................. 10-45
PrepareBufferList ........................................................ 10-46
SetDataflow ................................................................ 10-48
Physical Driver Design .............................................................. 10-49
Physical Driver Design Overview ......................................... 10-49
Physical Device Driver API Description ............................... 10-51
Physical Driver Include File (“xxx.h”) ................................... 10-52
Extensible Definitions ..................................................... 10-52
VisualDSP++ 4.5 Device Drivers and System xxi Services Manual for Blackfin Processors
ADI_DEV_PDD_ENTRY_POINT ................................ 10-54
Physical Driver Source (“xxx.c”) .......................................... 10-54
adi_pdd_Open Functional Description ........................... 10-55
adi_pdd_Control Functional Description ........................ 10-56
adi_pdd_Read Functional Description ............................ 10-58
adi_pdd_Write Functional Description ........................... 10-59
adi_pdd_Close Functional Description ........................... 10-60
Device Manager API Reference ................................................. 10-62
Notation Conventions ......................................................... 10-62
adi_dev_Close ..................................................................... 10-63
adi_dev_Control ................................................................. 10-64
adi_dev_Init ....................................................................... 10-65
adi_dev_Open .................................................................... 10-67
adi_dev_Read ..................................................................... 10-70
adi_dev_Terminate .............................................................. 10-71
adi_dev_Write .................................................................... 10-72
Physical Driver API Reference ................................................... 10-73
Notation Conventions ......................................................... 10-73
adi_pdd_Close .................................................................... 10-74
adi_pdd_Control ................................................................ 10-75
adi_pdd_Open .................................................................... 10-76
adi_pdd_Read ..................................................................... 10-78
adi_pdd_Write .................................................................... 10-79
Examples .................................................................................. 10-80
xxii VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
INDEX
VisualDSP++ 4.5 Device Drivers and System xxiii Services Manual for Blackfin Processors
xxiv VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors

PREFACE

Thank you for using Analog Devices, Inc. development software for Analog Devices embedded processors.

Purpose of This Manual

The VisualDSP++ 4.5 Device Drivers and System contains information about the Analog Devices Device Driver Model and System Services library suite. Included are architectural descriptions of the device driver design, and each of the System Service components. Also included is a description of the APIs into each library.

Intended Audience

The primary audience for this manual is a programmer who is familiar with Analog Devices Blackfin processors. This manual assumes that the audience has a working knowledge of the appropriate processor architec ture and instruction set. Programmers who are unfamiliar with Analog Devices processors can use this manual, but should supplement it with other texts (such as the appropriate hardware reference and programming reference manuals) that describe your target architecture.
VisualDSP++ 4.5 Device Drivers and System xxv Services Manual for Blackfin Processors
-

Manual Contents Description

Manual Contents Description
This manual contains:
Chapter 1, “Introduction” provides an overview of System Services and Device Drivers
Chapter 2, “Interrupt Manager” describes the system interrupt controller (SIC) Manager that sup­ports the general-purpose interrupt events
Chapter 3, “Power Management Module” describes the power management module that supports Dynamic power management of Blackfin processors
Chapter 4, “External Bus Interface Unit Module” describes the external bus interface unit (EBIU) module that is used to enable the power management module to manage the SDRAM Controller operation
Chapter 5, “Deferred Callback Manager” describes the deferred callback manager that is used by the applica­tion developer to effectively execute function calls
Chapter 6, “DMA Manager” describes direct memory access (DMA) manager API
Chapter 7, “Programmable Flag Service” describes the programmable flag service that provides interface into the programmable flag subsystem of the Blackfin processor.
Chapter 8, “Timer Service” describes the Timer Service that provides interface into the core, watchdog and general-purpose timers of the Blackfin processor.
xxvi VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
Chapter 9, “Port Control Service” describes the port control manager service that is used to assign the programmable flag pins to various functions (on ADSP-BF534, ADSP-BF536, and ADSP-BF537 processors only).
Chapter 10, “Device Driver Manager” describes the device driver model used to control devices, both internal and external, to ADI processors

Technical or Customer Support

You can reach Analog Devices, Inc. Customer Support in the following ways:
Visit the Embedded Processing and DSP products Web site at
http://www.analog.com/processors/technicalSupport
Preface
E-mail tools questions to
processor.tools.support@analog.com
E-mail processor questions to
processor.support@analog.com (World wide support) processor.europe@analog.com (Europe support) processor.china@analog.com (China support)
Phone questions to 1-800-ANALOGD
Contact your Analog Devices, Inc. local sales office or authorized distributor
Send questions by mail to:
Analog Devices, Inc. One Technology Way P.O. Box 9106 Norwood, MA 02062-9106 USA
VisualDSP++ 4.5 Device Drivers and System xxvii Services Manual for Blackfin Processors

Supported Processors

Supported Processors
Currently, the following Blackfin processors are supported:
ADSP-BF531 ADSP-BF532 (formerly ADSP-21532) ADSP-BF533 ADSP-BF535 (formerly ADSP-21535) ADSP-BF534 ADSP-BF536 ADSP-BF537 ADSP-BF538 ADSP-BF539 ADSP-BF561 AD6903 AD6531 AD6901 AD6902

Product Information

You can obtain product information from the Analog Devices Web site, from the product CD-ROM, or from the printed publications (manuals).
Analog Devices is online at www.analog.com. Our Web site provides infor­mation about a broad range of products—analog integrated circuits, amplifiers, converters, and digital signal processors.

MyAnalog.com

MyAnalog.com is a free feature of the Analog Devices Web site that allows
customization of a Web page to display only the latest information on products you are interested in. You can also choose to receive weekly E-mail notification containing updates to the Web pages that meet your interests. sheets, code examples, and more.
Registration:
xxviii VisualDSP++ 4.5 Device Drivers and System
MyAnalog.com provides access to books, application notes, data
Services Manual for Blackfin Processors
Preface
Visit www.myanalog.com to sign up. Click Register to use MyAnalog.com. Registration takes about five minutes and serves as means for you to select the information you want to receive.
If you are already a registered user, just log on. Your user name is your E-mail address.

Processor Product Information

For information on embedded processors and DSPs, visit our Web site at
www.analog.com/processors, which provides access to technical publica-
tions, data sheets, application notes, product overviews, and product announcements.
You may also obtain additional information about Analog Devices and its products in any of the following ways.
E-mail questions or requests for information to
processor.support@analog.com (World wide support) processor.europe@analog.com (Europe support) processor.china@analog.com (China support)
Fax questions or requests for information to
1-781-461-3010 (North America) +49-89-76903-157 (Europe)
Access the FTP Web site at
ftp ftp.analog.com (or ftp 137.71.25.69) ftp://ftp.analog.com

Related Documents

For software/tools information, refer to VisualDSP++ user’s documenta­tion available online and in printed forms.
VisualDSP++ 4.5 Device Drivers and System xxix Services Manual for Blackfin Processors
Product Information
For hardware information, refer to your processors’s hardware reference, programming reference, or data sheet. All documentation is available online. Most documentation is available in printed form.
Visit the Technical Library Web site to access all processor and tools man­uals and data sheets:
http://www.analog.com/processors/resources/technicalLibrary

Online Technical Documentation

Online documentation includes the VisualDSP++ Help system, software tools manuals, hardware tools manuals, processor manuals, Dinkum Abridged C++ library, and Flexible License Manager (FlexLM) network license manager software documentation. For easy printing, supplemen tary .PDF files of most manuals are also provided.
Each documentation file type is described as follows.
-
File Description
.CHM Help system files and manuals in Help format
.HTM or .HTML
.PDF VisualDSP++ and processor manuals in Portable Documentation Format (PDF).
Dinkum Abridged C++ library and FlexLM network license manager software documentation. Viewing and printing the .HTML files requires a browser, such as Internet Explorer 5.01 (or higher).
Viewing and printing the Reader (4.0 or higher).
.PDF files requires a PDF reader, such as Adobe Acrobat
Accessing Documentation From the Web
Download manuals in PDF format at the following Web site:
http://www.analog.com/processors/resources/technicalLibrary/man­uals
xxx VisualDSP++ 4.5 Device Drivers and System
Services Manual for Blackfin Processors
Loading...
+ 472 hidden pages