home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / h / ioc < prev    next >
Encoding:
Text File  |  1995-01-11  |  4.9 KB  |  140 lines

  1. /*
  2.  * $Header: /ax/networking:include/ioc.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/ioc.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    ioc.h,v $
  8.  * Revision 1.1  95/01/11  10:21:36  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.5  89/04/28  15:18:32  mark
  12.  * Name changes to suit the new XCB manager.
  13.  * 
  14.  * Revision 1.4  88/11/10  18:31:50  mark
  15.  * Improved to reflect hardware variations across different machines.
  16.  * 
  17.  * Revision 1.3  88/06/17  20:07:34  beta
  18.  * Acorn Unix initial beta version
  19.  * 
  20.  */
  21. /* ioc.h
  22.  *
  23.  * Definition of IOC chip as memory-mapped byte-register structure
  24.  */
  25.  
  26. typedef struct {
  27.   unsigned char
  28.     status,  pad0a, pad0b, pad0c,
  29.     request, pad1a, pad1b, pad1c,
  30.     mask,    pad2a, pad2b, pad2c,
  31.       pad3a, pad3b, pad3c, pad3d;
  32. } intr_block;
  33.  
  34. typedef struct {
  35.   unsigned char
  36.     count_lo,  pad0a, pad0b, pad0c,   /* (R) = latch_lo (W) */
  37. #define latch_lo count_lo
  38.     count_hi,  pad1a, pad1b, pad1c,   /* (R) = latch_hi (W) */
  39. #define latch_hi count_hi
  40.     go_cmd,    pad2a, pad2b, pad2c,   /* (W) */
  41.     latch_cmd, pad3a, pad3b, pad3c;   /* (W) */
  42. } timer_block;
  43.     
  44.          
  45. typedef struct {
  46.   unsigned char
  47.     control,   pad0a, pad0b, pad0c,   /* 00..03 read/write (CAREFUL!) */
  48.     kart_data, pad1a, pad1b, pad1c;   /* 04..07 read:RX, write:TX */
  49.   unsigned int pad2,                         /* 08..0B */
  50.         pad3;                         /* 0C..0F */
  51.   intr_block
  52.     irq_A,                            /* 10..1F */
  53.     irq_B,                            /* 20..2F */
  54.     fiq;                              /* 30..3F */
  55.   timer_block
  56.     timer_0,                          /* 40..4F */
  57.     timer_1,                          /* 50..5F */
  58.     timer_baud,                       /* 60..6F */
  59.     timer_kart;                       /* 70..7F */
  60. } ioc_block, *IOCRef, *ioc_block_ref;
  61.  
  62. #define irq_clear irq_A.request   /* write only */
  63.  
  64. #define IOC_BASE_ADDRESS  0x03200000
  65. #define IOC               ((ioc_block_ref)IOC_BASE_ADDRESS)
  66.  
  67. /* Control port register bits */
  68.  
  69. #define IOC_CON_I2C_DATA     (1<<0)    /* I2C Bus data  line - R/W */
  70. #define IOC_CON_I2C_CLOCK    (1<<1)    /* I2C Bus clock line - R/W */
  71. /*
  72.  * The sound mute line is defined on all machines, but only performs
  73.  * its expected function on the A500 and A440.  On A680 it must be 
  74.  * left as a 1.
  75.  */
  76. #define IOC_CON_SOUND_MUTE   (1<<5)    /* Sound Mute (A500/A440) - R/W */
  77. /*
  78.  * The set of bits which must be 1 when writing to the control port,
  79.  * on any machine.
  80.  */
  81. #define IOC_CON_WRITE_SET   (1<<7 | 1<<6 | 1<<4 | 1<<3 | 1<<2)
  82.  
  83.  
  84. /* The following bits are defined for A4x0 machines */
  85. #define IOC_CON4_DISC_READY  (1<<2)    /* floppy drive ready - RO */
  86. #define IOC_CON4_AUX_C4         (1<<4)    /* aux I/O line (unused) R/W */
  87.  
  88. /* The following 3 bits are present only on A500's */
  89. #define IOC_CON5_RTC_MINUTES (1<<2)    /* Real Time Clock minutes - RO */
  90. #define IOC_CON5_RTC_SECONDS (1<<3)    /* Real Time Clock seconds - RO */
  91. #define IOC_CON5_DISC_CHANGE (1<<4)    /* Floppy disc changed - RO */
  92.  
  93. /* The following bit is defined on A680. */
  94. #define IOC_CON6_DISC_CHANGE (1<<2)    /* floppy disc changed - RO */
  95.  
  96. /* Interrupt control register bits */
  97.  
  98. /* IRQ A block - mostly latched events, cleared via IRQ clear reg */
  99.  
  100. #define  IRQA_PBSY   (1 << 0)   /* Printer BuSY */
  101. #define  IRQA_RII    (1 << 1)   /* Serial line RInging Indication */
  102. #define  IRQA_PACK   (1 << 2)   /* Printer ACKnowledge event */
  103. #define  IRQA_VFLY   (1 << 3)   /* Vertical FLYback event */
  104. #define  IRQA_POR    (1 << 4)   /* Power On Reset */
  105. #define  IRQA_TM0    (1 << 5)   /* Timer 0 expiry */
  106. #define  IRQA_TM1    (1 << 6)   /* Timer 1 expiry */
  107. #define  IRQA_FORCE  (1 << 7)   /* Force IRQ int bit (permanently 1) */
  108.  
  109. /* IRQ B block */
  110.  
  111. #define  IRQB_XFIQ   (1 << 0)   /* XCB FIQ(!) bit - mask OFF */
  112. #define  IRQB_SND    (1 << 1)   /* Sound buffer switch event */
  113. #define  IRQB_SLCI   (1 << 2)   /* Serial Line Controller Int */
  114. #define  IRQB_WINC   (1 << 3)   /* Winchester Controller int */
  115. #define  IRQB_WIND   (1 << 4)   /* Winchester Data int */
  116. #define  IRQB_WINCD  (1 << 3)    /* Combined Controller/Data bit (Archimedes) */
  117. #define  IRQB_FDDC   (1 << 4)    /* Floppy Disc Disc Changed (Archimedes) */
  118. #define     IRQB_FDINT  (1 << 4)   /* Floppy disc intr (A680) */
  119. #define  IRQB_XCB    (1 << 5)   /* Expansion card common IRQ */
  120. #define  IRQB_KSTX   (1 << 6)   /* KART transmitter done */
  121. #define  IRQB_KSRX   (1 << 7)   /* KART receiver data ready */
  122.  
  123. /* FIQ block */
  124.  
  125. #define  FIQ_FDDR    (1 << 0)   /* Floppy Disc Data Request */
  126. #define  FIQ_FDIR    (1 << 1)   /* Floppy Disc Interrupt Request */
  127. #define  FIQ_ECONET  (1 << 2)   /* ECOnet interrupt */
  128.   /* 3..5 not used */
  129. #define  FIQ_XCB     (1 << 6)   /* XCB card FIQ */
  130. #define  FIQ_FORCE   (1 << 7)   /* Force FIQ int (permanently 1) */
  131.  
  132. /* Delay required after SRX set in IRQ B status before read KART data reg,
  133.  * with KART serial line on maximum speed.
  134.  */
  135.  
  136. #define  IOC_KART_BUG_DELAY  16        /* in microseconds: 1/2 bit time */
  137.  
  138.  
  139. /* EOF ioc.h */
  140.