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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1.1
date     86.06.30.15.09.26;  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                         *)


$SEARCH 'IOLIB:KERNEL.CODE'$
$MODCAL ON$
$PARTIAL_EVAL ON$
$STACKCHECK ON$
$RANGE OFF$
$DEBUG OFF$
$OVFLCHECK OFF$
$PAGE$

(************************************************************************)
(*                                                                      *)
(*      RELEASED        VERSION         3.1                             *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      IOLIB           GPIO_DRIVERS                                    *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      library      -  IOLIB                                           *)
(*      name         -  GPIO_DRIVERS                                    *)
(*      module(s)    -  init_gpio                                       *)
(*                   -  extg                                            *)
(*                                                                      *)
(*      author       -  Tim Mikkelsen                                   *)
(*      phone        -  303-226-3800   ext. 2910                        *)
(*                                                                      *)
(*      date         -  June  1 , 1981                                  *)
(*      update       -  Aug   1 , 1983                                  *)
(*      release      -  Jul  12 , 1985                                  *)
(*                                                                      *)
(*      source       -  IOLIB:G_DRV.TEXT                                *)
(*      object       -  IOLIB:G_DRV.CODE                                *)
(*                                                                      *)
(************************************************************************)
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      BUG FIX HISTORY         - after release 1.0                     *)
(*                                                                      *)
(*                                                                      *)
(*      BUG #   BY  / ON        LOC             DESCRIPTION             *)
(*      -----   -----------     --------------  ----------------------  *)
(*                                                                      *)
(*      367     T Mikkelsen     gpio_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 gpio_initialize ( INPUT , OUTPUT );
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      GPIO DRIVERS                                                    *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
EXTERNAL MODULE extg;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  10/13/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 'extg'.  The routines need to be called
		  'extg_@@@@@@@@@@@@' - eg_init referenced below would be
		  extg_eg_init.  'eg' refers to GPIO.
	}

IMPORT  sysglobals ,
	  iodeclarations ;

EXPORT

  PROCEDURE eg_init  ( temp : ANYPTR );
  PROCEDURE eg_isr   ( temp : PISRIB );
  PROCEDURE eg_rdb   ( temp : ANYPTR ;  VAR x : CHAR);
  PROCEDURE eg_wtb   ( temp : ANYPTR ;  val   : CHAR);
  PROCEDURE eg_rdw   ( temp : ANYPTR ;  VAR x : io_word);
  PROCEDURE eg_wtw   ( temp : ANYPTR ;  val   : io_word);
  PROCEDURE eg_rds   ( temp : ANYPTR ;  reg   : io_word;
					VAR x : io_word);
  PROCEDURE eg_wtc   ( temp : ANYPTR ;  reg   : io_word;
					val   : io_word );
  PROCEDURE eg_tfr   ( temp : ANYPTR ;  bcb   : ANYPTR );
  PROCEDURE eg_clr   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eg_set   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eg_test  ( temp : ANYPTR ;  line  : io_bit ;
					VAR x : BOOLEAN );

END; { of extg }
$PAGE$


MODULE init_gpio;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  10/04/82
		   8/01/83   change rev number

	  purpose This module initializes the gpio drivers.

	}


IMPORT    iodeclarations ;

EXPORT


  VAR
    gpio_drivers  : drv_table_type;

  PROCEDURE io_init_gpio;



IMPLEMENT


  IMPORT  sysglobals ,
	  isr ,
	  general_0 ,
	  extg ;


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

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

    { set up the driver tables }

    WITH gpio_drivers DO BEGIN
      gpio_drivers := dummy_drivers ;
      iod_init  := eg_init;
      iod_isr   := eg_isr;
      iod_rdb   := eg_rdb;
      iod_wtb   := eg_wtb;
      iod_rdw   := eg_rdw;
      iod_wtw   := eg_wtw;
      iod_rds   := eg_rds;
      iod_wtc   := eg_wtc;
      iod_tfr   := eg_tfr;
      iod_set   := eg_set;
      iod_clr   := eg_clr;
      iod_test  := eg_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 = hp98622
	  THEN BEGIN

	    io_drv_ptr:=ADDR(gpio_drivers);

	    WITH io_drv_ptr^, io_tmp_ptr^ DO BEGIN

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

	      io_lvl:=((ioread_byte(io_isc,3) DIV 16) MOD 4)+3;
	      IF myisrib.INTREGADDR <> NIL
		THEN BEGIN
		  { if isr exists then unlink it }
		  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 BEGIN }

	  END; { of IF card_type = gpio_card }

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


    { call the actual driver initialization }

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


  END; { of io_init_gpio }

END; { of MODULE init_gpio }
$PAGE$

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


BEGIN
  io_init_gpio;
  MARKUSER;                                                     { 367 TM 9/22/82 }
END. { of gpio_initialize }
@


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


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

 (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                         *)


$SEARCH 'IOLIB:KERNEL.CODE'$
$MODCAL ON$
$PARTIAL_EVAL ON$
$STACKCHECK ON$
$RANGE OFF$
$DEBUG OFF$
$OVFLCHECK OFF$
$PAGE$

