head     56.3;
access   paws bayes jws quist brad dew jwh;
symbols  ;
locks    ; strict;
comment  @# @;


56.3
date     93.01.27.13.25.39;  author jwh;  state Exp;
branches ;
next     56.2;

56.2
date     93.01.27.12.04.33;  author jwh;  state Exp;
branches ;
next     56.1;

56.1
date     91.11.05.09.45.15;  author jwh;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.23.08;  author jwh;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.26.42;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.27.47;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.11.46;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.16.11.22;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.26.11;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.10.28;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.16.31;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.10.59.10;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.46.21;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.54.08;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.22.11.19;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.14.03.05;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.47.58;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.30.04;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.52.08;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.36.21;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.28.25;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.40.49;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.19.11;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.34.02;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.16.09.04;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.41.11;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.49.39;  author bayes;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.18.10.51;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.47.48;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.32.43;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.10.59.43;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.34.18;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.13.14.14;  author bayes;  state Exp;
branches ;
next     25.1;

25.1
date     88.03.02.09.30.41;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     87.08.31.09.51.18;  author jws;  state Exp;
branches ;
next     23.1;

23.1
date     87.08.26.10.28.50;  author bayes;  state Exp;
branches ;
next     22.2;

22.2
date     87.08.25.19.36.07;  author jws;  state Exp;
branches ;
next     22.1;

22.1
date     87.08.17.11.15.34;  author bayes;  state Exp;
branches ;
next     21.1;

21.1
date     87.08.12.13.57.44;  author bayes;  state Exp;
branches ;
next     20.1;

20.1
date     87.07.30.11.10.48;  author bayes;  state Exp;
branches ;
next     19.1;

19.1
date     87.06.01.08.26.27;  author jws;  state Exp;
branches ;
next     18.1;

18.1
date     87.05.20.15.25.29;  author bayes;  state Exp;
branches ;
next     17.1;

17.1
date     87.04.30.10.37.02;  author jws;  state Exp;
branches ;
next     16.1;

16.1
date     87.04.26.15.49.02;  author jws;  state Exp;
branches ;
next     15.1;

15.1
date     87.04.13.09.24.06;  author jws;  state Exp;
branches ;
next     14.1;

14.1
date     87.04.01.15.29.20;  author jws;  state Exp;
branches ;
next     13.1;

13.1
date     87.02.28.18.34.20;  author jws;  state Exp;
branches ;
next     12.1;

12.1
date     87.02.02.13.25.03;  author jws;  state Exp;
branches ;
next     11.1;

11.1
date     87.01.19.09.51.31;  author jws;  state Exp;
branches ;
next     10.1;

10.1
date     86.12.24.11.00.02;  author jws;  state Exp;
branches ;
next     9.1;

9.1
date     86.12.12.14.41.53;  author bayes;  state Exp;
branches ;
next     8.1;

8.1
date     86.11.27.11.58.06;  author jws;  state Exp;
branches ;
next     7.1;

7.1
date     86.11.20.13.47.40;  author hal;  state Exp;
branches ;
next     6.1;

6.1
date     86.11.04.18.00.08;  author paws;  state Exp;
branches ;
next     5.1;

5.1
date     86.10.28.16.49.17;  author hal;  state Exp;
branches ;
next     4.1;

4.1
date     86.09.30.19.49.03;  author hal;  state Exp;
branches ;
next     3.1;

3.1
date     86.09.01.11.59.06;  author hal;  state Exp;
branches ;
next     2.1;

2.1
date     86.07.30.14.46.14;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.06.30.15.12.45;  author danm;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.3
log
@
pws2rcs automatic delta on Wed Jan 27 13:14:25 MST 1993
@
text
@					      (*

 (c) Copyright Hewlett-Packard Company, 1985.
All rights are reserved.  Copying or other
reproduction of this program except for archival
purposes is prohibited without the prior
written consent of Hewlett-Packard Company.


	    RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government
is subject to restrictions as set forth in
paragraph (b) (3) (B) of the Rights in Technical
Data and Computer Software clause in
DAR 7-104.9(a).

HEWLETT-PACKARD COMPANY
Fort Collins, Colorado                         *)


