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 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 Andrewski
/*
2
 * GpibHw.h
3
 *
4
 *  Created on: Feb 9, 2012
5
 *      Author: Andrzej Paluch
6
 */
7
 
8
#include "GpibHwAdapter.h"
9
 
10
#ifndef __GPIB_HW_H__
11
#define __GPIB_HW_H__
12
 
13
/** Encapsulates GPIB hardware issues. */
14
struct GpibHw
15
{
16
        struct GpibHwAdapter *ghwa;
17
        bool writerLastEndOfStream;
18
};
19
 
20
/** Encapsulates GPIB device settings. */
21
struct GpibHwSettings
22
{
23
        bool talkOnly;
24
        bool listenOnly;
25
        char eosMark;
26
        bool eosUsed;
27
        char fixedPpLine;
28
        bool lpeUsed;
29
        bool isLeTe;
30
        char T1;
31
        char address;
32
        u32 secondaryAddressMask;
33
};
34
 
35
/** Encapsulates GPIB device events. */
36
struct GpibHwEvents
37
{
38
        u16 IFC : 1;
39
        u16 ATN : 1;
40
        u16 REN : 1;
41
        u16 stb_received : 1;
42
        u16 ppr : 1;
43
        u16 srq : 1;
44
        u16 cwrd : 1;
45
        u16 cwrc : 1;
46
        u16 spa : 1;
47
        u16 atl : 1;
48
        u16 att : 1;
49
        u16 trg : 1;
50
        u16 clr : 1;
51
        u16 out_ready : 1;
52
        u16 in_ready : 1;
53
        u16 isLocal : 1;
54
};
55
 
56
/** Encapsulates GPIB device status. */
57
struct GpibHwStatus
58
{
59
        u16 isLocal : 1;
60
        u16 spa : 1;
61
        u16 cwrd : 1;
62
        u16 cwrc : 1;
63
        u16 lac : 1;
64
        u16 atl : 1;
65
        u16 tac : 1;
66
        u16 att : 1;
67
        u16 currentSecondaryAddress : 5;
68
};
69
 
70
/** Initializes GpibHw. */
71
bool GpibHw_init(struct GpibHw *gpibHw, struct GpibHwAdapter *ghw);
72
 
73
/** Releases gpib. */
74
void GpibHw_release(struct GpibHw *gpibHw);
75
 
76
 
77
/** Gets GPIB hw settings. */
78
bool GpibHw_getSettings(struct GpibHw *gpibHw, struct GpibHwSettings *settings);
79
 
80
/** Sets GPIB hw settings. */
81
bool GpibHw_setSettings(struct GpibHw *gpibHw, struct GpibHwSettings *settings);
82
 
83
 
84
/** Gets GPIB hw event status. */
85
bool GpibHw_getEventStatus(struct GpibHw *gpibHw, struct GpibHwEvents *events);
86
 
87
 
88
/** Gets GPIB hw status. */
89
bool GpibHw_getGpibStatus(struct GpibHw *gpibHw, struct GpibHwStatus *status);
90
 
91
 
92
/** Controls rsc signal. */
93
bool GpibHw_requestSystemControl(struct GpibHw *gpibHw, bool value);
94
 
95
/** Controls sic signal. */
96
bool GpibHw_systemInterfaceClear(struct GpibHw *gpibHw, bool value);
97
 
98
/** Controls sre signal. */
99
bool GpibHw_sendRemoteEnable(struct GpibHw *gpibHw, bool value);
100
 
101
/** Controls gts line. */
102
bool GpibHw_goToStandby(struct GpibHw *gpibHw, bool value);
103
 
104
/** Controls tca signal. */
105
bool GpibHw_takeControlAsynchronously(struct GpibHw *gpibHw, bool value);
106
 
107
/** Controls tcs signal. */
108
bool GpibHw_takeControlSynchronously(struct GpibHw *gpibHw, bool value);
109
 
110
/** Controls rpp signal. */
111
bool GpibHw_requestParallelPoll(struct GpibHw *gpibHw, bool value);
112
 
113
/** Controls rec_stb signal. */
114
bool GpibHw_receiveStatusByte(struct GpibHw *gpibHw, bool value);
115
 
116
/** Controls lpe signal. */
117
bool GpibHw_localPollEnable(struct GpibHw *gpibHw, bool value);
118
 
119
/** Controls ist signal. */
120
bool GpibHw_setIndividualStatus(struct GpibHw *gpibHw, bool value);
121
 
122
/** Controls rsv signal. */
123
bool GpibHw_requestService(struct GpibHw *gpibHw, bool value);
124
 
125
/** Controls rtl signal. */
126
bool GpibHw_returnToLocal(struct GpibHw *gpibHw, bool value);
127
 
128
/** Sets local listen unlisten state by control of lines ltn and lun. */
129
bool GpibHw_setLocalListenUnlisten(struct GpibHw *gpibHw, bool ltn, bool lun);
130
 
131
/** Gets bytes available in reader fifo. */
132
bool GpibHw_availableBytesToRead(struct GpibHw *gpibHw, SizeType *len);
133
 
134
/** Reads bytes from reader fifo. */
135
bool GpibHw_read(struct GpibHw *gpibHw, char *buf, SizeType bufLen,
136
                SizeType *bytesRead, bool *endOfStream);
137
 
138
/** Gets bytes count in writer fifo. */
139
bool GpibHw_bytesInWriterFifo(struct GpibHw *gpibHw, SizeType *count);
140
 
141
/** Writes bytes to writer fifo. */
142
bool GpibHw_write(struct GpibHw *gpibHw, char *buf, SizeType bufLen,
143
                SizeType *bytesWritten, bool endOfStream);
144
 
145
 
146
#endif /* __GPIB_HW_H__ */

powered by: WebSVN 2.1.0

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