summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-07 08:46:16 -0500
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-07 08:46:16 -0500
commit2adb381c85f6d582dad97b966ef5c991ba71480a (patch)
treeb91f88525ecf5c2cd5c6ffe3568493bc80c6b578
parent1091e4ee86e7ebda7a262affbf52899a0e5311b5 (diff)
remove cruft macros from gpib.c for clarity
-rw-r--r--gpib.c56
1 files changed, 22 insertions, 34 deletions
diff --git a/gpib.c b/gpib.c
index 127ffa1..2669135 100644
--- a/gpib.c
+++ b/gpib.c
@@ -12,16 +12,13 @@
#define max_gpib_input_length 512
-#define READ_EOS_BYTE 0x00 /* EOS byte for reads/inputs/receives*/
-#define WRITE_EOS_BYTE 0x00 /* EOS byte for writes/outputs/sends */
+#define READ_EOS_BYTE 0x00 /* EOS byte for reads/inputs/receives*/
+#define WRITE_EOS_BYTE 0x00 /* EOS byte for writes/outputs/sends */
#define USE_EIGHT_BIT_EOS_COMPARE NO /* Compare EOS byte 7 or 8 bits */
#define USE_TRANSMIT_EOI_WITH_EOS NO /* Send EOI with EOS byte (writes) */
-#define USE_HIGH_SPEED_T1 NO /* Short T1 delay while doing three wire handshaking */
+#define USE_HIGH_SPEED_T1 NO /* Short T1 delay while doing three wire handshaking */
-/* Miscellaneous Handlers */
-#define USE_SPOLL_BIT NO /* STBO (SPOLL) - Serial Poll */
-
/* TNT Hardware Parameters */
#define TNT_BASE_ADDRESS 0x4100 /* Board Base I/O address */
@@ -29,28 +26,28 @@
/* TNT Constants ------------------------------------------------------------*/
#define YES 1
-#define ENABLE 1
+#define ENABLE 1
#define SET 1
#define NO 0
-#define NONE 0
-#define DISABLE 0
-#define CLEAR 0
-#define INPUT 4
+#define NONE 0
+#define DISABLE 0
+#define CLEAR 0
+#define INPUT 4
#define INPUT_BYTE 16
-#define OUTPUT 2
+#define OUTPUT 2
#define INTERFACE 1
/* Interface Status Constants */
-#define ERR (1<<15)
+#define ERR (1<<15)
#define TIMO (1<<14)
-#define END (1<<13)
-#define EOS (1<<12)
-#define RQS (1<<11)
-#define IFC (1<<10)
+#define END (1<<13)
+#define EOS (1<<12)
+#define RQS (1<<11)
+#define IFC (1<<10)
#define SPOLL (1<<9)
#define UCMPL (1<<8)
-#define LOK (1<<7)
-#define REM (1<<6)
+#define LOK (1<<7)
+#define REM (1<<6)
#define ASYNC (1<<5)
#define DTAS (1<<4)
#define DCAS (1<<3)
@@ -59,7 +56,7 @@
#define NACS (1<<0)
#define SYNC 0
#define NONE 0
-#define EOI END
+#define EOI END
/* Error Codes */
@@ -112,7 +109,7 @@
#define B_rem (1<<4)
#define R_isr3 0x1a
-#define B_x (1<<7)
+#define B_x (1<<7)
#define B_intsrc2 (1<<6)
#define B_nff (1<<3)
#define B_nef (1<<2)
@@ -134,7 +131,7 @@
#define R_admr 0x08
-#define F_noaddress 0x30
+#define F_noaddress 0x30
#define F_normalprimary 0x31
#define R_adr 0x0c
@@ -168,8 +165,6 @@
#define F_clrERR 0x57
/* Hidden Auxillary Registers */
-#define B_u (1<<4)
-#define B_s (1<<3)
#define HR_auxra 0x80
#define F_normal 0x00
@@ -186,9 +181,6 @@
#define HR_auxrb 0xa0
#define B_hst1 (1<<2)
-#define HR_auxre 0xc0
-#define B_dhdc (1<<0)
-
#define HR_auxri 0xe0
#define B_ustd (1<<3)
@@ -217,8 +209,6 @@
#define F_input_config (B_in|B_tmoe|B_timbytn|B_ccen|B_8bit)
#define F_output_config (B_tmoe|B_timbytn|B_8bit)
-#define R_dsr 0x11
-
#define R_hssel 0x0d
#define B_go2sids (1<<5)
#define F_onechip 0x01
@@ -229,14 +219,12 @@
#define R_fifob 0x18
#define R_sasr 0x1b
-
#define R_cmdr 0x1c
#define F_softreset 0x22
#define F_resetfifo 0x10
#define F_stop 0x08
#define F_go 0x04
-#define R_bsr 0x1f
/* --------------------------------------------------------------------------*/
@@ -467,10 +455,10 @@ void GPIB_initialize(void)
static void TNT_Adr_Mode()
{
TNT_Out(R_admr,F_noaddress); /* Clear address mode */
- TNT_Out(R_adr,B_dt|B_dl); /* Disable talk & listener */
+ TNT_Out(R_adr,B_dt|B_dl); /* Disable talk & listener */
TNT_Out(R_adr,B_ars|B_dt|B_dl); /* capabilities */
- TNT_Out(R_auxmr,F_lut); /* Untalk TNT4882 */
- TNT_Out(R_auxmr,F_lul); /* Unlisten TNT4882 */
+ TNT_Out(R_auxmr,F_lut); /* Untalk TNT4882 */
+ TNT_Out(R_auxmr,F_lul); /* Unlisten TNT4882 */
TNT_Out(R_admr,F_normalprimary); /* Set single primary address mode*/
}