forked from epics-modules/devlib2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexplore.h
More file actions
118 lines (84 loc) · 3.22 KB
/
Copy pathexplore.h
File metadata and controls
118 lines (84 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/** @page exploreapp PCI driver/hardware development tool
@section exploreintro Purpose
The exploreApp support is intended as a tool to explore new PCI devices.
This may be useful when preparing to write a dedicated driver and/or
during development of PCI/PCIe device firmware.
exploreApp allows a PCI register to be read and/or written an EPICS record.
For example:
@code
record(longout, "pcitestout") {
field(DTYP, "Explore Write32 LSB")
field(OUT , "@8:0.0 bar=0 offset=0xc")
}
@endcode
The record @b pcitestout will be connected to the PCI device 8:0.0 (bus 8, device 0, function 0) with the first BAR.
A single write of 4 bytes is made when the record is processed.
The following can be added to some @b xyzApp/src/Makefile to include exploreApp.
@code
PROD_IOC += myioc
DBD += myioc.dbd
myioc_DBD += exploreSupport.dbd
myioc_LIBS += explorepci epicspci
@endcode
@section exploreopts Options
@b INP/OUT link strings may contain the following components
@li "bar=#" (default: 0)
@li "offset=#" in bytes (default: 0)
@li "mask=#" bit mask (default: 0 aka. no mask)
@li "shift=#" in bits (default: 0)
@li "step=#" in bytes (default: read size. eg Read32 defaults to step=4)
@li "initread=1|0" bool (default: 1 for .OUT recordtypes, 0 otherwise)
For record types: @b longout, @b bo, @b mbbo, @b mbboDirect, @b ao
allowed @b DTYP are:
@li Explore Write8
@li Explore Write16 NAT
@li Explore Write16 LSB
@li Explore Write16 MSB
@li Explore Write32 NAT
@li Explore Write32 LSB
@li Explore Write32 MSB
For record types: @b longin, @b longout, @b bi, @b bo, @b mbbi, @b mbbo, @b mbbiDirect, @b mbboDirect, @b ai, @b ao
@li Explore Read8
@li Explore Read16 NAT
@li Explore Read16 LSB
@li Explore Read16 MSB
@li Explore Read32 NAT
@li Explore Read32 LSB
@li Explore Read32 MSB
The @b ao record type also accepts
@li Explore WriteF32 LSB
@li Explore WriteF32 MSB
The @b ai record type also accepts
@li Explore ReadF32 LSB
@li Explore ReadF32 MSB
The @b waveform record type accepts both integer Read and Write @b DTYP.
The @b step= link option may be applied to change how the address counter is incremented.
The default step size is the read size (eg. 4 for Read32).
A step size of 0 will read the base address @b NELM times.
@section exploreirq PCI Interrupt
Limited support of PCI interrupts is available on Linux only.
A @b longin record with DTYP="Explore IRQ Count" and SCAN="I/O Intr"
will be processed each time an interrupt occurs.
This requires that a UIO kernel module be installed.
@section explorefrib FRIB Specific
The DTYP="Explore FRIB Flash" support implements a FRIB specific protocol
for accessing a SPI flash chip over PCI.
The @b frib-flash.db file demonstrates use.
*/
/** @page iocsh IOC shell functions
Several IOC shell functions are provided to access PCI and VME devices
@section iocshpci IOCsh functions for PCI devices
- devPCIShow() List PCI devices present
- devLibPCIUse() Select PCI system access implementation
- pcidiagset() Select device for read/write functions
- pciwrite()
- pciread()
- pciconfread()
To use, begin by calling pcidiagset() to select the device and BAR that subsequent
read/write calls will operate on.
@section iocshvme IOCsh functions for VME devices
- vmeread()
- vmewrite()
- vmeirqattach()
- vmeirq()
*/