OpenCores
URL https://opencores.org/ocsvn/gpib_controller/gpib_controller/trunk

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [prototype_1/] [PC_software/] [gpib_src/] [GpibHw.h] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 Andrewski
/*
2 12 Andrewski
*This file is part of fpga_gpib_controller.
3
*
4
* Fpga_gpib_controller is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* Fpga_gpib_controller is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with Fpga_gpib_controller.  If not, see <http://www.gnu.org/licenses/>.
16
*/
17
/*
18 3 Andrewski
 * GpibHw.h
19
 *
20
 *  Created on: Feb 9, 2012
21
 *      Author: Andrzej Paluch
22
 */
23
 
24
#include "GpibHwAdapter.h"
25
 
26
#ifndef __GPIB_HW_H__
27
#define __GPIB_HW_H__
28
 
29
/** Encapsulates GPIB hardware issues. */
30
struct GpibHw
31
{
32
        struct GpibHwAdapter *ghwa;
33
        bool writerLastEndOfStream;
34
};
35
 
36
/** Encapsulates GPIB device settings. */
37
struct GpibHwSettings
38
{
39
        bool talkOnly;
40
        bool listenOnly;
41
        char eosMark;
42
        bool eosUsed;
43
        char fixedPpLine;
44
        bool lpeUsed;
45
        bool isLeTe;
46
        char T1;
47
        char address;
48
        u32 secondaryAddressMask;
49
};
50
 
51
/** Encapsulates GPIB device events. */
52
struct GpibHwEvents
53
{
54
        u16 IFC : 1;
55
        u16 ATN : 1;
56
        u16 REN : 1;
57
        u16 stb_received : 1;
58
        u16 ppr : 1;
59
        u16 srq : 1;
60
        u16 cwrd : 1;
61
        u16 cwrc : 1;
62
        u16 spa : 1;
63
        u16 atl : 1;
64
        u16 att : 1;
65
        u16 trg : 1;
66
        u16 clr : 1;
67
        u16 out_ready : 1;
68
        u16 in_ready : 1;
69
        u16 isLocal : 1;
70
};
71
 
72
/** Encapsulates GPIB device status. */
73
struct GpibHwStatus
74
{
75
        u16 isLocal : 1;
76
        u16 spa : 1;
77
        u16 cwrd : 1;
78
        u16 cwrc : 1;
79
        u16 lac : 1;
80
        u16 atl : 1;
81
        u16 tac : 1;
82
        u16 att : 1;
83
        u16 currentSecondaryAddress : 5;
84
};
85
 
86
/** Initializes GpibHw. */
87
bool GpibHw_init(struct GpibHw *gpibHw, struct GpibHwAdapter *ghw);
88
 
89
/** Releases gpib. */
90
void GpibHw_release(struct GpibHw *gpibHw);
91
 
92
 
93
/** Gets GPIB hw settings. */
94
bool GpibHw_getSettings(struct GpibHw *gpibHw, struct GpibHwSettings *settings);
95
 
96
/** Sets GPIB hw settings. */
97
bool GpibHw_setSettings(struct GpibHw *gpibHw, struct GpibHwSettings *settings);
98
 
99
 
100
/** Gets GPIB hw event status. */
101
bool GpibHw_getEventStatus(struct GpibHw *gpibHw, struct GpibHwEvents *events);
102
 
103
 
104
/** Gets GPIB hw status. */
105
bool GpibHw_getGpibStatus(struct GpibHw *gpibHw, struct GpibHwStatus *status);
106
 
107
 
108
/** Controls rsc signal. */
109
bool GpibHw_requestSystemControl(struct GpibHw *gpibHw, bool value);
110
 
111
/** Controls sic signal. */
112
bool GpibHw_systemInterfaceClear(struct GpibHw *gpibHw, bool value);
113
 
114
/** Controls sre signal. */
115
bool GpibHw_sendRemoteEnable(struct GpibHw *gpibHw, bool value);
116
 
117
/** Controls gts line. */
118
bool GpibHw_goToStandby(struct GpibHw *gpibHw, bool value);
119
 
120
/** Controls tca signal. */
121
bool GpibHw_takeControlAsynchronously(struct GpibHw *gpibHw, bool value);
122
 
123
/** Controls tcs signal. */
124
bool GpibHw_takeControlSynchronously(struct GpibHw *gpibHw, bool value);
125
 
126
/** Controls rpp signal. */
127
bool GpibHw_requestParallelPoll(struct GpibHw *gpibHw, bool value);
128
 
129
/** Controls rec_stb signal. */
130
bool GpibHw_receiveStatusByte(struct GpibHw *gpibHw, bool value);
131
 
132
/** Controls lpe signal. */
133
bool GpibHw_localPollEnable(struct GpibHw *gpibHw, bool value);
134
 
135
/** Controls ist signal. */
136
bool GpibHw_setIndividualStatus(struct GpibHw *gpibHw, bool value);
137
 
138
/** Controls rsv signal. */
139
bool GpibHw_requestService(struct GpibHw *gpibHw, bool value);
140
 
141
/** Controls rtl signal. */
142
bool GpibHw_returnToLocal(struct GpibHw *gpibHw, bool value);
143
 
144
/** Sets local listen unlisten state by control of lines ltn and lun. */
145
bool GpibHw_setLocalListenUnlisten(struct GpibHw *gpibHw, bool ltn, bool lun);
146
 
147
/** Gets bytes available in reader fifo. */
148
bool GpibHw_availableBytesToRead(struct GpibHw *gpibHw, SizeType *len);
149
 
150
/** Reads bytes from reader fifo. */
151
bool GpibHw_read(struct GpibHw *gpibHw, char *buf, SizeType bufLen,
152
                SizeType *bytesRead, bool *endOfStream);
153
 
154
/** Gets bytes count in writer fifo. */
155
bool GpibHw_bytesInWriterFifo(struct GpibHw *gpibHw, SizeType *count);
156
 
157
/** Writes bytes to writer fifo. */
158
bool GpibHw_write(struct GpibHw *gpibHw, char *buf, SizeType bufLen,
159
                SizeType *bytesWritten, bool endOfStream);
160
 
161
 
162
#endif /* __GPIB_HW_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.