$MODCAL ON$
$PARTIAL_EVAL ON$
$STACKCHECK ON$
$RANGE OFF$
$DEBUG OFF$
$OVFLCHECK OFF$
$PAGE$

(************************************************************************)
(*                                                                      *)
(*          RELEASED        VERSION         3.1                         *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      IOLIB           HPIB_DRIVERS                                    *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      library      -  IOLIB                                           *)
(*      name         -  HPIB_DRIVERS                                    *)
(*      module(s)    -  h_drv                                           *)
(*                   -  hpib                                            *)
(*                                                                      *)
(*      author       -  Tim Mikkelsen                                   *)
(*      phone        -  303-226-3800   ext. 2910                        *)
(*                                                                      *)
(*      date         -  June  1 , 1981                                  *)
(*      update       -  Aug   1 , 1983                                  *)
(*      release      -  Jul   12, 1985                                  *)
(*                                                                      *)
(*      source       -  IOLIB:H_DRV.TEXT                                *)
(*      object       -  IOLIB:H_DRV.CODE                                *)
(*                                                                      *)
(************************************************************************)
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      BUG FIX HISTORY         - after release                         *)
(*                                                                      *)
(*                                                                      *)
(*      BUG #   BY  / ON        LOC             DESCRIPTION             *)
(*      -----   -----------     --------------  ----------------------  *)
(*                                                                      *)
(*      367     T Mikkelsen     hpib_initialize Allow eXecute of driver *)
(*              09/22/82                        and have it install     *)
(*                                              itself in the system.   *)
(*                                                                      *)
(************************************************************************)

$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      This is the source code for an external procedures library      *)
(*      to be used for general purpose interfacing on the HP 9826.      *)
(*                                                                      *)
(*      The library consists of 3 primary sets of modules -             *)
(*                                                                      *)
(*              1.      KERNEL modules                                  *)
(*              2.      driver modules                                  *)
(*              3.      IOLIB  modules                                  *)
(*                                                                      *)
(*      The KERNEL modules consist of the following modules -           *)
(*                                                                      *)
(*              1.      iodeclarations  ( contains static r/w space )   *)
(*              2.      iocomasm                                        *)
(*              3.      general_0       ( initialization & low level    *)
(*                                        routines like ioread/iowrite) *)
(*      The KERNEL modules also have an executable program segement     *)
(*      that gets executed at the time it is loaded.  This program      *)
(*      initializes the static read/write memory.  This program also    *)
(*      allocates the temporary storage for any card that exists -      *)
(*      independent of whether there is or is not a driver for it.      *)
(*                                                                      *)
(*      The driver modules consist of the actual assembly or PASCAL     *)
(*      routines that deal with a specific interface card.  There is    *)
(*      also an executable program segment for each driver module.      *)
(*      This program searches the select code table in the static r/w   *)
(*      initialized by the KERNEL general_0 module for all select codes *)
(*      that have the right interface card ( HPIB drivers will search   *)
(*      for the 98624 interface ).  This program will then set up the   *)
(*      driver tables to point to the correct drivers.                  *)
(*                                                                      *)
(*      The rest of the IOLIB modules are high-level modules that are   *)
(*      used by an end user in his/her application program.             *)
(*                                                                      *)
(*      The KERNEL and some set of driver modules will exist in the     *)
(*      SYSTEM.INITLIB file as object code ( not EXPORT text ).  The    *)
(*      export text will reside on the SYSTEM.LIBRARY file.  The rest   *)
(*      of the library will reside on the SYSTEM.LIBRARY.               *)
(*                                                                      *)
(************************************************************************)
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      REFERENCES :                                                    *)
(*                                                                      *)
(*                                                                      *)
(*      1.  9826 I/O Designers Guide            ( Loyd Nelson )         *)
(*                                                                      *)
(*      2.  68000 Manual                        ( Motorola )            *)
(*                                                                      *)
(*      3.  Pascal alpha site ERS               ( Roger Ison )          *)
(*                                                                      *)
(*      4.  Pascal I/O Library ERS              ( Tim Mikkelsen )       *)
(*                                                                      *)
(*      5.  9826 HPL EIO & IOD listings         ( Bob Hallissy )        *)
(*                                                                      *)
(*      6.  9826 HPL Misc. I/O Doc.             ( Bob Hallissy )        *)
(*                                                                      *)
(*      7.  9826 card documentation             ( Mfg. Specs. )         *)
(*                                                                      *)
(*      8.  Pascal I/O Library IRS              ( Tim Mikkelsen )       *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
$PAGE$
PROGRAM hpib_initialize ( INPUT , OUTPUT );


	{ This module has a program segment so that there is
	  an executable entry point into the module.
	  At INITLIB time this program is executed. }
$PAGE$
EXTERNAL MODULE exth;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  10/02/81

	  purpose This module is a declaration of the importation text for
		  the external drivers.

	  note    The assembly language code that is imported needs to be
		  called 'exth'.  The routines need to be called
		  'exth_@@@@@@@@@@@@' - eh_init referenced below would be
		  exth_eh_init.  'eh' refers to external HP-IB.
	}

