1 / 12

EPICS Device Support Library

This article provides a quick tour of the EPICS Device Support Library API, including motivating factors, address and interrupt mapping, device driver portability, and code examples.

bmajor
Download Presentation

EPICS Device Support Library

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EPICS Device Support Library • Motivating factors • Quick tour of the API • Some examples

  2. Motivating Factors • Detect conflicting use of memory mapped IO and interrupt resources • Print address maps and interrupt vector maps • Abstract interface improves portability of device drivers

  3. Type Codes for Address Spaces We Use typedef enum { atVMEA16, atVMEA24, atVMEA32, atISA, /* memory mapped ISA access (until now only on PC) */ atLast /* atLast must be the last enum in this list */ } epicsAddressType;

  4. Register / Map Address Range of Memory Mapped IO long devRegisterAddress( const char *pOwnerName, epicsAddressType addrType, void *baseAddress, unsigned long size, /* bytes */ void **pLocalAddress);

  5. Unregister Address Range of Memory Mapped IO long devUnregisterAddress( epicsAddressType addrType, void *baseAddress, const char *pOwnerName);

  6. Type Codes For Interrupt Vector Spaces typedef enum {intCPU, intVME, intVXI} epicsInterruptType;

  7. Connect to an Interrupt long devConnectInterrupt( epicsInterruptType intType, unsigned vectorNumber, void (*pFunction)(), void *parameter)

  8. Disconnect from an Interrupt /* * * The parameter pFunction should be set to the C function pointer that * was connected. It is used as a key to prevent a driver from inadvertently * removing an interrupt handler that it didn't install */ long devDisconnectInterrupt( epicsInterruptType intType, unsigned vectorNumber, void (*pFunction)());

  9. Enable and Disable Interrupt Levels long devEnableInterruptLevel( epicsInterruptType intType, unsigned level); long devDisableInterruptLevel( epicsInterruptType intType, unsigned level);

  10. Print Address Map long devAddressMap(void)

  11. Print Interrupt Vector Map veclist()

  12. Examples (Unfortunately Only a Few in EPICS Base) <epics>\base\src\drv\ansi\drvAb.c(895): status = devRegisterAddress("drvAb",atVMEA24,(void *)p6008, <epics>\base\src\drv\ansi\drvEpvxi.c(513): status = devRegisterAddress( <epics>\base\src\drv\ansi\drvEpvxi.c(525): status = devRegisterAddress( <epics>\base\src\drv\old\drvBitBus.c(317): if (devRegisterAddress("Xycom Bitbus", atVMEA16, (void*)BaseAddr, sizeof(XycomBBRegsStruct), NULL) != 0) <epics>\base\src\drv\old\drvBitBus.c(327): if (devRegisterAddress("PEP Bitbus", atVMEA16, (void*)BaseAddr, sizeof(PepBBRegsStruct), NULL) != 0)

More Related