/* header information for low speed hpib disk driver */ /* command macros */ #define lh_auxcommand lh_wrtptr->t_aux_cmd #define lh_intmask0 lh_wrtptr->t_i_msk0 #define lh_intmask1 lh_wrtptr->t_i_msk1 #define lh_serialpoll lh_wrtptr->t_serial_poll_resp #define lh_parapoll lh_wrtptr->t_parallel_poll_resp #define lh_commandpass lh_readptr->t_cmd_pass_thru #define lh_dataout lh_wrtptr->t_data_out #define lh_instat0 lh_readptr->t_i_st0 #define lh_instat1 lh_readptr->t_i_st1 #define lh_ienab lh_wrtptr->t_int_dma_stat #define lh_busstat lh_readptr->t_bus_stat #define lh_datain lh_readptr->t_data_in #define lh_addrstat lh_readptr->t_bus_ctl_addr_stat /* parameters for the HPIB commands macros and aids */ #define LH_END 0x08 /* end of data indicator in instat0 */ #define BYTEOUT 0x10 /* interface ready to accept next data */ #define BYTEIN 0x20 /* data byte accepted */ #define BYTE_TIMEOUT 100000 /* time to wait for a byte to come in /* or go out on the hpib bus */ /* place to put garbage when clearing datain */ char trash; /* defines for detecting the attention state */ #define lh_atn 0x80 #define lh_atn_on (lh_busstat & lh_atn) /* HPIB command macros and aids */ #define lh_data if (lh_atn_on) {lh_auxcommand = cmdrhdf; lh_auxcommand = cmdgts; } /* turn off ATN */ #define lh_cmd if (!(lh_atn_on)) {lh_auxcommand = cmdtca; lh_waitout( LH_DIE );} /* ATN on */ #define lh_eoi lh_auxcommand = cmdfeoi /* set eoi with next data byte */ #define lh_ltnself lh_auxcommand = cmdlon1 /* set self as listener */ #define lh_tlkself lh_auxcommand = cmdton1 /* set self as talker */ #define lh_unltnself lh_auxcommand = cmdlon0 /* unlisten self */ #define lh_untlkself lh_auxcommand = cmdton0 /* untalk self */ #define lh_unlisten lh_cmd; lh_out( H_UNL ); lh_unltnself; /* unlisten all */ #define lh_untalk lh_cmd; lh_out( H_UNT ); lh_untlkself; /* untalk all */ #define lh_shutup lh_untalk; lh_out( H_UNL ); lh_unltnself; #define lh_ltnadr( lh_unit ) lh_unit | H_DLAC /* put together full listen HPIB addr */ #define lh_tlkadr( lh_unit ) lh_unit | H_DTAC /* put together full talker HPIB addr */ /* set up for sending bytes over HPIB */ #define lh_inbound( lh_unit ) lh_cmd; lh_out( H_PLA ); lh_ltnself; lh_out( lh_tlkadr( lh_unit ) ); lh_wait() /* set up for receiving bytes over HPIB */ #define lh_otbound( lh_unit ) lh_cmd; lh_out( H_PTA ); lh_tlkself; lh_out( lh_ltnadr( lh_unit ) ); lh_wait() /* macro to send data over the bus (panic if there is a timelh_out) */ #define lh_out( lh_item ) lh_dataout=lh_item; lh_waitout( LH_DIE ) #define lh_cleardata trash = lh_datain /* clear out datain register */