IMPORT  $SEARCH 'IOLIB:KERNEL.CODE'$
	sysglobals , iodeclarations ;

EXPORT

  PROCEDURE eh_init  ( temp : ANYPTR );
  PROCEDURE eh_isr   ( temp : PISRIB );
  PROCEDURE eh_rdb   ( temp : ANYPTR ;  VAR x : CHAR);
  PROCEDURE eh_wtb   ( temp : ANYPTR ;  val   : CHAR);
  PROCEDURE eh_rdw   ( temp : ANYPTR ;  VAR x : io_word);
  PROCEDURE eh_wtw   ( temp : ANYPTR ;  val   : io_word);
  PROCEDURE eh_rds   ( temp : ANYPTR ;  reg   : io_word;
					VAR x : io_word);
  PROCEDURE eh_wtc   ( temp : ANYPTR ;  reg   : io_word;
					val   : io_word );
  PROCEDURE eh_tfr   ( temp : ANYPTR ;  bcb   : ANYPTR );
  PROCEDURE eh_send  ( temp : ANYPTR ;  val   : CHAR );
  PROCEDURE eh_ppoll ( temp : ANYPTR ;  VAR x : CHAR );
  PROCEDURE eh_clr   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eh_set   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eh_test  ( temp : ANYPTR ;  line  : io_bit ;
					VAR x : BOOLEAN );
  PROCEDURE eh_end   ( temp : ANYPTR ;  VAR x : BOOLEAN );

END; { of exth }
$PAGE$


MODULE init_hpib;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  12/16/82
		   8/01/83   JS  change rev number

	  purpose This module initializes the HPIB drivers.

	}

IMPORT    iodeclarations ;


EXPORT
  VAR
    hpib_drivers  : drv_table_type;


  PROCEDURE io_init_hpib;