(************************************************************************)
(*                                                                      *)
(*      RELEASED        VERSION         3.1                             *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      IOLIB           GPIO_DRIVERS                                    *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      library      -  IOLIB                                           *)
(*      name         -  GPIO_DRIVERS                                    *)
(*      module(s)    -  init_gpio                                       *)
(*                   -  extg                                            *)
(*                                                                      *)
(*      author       -  Tim Mikkelsen                                   *)
(*      phone        -  303-226-3800   ext. 2910                        *)
(*                                                                      *)
(*      date         -  June  1 , 1981                                  *)
(*      update       -  Aug   1 , 1983                                  *)
(*      release      -  Jul  12 , 1985                                  *)
(*                                                                      *)
(*      source       -  IOLIB:G_DRV.TEXT                                *)
(*      object       -  IOLIB:G_DRV.CODE                                *)
(*                                                                      *)
(************************************************************************)
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      BUG FIX HISTORY         - after release 1.0                     *)
(*                                                                      *)
(*                                                                      *)
(*      BUG #   BY  / ON        LOC             DESCRIPTION             *)
(*      -----   -----------     --------------  ----------------------  *)
(*                                                                      *)
(*      367     T Mikkelsen     gpio_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 gpio_initialize ( INPUT , OUTPUT );
$PAGE$
(************************************************************************)
(*                                                                      *)
(*                                                                      *)
(*      GPIO DRIVERS                                                    *)
(*                                                                      *)
(*                                                                      *)
(************************************************************************)
EXTERNAL MODULE extg;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  10/13/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 'extg'.  The routines need to be called
		  'extg_@@@@@@@@@@@@' - eg_init referenced below would be
		  extg_eg_init.  'eg' refers to GPIO.
	}

IMPORT  sysglobals ,
	  iodeclarations ;

EXPORT

  PROCEDURE eg_init  ( temp : ANYPTR );
  PROCEDURE eg_isr   ( temp : PISRIB );
  PROCEDURE eg_rdb   ( temp : ANYPTR ;  VAR x : CHAR);
  PROCEDURE eg_wtb   ( temp : ANYPTR ;  val   : CHAR);
  PROCEDURE eg_rdw   ( temp : ANYPTR ;  VAR x : io_word);
  PROCEDURE eg_wtw   ( temp : ANYPTR ;  val   : io_word);
  PROCEDURE eg_rds   ( temp : ANYPTR ;  reg   : io_word;
					VAR x : io_word);
  PROCEDURE eg_wtc   ( temp : ANYPTR ;  reg   : io_word;
					val   : io_word );
  PROCEDURE eg_tfr   ( temp : ANYPTR ;  bcb   : ANYPTR );
  PROCEDURE eg_clr   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eg_set   ( temp : ANYPTR ;  line  : io_bit );
  PROCEDURE eg_test  ( temp : ANYPTR ;  line  : io_bit ;
					VAR x : BOOLEAN );

END; { of extg }
$PAGE$


MODULE init_gpio;
	{ by      Tim Mikkelsen
	  date    08/25/81
	  update  10/04/82
		   8/01/83   change rev number

	  purpose This module initializes the gpio drivers.

	}


IMPORT    iodeclarations ;

EXPORT


  VAR
    gpio_drivers  : drv_table_type;

  PROCEDURE io_init_gpio;



IMPLEMENT


  IMPORT  sysglobals ,
	  isr ,
	  general_0 ,
	  extg ;


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

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

    { set up the driver tables }

    WITH gpio_drivers DO BEGIN
      gpio_drivers := dummy_drivers ;
      iod_init  := eg_init;
      iod_isr   := eg_isr;
      iod_rdb   := eg_rdb;
      iod_wtb   := eg_wtb;
      iod_rdw   := eg_rdw;
      iod_wtw   := eg_wtw;
      iod_rds   := eg_rds;
      iod_wtc   := eg_wtc;
      iod_tfr   := eg_tfr;
      iod_set   := eg_set;
      iod_clr   := eg_clr;
      iod_test  := eg_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 = hp98622
	  THEN BEGIN

	    io_drv_ptr:=ADDR(gpio_drivers);

	    WITH io_drv_ptr^, io_tmp_ptr^ DO BEGIN

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

	      io_lvl:=((ioread_byte(io_isc,3) DIV 16) MOD 4)+3;
	      IF myisrib.INTREGADDR <> NIL
		THEN BEGIN
		  { if isr exists then unlink it }
		  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 BEGIN }

	  END; { of IF card_type = gpio_card }

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


    { call the actual driver initialization }

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


  END; { of io_init_gpio }

END; { of MODULE init_gpio }
$PAGE$

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


BEGIN
  io_init_gpio;
  MARKUSER;                                                     { 367 TM 9/22/82 }
END. { of gpio_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
@d231 1
a231 1
    io_revid := io_revid + ' G3.1';     { GPIO 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
@@
