EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
devLibVME.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 
27 #ifndef INCdevLibh
28 #define INCdevLibh 1
29 
30 #include "dbDefs.h"
31 #include "osdVME.h"
32 #include "errMdef.h"
33 #include "libComAPI.h"
34 #include "devLib.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
41 typedef enum {
49 
51 LIBCOM_API extern const char *epicsAddressTypeName[];
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 /*
58  * To retain compatibility include everything by default
59  */
60 #ifndef NO_DEVLIB_COMPAT
61 # include "devLibVMEImpl.h"
62 #endif
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
74 LIBCOM_API long devAddressMap(void);
75 
85 LIBCOM_API long devBusToLocalAddr (
86  epicsAddressType addrType,
87  size_t busAddr,
88  volatile void **ppLocalAddr);
89 
100 LIBCOM_API long devReadProbe (
101  unsigned wordSize, volatile const void *ptr, void *pValueRead);
102 
117 LIBCOM_API long devNoResponseProbe(
118  epicsAddressType addrType,
119  size_t base,
120  size_t size
121 );
122 
133 LIBCOM_API long devWriteProbe (
134  unsigned wordSize, volatile void *ptr, const void *pValueWritten);
135 
150 LIBCOM_API long devRegisterAddress(
151  const char *pOwnerName,
152  epicsAddressType addrType,
153  size_t logicalBaseAddress,
154  size_t size,
155  volatile void **pPhysicalAddress);
156 
166 LIBCOM_API long devUnregisterAddress(
167  epicsAddressType addrType,
168  size_t logicalBaseAddress,
169  const char *pOwnerName);
170 
189 LIBCOM_API long devAllocAddress(
190  const char *pOwnerName,
191  epicsAddressType addrType,
192  size_t size,
193  unsigned alignment, /*n ls bits zero in addr*/
194  volatile void **pLocalAddress);
195 
215 LIBCOM_API long devConnectInterruptVME(
216  unsigned vectorNumber,
217  void (*pFunction)(void *),
218  void *parameter);
219 
233 LIBCOM_API long devDisconnectInterruptVME(
234  unsigned vectorNumber,
235  void (*pFunction)(void *));
236 
244 LIBCOM_API int devInterruptInUseVME (unsigned vectorNumber);
245 
256 LIBCOM_API long devEnableInterruptLevelVME (unsigned level);
257 
269 LIBCOM_API long devDisableInterruptLevelVME (unsigned level);
285 LIBCOM_API void *devLibA24Malloc(size_t size);
286 
295 LIBCOM_API void *devLibA24Calloc(size_t size);
296 
303 LIBCOM_API void devLibA24Free(void *pBlock);
323 LIBCOM_API long devConnectInterruptISA(
324  unsigned interruptLevel,
325  void (*pFunction)(void *),
326  void *parameter);
327 
335 LIBCOM_API long devDisconnectInterruptISA(
336  unsigned interruptLevel,
337  void (*pFunction)(void *));
338 
345 LIBCOM_API int devInterruptLevelInUseISA (unsigned interruptLevel);
346 
352 LIBCOM_API long devEnableInterruptLevelISA (unsigned level);
353 
359 LIBCOM_API long devDisableInterruptLevelISA (unsigned level);
362 #ifndef NO_DEVLIB_OLD_INTERFACE
363 
368 typedef enum {intVME, intVXI, intISA} epicsInterruptType;
369 
377 LIBCOM_API long devConnectInterrupt(
378  epicsInterruptType intType,
379  unsigned vectorNumber,
380  void (*pFunction)(void *),
381  void *parameter);
382 
390 LIBCOM_API long devDisconnectInterrupt(
391  epicsInterruptType intType,
392  unsigned vectorNumber,
393  void (*pFunction)(void *));
394 
402 LIBCOM_API long devEnableInterruptLevel(
403  epicsInterruptType intType, unsigned level);
404 
412 LIBCOM_API long devDisableInterruptLevel (
413  epicsInterruptType intType, unsigned level);
414 
421 LIBCOM_API long locationProbe (epicsAddressType addrType, char *pLocation);
422 
425 #endif /* NO_DEVLIB_OLD_INTERFACE */
426 
427 #ifdef __cplusplus
428 }
429 #endif
430 
431 #endif /* INCdevLibh.h*/
LIBCOM_API void devLibA24Free(void *pBlock)
free() for VME drivers that support DMA.
LIBCOM_API long devReadProbe(unsigned wordSize, volatile const void *ptr, void *pValueRead)
Probe the bus for reading from a specific address.
Memory mapped ISA access.
Definition: devLibVME.h:45
LIBCOM_API long devDisconnectInterrupt(epicsInterruptType intType, unsigned vectorNumber, void(*pFunction)(void *))
LIBCOM_API long devDisableInterruptLevelISA(unsigned level)
VME short I/O.
Definition: devLibVME.h:42
LIBCOM_API long devUnregisterAddress(epicsAddressType addrType, size_t logicalBaseAddress, const char *pOwnerName)
Release a bus address range previously registered.
LIBCOM_API const char * epicsAddressTypeName[]
A string representation of each of the bus address types.
Invalid, must be the last entry.
Definition: devLibVME.h:47
LIBCOM_API long devDisconnectInterruptVME(unsigned vectorNumber, void(*pFunction)(void *))
Disconnect an ISR from its VME interrupt vector.
LIBCOM_API long devAllocAddress(const char *pOwnerName, epicsAddressType addrType, size_t size, unsigned alignment, volatile void **pLocalAddress)
Allocate and register an unoccupied address block.
VME-64 CR/CSR address space.
Definition: devLibVME.h:46
LIBCOM_API long locationProbe(epicsAddressType addrType, char *pLocation)
LIBCOM_API long devAddressMap(void)
Print a map of registered bus addresses.
LIBCOM_API long devWriteProbe(unsigned wordSize, volatile void *ptr, const void *pValueWritten)
Probe the bus for writing to a specific address.
VME standard I/O.
Definition: devLibVME.h:43
LIBCOM_API int devInterruptLevelInUseISA(unsigned interruptLevel)
LIBCOM_API long devConnectInterrupt(epicsInterruptType intType, unsigned vectorNumber, void(*pFunction)(void *), void *parameter)
LIBCOM_API long devBusToLocalAddr(epicsAddressType addrType, size_t busAddr, volatile void **ppLocalAddr)
Translate a bus address to a pointer the CPU can use.
VME extended I/O.
Definition: devLibVME.h:44
LIBCOM_API long devRegisterAddress(const char *pOwnerName, epicsAddressType addrType, size_t logicalBaseAddress, size_t size, volatile void **pPhysicalAddress)
Register a bus address range with a name.
LIBCOM_API void * devLibA24Malloc(size_t size)
malloc() for VME drivers that support DMA.
LIBCOM_API long devDisableInterruptLevel(epicsInterruptType intType, unsigned level)
LIBCOM_API void * devLibA24Calloc(size_t size)
calloc() for VME drivers that support DMA.
LIBCOM_API long devEnableInterruptLevelISA(unsigned level)
LIBCOM_API long devEnableInterruptLevelVME(unsigned level)
Enable a VME interrupt level onto the CPU.
LIBCOM_API long devConnectInterruptVME(unsigned vectorNumber, void(*pFunction)(void *), void *parameter)
Connect an ISR up to a VME interrupt vector.
LIBCOM_API long devNoResponseProbe(epicsAddressType addrType, size_t base, size_t size)
Read-probe a range of bus addresses, looking for empty space.
LIBCOM_API long devDisableInterruptLevelVME(unsigned level)
Disable a VME interrupt level.
Miscellaneous macro definitions.
epicsAddressType
The available bus address types.
Definition: devLibVME.h:41
LIBCOM_API long devEnableInterruptLevel(epicsInterruptType intType, unsigned level)
API for accessing hardware devices, originally over VMEbus.
LIBCOM_API int devInterruptInUseVME(unsigned vectorNumber)
Determine if a VME interrupt vector is in use.
LIBCOM_API long devDisconnectInterruptISA(unsigned interruptLevel, void(*pFunction)(void *))
LIBCOM_API long devConnectInterruptISA(unsigned interruptLevel, void(*pFunction)(void *), void *parameter)
An interface from devLibVME.c to its OS-specific implementations.