IMPLEMENT

  IMPORT  sysglobals ,
	  isr ,
	  general_0 ,
	  exth ;


  PROCEDURE io_init_hpib;
  VAR
    io_isc        : type_isc;
    dummy         : INTEGER;
    io_lvl        : io_byte;
  BEGIN

    io_revid := io_revid + ' H3.2';     { HPIB revision added 2/5/82 TM }

    { set up the driver tables }

    WITH hpib_drivers DO BEGIN
      hpib_drivers := dummy_drivers;
      iod_init  := eh_init;
      iod_isr   := eh_isr;
      iod_rdb   := eh_rdb;
      iod_wtb   := eh_wtb;
      iod_rdw   := eh_rdw;
      iod_wtw   := eh_wtw;
      iod_rds   := eh_rds;
      iod_wtc   := eh_wtc;
      iod_end   := eh_end;
      iod_tfr   := eh_tfr;
      iod_send  := eh_send;
      iod_ppoll := eh_ppoll;
      iod_set   := eh_set;
      iod_clr   := eh_clr;
      iod_test  := eh_test;
    END; { of WITH }


    { set up drivers for the interfaces }

    FOR io_isc:=iominisc TO iomaxisc DO
      WITH isc_table[io_isc] DO BEGIN

	IF ( card_id = hp98624 ) OR
	   ( card_id = internal_hpib)
	  THEN BEGIN

	    io_drv_ptr:=ADDR(hpib_drivers);

	    WITH io_drv_ptr^, io_tmp_ptr^ DO BEGIN
	      IF io_isc=7
		THEN BEGIN
		  io_lvl := 3;
		END
		ELSE BEGIN
		  io_lvl:=((ioread_byte(io_isc,3) DIV 16) MOD 4)+3;
		END; { of IF }

	      { if the card exists then link in an ISR for it }
	      { ??? - what happens if an ISR fires during init }

	      IF myisrib.INTREGADDR <> NIL
		THEN BEGIN
		  { remove any existant isr }
		  ISRUNLINK(io_lvl,               { interrupt level       }
			    addr(myisrib));       { ptr to the isrib      }
		END; { of IF }

	      PERMISRLINK(iod_isr,                        { isr           }
		      ANYPTR(INTEGER(card_ptr)+3),        { int reg addr  }
		      192,                                { int reg mask  }
		      192,                                { int reg value }
		      io_lvl,                             { int level     }
		      ADDR(myisrib));                     { isrib info    }
	    END; { of WITH // DO BEGIN }

	  END; { of IF card_id }

      END; { of FOR io_isc WITH isc_table[io_isc] BEGIN }


    { call the actual driver initialization }

    { this is seperate from the set up stuff in case
      there are 2 or more cards connected - and generate
      an isr }

    FOR io_isc:=iominisc TO iomaxisc DO
      WITH isc_table[io_isc] DO
      IF ( card_id = hp98624 ) OR ( card_id = internal_hpib )
	THEN BEGIN
	  CALL(io_drv_ptr^.iod_init , io_tmp_ptr);
	END; { of WITH IF }


  END; { of io_init_hpib }

END; { of MODULE init_hpib }
$PAGE$

IMPORT    init_hpib ,
	  LOADER ;                                              { 367 TM 9/22/82 }


BEGIN
  io_init_hpib;
  MARKUSER;                                                     { 367 TM 9/22/82 }
END. { of hpib_initialize }
@


56.2
log
@
pws2rcs automatic delta on Wed Jan 27 11:57:27 MST 1993
@
text
@d1 322
@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@a0 322
					      (*

 (c) Copyright Hewlett-Packard Company, 1985.
All rights are reserved.  Copying or other
reproduction of this program except for archival
purposes is prohibited without the prior
written consent of Hewlett-Packard Company.


	    RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government
is subject to restrictions as set forth in
paragraph (b) (3) (B) of the Rights in Technical
Data and Computer Software clause in
DAR 7-104.9(a).

HEWLETT-PACKARD COMPANY
Fort Collins, Colorado                         *)


$MODCAL ON$
$PARTIAL_EVAL ON$
$STACKCHECK ON$
$RANGE OFF$
$DEBUG OFF$
$OVFLCHECK OFF$
$PAGE$

(************************************************************************)
(*                                                                      *)
(*          RELEASED        VERSION         3.1                         *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      IOLIB           HPIB_DRIVERS                                    *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      library      -  IOLIB                                           *)
(*      name         -  HPIB_DRIVERS                                    *)
(*      module(s)    -  h_drv                                           *)
(*                   -  hpib                                            *)
(*                                                                      *)
(*      author       -  Tim Mikkelsen                                   *)
(*      phone        -  303-226-3800   ext. 2910                        *)
(*                                                                      *)
(*      date         -  June  1 , 1981                                  *)
(*      update       -  Aug   1 , 1983                                  *)
(*      release      -  Jul   12, 1985                                  *)
(*                                                                      *)
(*      source       -  IOLIB:H_DRV.TEXT                                *)
(*      object       -  IOLIB:H_DRV.CODE                                *)
(*                                                                      *)
(************************************************************************)
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      BUG FIX HISTORY         - after release                         *)
(*                                                                      *)
(*                                                                      *)
(*      BUG #   BY  / ON        LOC             DESCRIPTION             *)
(*      -----   -----------     --------------  ----------------------  *)
(*                                                                      *)
(*      367     T Mikkelsen     hpib_initialize Allow eXecute of driver *)
(*              09/22/82                        and have it install     *)
(*                                              itself in the system.   *)
(*                                                                      *)
(************************************************************************)

$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      This is the source code for an external procedures library      *)
(*      to be used for general purpose interfacing on the HP 9826.      *)
(*                                                                      *)
(*      The library consists of 3 primary sets of modules -             *)
(*                                                                      *)
(*              1.      KERNEL modules                                  *)
(*              2.      driver modules                                  *)
(*              3.      IOLIB  modules                                  *)
(*                                                                      *)
(*      The KERNEL modules consist of the following modules -           *)
(*                                                                      *)
(*              1.      iodeclarations  ( contains static r/w space )   *)
(*              2.      iocomasm                                        *)
(*              3.      general_0       ( initialization & low level    *)
(*                                        routines like ioread/iowrite) *)
(*      The KERNEL modules also have an executable program segement     *)
(*      that gets executed at the time it is loaded.  This program      *)
(*      initializes the static read/write memory.  This program also    *)
(*      allocates the temporary storage for any card that exists -      *)
(*      independent of whether there is or is not a driver for it.      *)
(*                                                                      *)
(*      The driver modules consist of the actual assembly or PASCAL     *)
(*      routines that deal with a specific interface card.  There is    *)
(*      also an executable program segment for each driver module.      *)
(*      This program searches the select code table in the static r/w   *)
(*      initialized by the KERNEL general_0 module for all select codes *)
(*      that have the right interface card ( HPIB drivers will search   *)
(*      for the 98624 interface ).  This program will then set up the   *)
(*      driver tables to point to the correct drivers.                  *)
(*                                                                      *)
(*      The rest of the IOLIB modules are high-level modules that are   *)
(*      used by an end user in his/her application program.             *)
(*                                                                      *)
(*      The KERNEL and some set of driver modules will exist in the     *)
(*      SYSTEM.INITLIB file as object code ( not EXPORT text ).  The    *)
(*      export text will reside on the SYSTEM.LIBRARY file.  The rest   *)
(*      of the library will reside on the SYSTEM.LIBRARY.               *)
(*                                                                      *)
(************************************************************************)
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      REFERENCES :                                                    *)
(*                                                                      *)
(*                                                                      *)
(*      1.  9826 I/O Designers Guide            ( Loyd Nelson )         *)
(*                                                                      *)
(*      2.  68000 Manual                        ( Motorola )            *)
(*                                                                      *)
(*      3.  Pascal alpha site ERS               ( Roger Ison )          *)
(*                                                                      *)
(*      4.  Pascal I/O Library ERS              ( Tim Mikkelsen )       *)
(*                                                                      *)
(*      5.  9826 HPL EIO & IOD listings         ( Bob Hallissy )        *)
(*                                                                      *)
(*      6.  9826 HPL Misc. I/O Doc.             ( Bob Hallissy )        *)
(*                                                                      *)
(*      7.  9826 card documentation             ( Mfg. Specs. )         *)
(*                                                                      *)
(*      8.  Pascal I/O Library IRS              ( Tim Mikkelsen )       *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
$PAGE$
PROGRAM hpib_initialize ( INPUT , OUTPUT );


	{ This module has a program segment so that there is
	  an executable entry point into the module.
	  At INITLIB time this program is executed. }
$PAGE$
EXTERNAL MODULE exth;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  10/02/81

	  purpose This module is a declaration of the importation text for
		  the external drivers.

	  note    The assembly language code that is imported needs to be
		  called 'exth'.  The routines need to be called
		  'exth_@@@@@@@@@@@@' - eh_init referenced below would be
		  exth_eh_init.  'eh' refers to external HP-IB.
	}

IMPORT  $SEARCH 'IOLIB:KERNEL.CODE'$
	sysglobals , iodeclarations ;

EXPORT

  PROCEDURE eh_init  ( temp : ANYPTR );
  PROCEDURE eh_isr   ( temp : PISRIB );
  PROCEDURE eh_rdb   ( temp : ANYPTR ;  VAR x : CHAR);
  PROCEDURE eh_wtb   ( temp : ANYPTR ;  val   : CHAR);
  PROCEDURE eh_rdw   ( temp : ANYPTR ;  VAR x : io_word);
  PROCEDURE eh_wtw   ( temp : ANYPTR ;  val   : io_word);
  PROCEDURE eh_rds   ( temp : ANYPTR ;  reg   : io_word;
					VAR x : io_word);
  PROCEDURE eh_wtc   ( temp : ANYPTR ;  reg   : io_word;
					val   : io_word );
  PROCEDURE eh_tfr   ( temp : ANYPTR ;  bcb   : ANYPTR );
  PROCEDURE eh_send  ( temp : ANYPTR ;  val   : CHAR );
  PROCEDURE eh_ppoll ( temp : ANYPTR ;  VAR x : CHAR );
  PROCEDURE eh_clr   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eh_set   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eh_test  ( temp : ANYPTR ;  line  : io_bit ;
					VAR x : BOOLEAN );
  PROCEDURE eh_end   ( temp : ANYPTR ;  VAR x : BOOLEAN );

END; { of exth }
$PAGE$


MODULE init_hpib;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  12/16/82
		   8/01/83   JS  change rev number

	  purpose This module initializes the HPIB drivers.

	}

IMPORT    iodeclarations ;


EXPORT
  VAR
    hpib_drivers  : drv_table_type;


  PROCEDURE io_init_hpib;


IMPLEMENT

  IMPORT  sysglobals ,
	  isr ,
	  general_0 ,
	  exth ;


  PROCEDURE io_init_hpib;
  VAR
    io_isc        : type_isc;
    dummy         : INTEGER;
    io_lvl        : io_byte;
  BEGIN

    io_revid := io_revid + ' H3.2';     { HPIB revision added 2/5/82 TM }

    { set up the driver tables }

    WITH hpib_drivers DO BEGIN
      hpib_drivers := dummy_drivers;
      iod_init  := eh_init;
      iod_isr   := eh_isr;
      iod_rdb   := eh_rdb;
      iod_wtb   := eh_wtb;
      iod_rdw   := eh_rdw;
      iod_wtw   := eh_wtw;
      iod_rds   := eh_rds;
      iod_wtc   := eh_wtc;
      iod_end   := eh_end;
      iod_tfr   := eh_tfr;
      iod_send  := eh_send;
      iod_ppoll := eh_ppoll;
      iod_set   := eh_set;
      iod_clr   := eh_clr;
      iod_test  := eh_test;
    END; { of WITH }


    { set up drivers for the interfaces }

    FOR io_isc:=iominisc TO iomaxisc DO
      WITH isc_table[io_isc] DO BEGIN

	IF ( card_id = hp98624 ) OR
	   ( card_id = internal_hpib)
	  THEN BEGIN

	    io_drv_ptr:=ADDR(hpib_drivers);

	    WITH io_drv_ptr^, io_tmp_ptr^ DO BEGIN
	      IF io_isc=7
		THEN BEGIN
		  io_lvl := 3;
		END
		ELSE BEGIN
		  io_lvl:=((ioread_byte(io_isc,3) DIV 16) MOD 4)+3;
		END; { of IF }

	      { if the card exists then link in an ISR for it }
	      { ??? - what happens if an ISR fires during init }

	      IF myisrib.INTREGADDR <> NIL
		THEN BEGIN
		  { remove any existant isr }
		  ISRUNLINK(io_lvl,               { interrupt level       }
			    addr(myisrib));       { ptr to the isrib      }
		END; { of IF }

	      PERMISRLINK(iod_isr,                        { isr           }
		      ANYPTR(INTEGER(card_ptr)+3),        { int reg addr  }
		      192,                                { int reg mask  }
		      192,                                { int reg value }
		      io_lvl,                             { int level     }
		      ADDR(myisrib));                     { isrib info    }
	    END; { of WITH // DO BEGIN }

	  END; { of IF card_id }

      END; { of FOR io_isc WITH isc_table[io_isc] BEGIN }


    { call the actual driver initialization }

    { this is seperate from the set up stuff in case
      there are 2 or more cards connected - and generate
      an isr }

    FOR io_isc:=iominisc TO iomaxisc DO
      WITH isc_table[io_isc] DO
      IF ( card_id = hp98624 ) OR ( card_id = internal_hpib )
	THEN BEGIN
	  CALL(io_drv_ptr^.iod_init , io_tmp_ptr);
	END; { of WITH IF }


  END; { of io_init_hpib }

END; { of MODULE init_hpib }
$PAGE$

IMPORT    init_hpib ,
	  LOADER ;                                              { 367 TM 9/22/82 }


BEGIN
  io_init_hpib;
  MARKUSER;                                                     { 367 TM 9/22/82 }
END. { of hpib_initialize }
@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


25.1
log
@Automatic bump of revision number for PWS version 3.2Y
@
text
@@


24.1
log
@Automatic bump of revision number for PWS version 3.2
@
text
@@


23.1
log
@Automatic bump of revision number for PWS version 3.2P
@
text
@@


22.2
log
@Pws2unix automatic delta on Tue Aug 25 18:23:33 MDT 1987
@
text
@@


22.1
log
@Automatic bump of revision number for PWS version 3.2N
@
text
@d229 1
a229 1
    io_revid := io_revid + ' H3.1';     { HPIB revision added 2/5/82 TM }
@


21.1
log
@Automatic bump of revision number for PWS version 3.2M
@
text
@@


20.1
log
@Automatic bump of revision number for PWS version 3.2L
@
text
@@


19.1
log
@Automatic bump of revision number for PWS version 3.2K
@
text
@@


18.1
log
@Automatic bump of revision number for PWS version 3.2J
@
text
@@


17.1
log
@Automatic bump of revision number for PWS version 3.2I+
@
text
@@


16.1
log
@Automatic bump of revision number for PWS version 3.2I
@
text
@@


15.1
log
@Automatic bump of revision number for PWS version 3.2H
@
text
@@


14.1
log
@Automatic bump of revision number for PWS version 3.2G
@
text
@@


13.1
log
@Automatic bump of revision number for PWS version 3.2F
@
text
@@


12.1
log
@Automatic bump of revision number for PWS version 3.2E
@
text
@@


11.1
log
@Automatic bump of revision number for PWS version 3.2D
@
text
@@


10.1
log
@Automatic bump of revision number for PWS version 3.2C
@
text
@@


9.1
log
@Automatic bump of revision number for PWS version 3.2B
@
text
@@


8.1
log
@Automatic bump of revision number for PWS version 3.2A
@
text
@@


7.1
log
@Automatic bump of revision number for PWS version 3.2l
@
text
@@


6.1
log
@Automatic bump of revision number for PWS version 3.2k
@
text
@@


5.1
log
@Automatic bump of revision number for PWS version 3.2j
@
text
@@


4.1
log
@Automatic bump of revision number for PWS version 3.2i
@
text
@@


3.1
log
@Automatic bump of revision number for PWS version 3.2h
@
text
@@


2.1
log
@Auto bump rev number to 2.1 for sys 3.2e.
@
text
@@


1.1
log
@Initial revision
@
text
@@
