Annotation of xinu/h/pi7300.h, revision 1.1.1.1

1.1       root        1: /* pi7300.h   header for the ATT7300's parallel interface */
                      2: 
                      3: /* The pi is ready to use with no special initialization.  Basically
                      4:    it has only one mode of operation, so there is nothing to specify.
                      5:    After writing a data byte to PI_DATA, the LP_STROBE bit must be toggled
                      6:    from high to low and back to high to "strobe the data to the printer",
                      7:    i.e., this high-low-high signal is passed out through the port (on pin 1) 
                      8:    to the printer and tells it that a byte is ready for printing.
                      9:    Then the printer acknowledges acceptance of the byte by toggling
                     10:    the Acknowledge signal from high to low and back to high, on pin 10.
                     11:    Although undocumented in the register description, this signal can
                     12:    be seen in bit 9 of the GSR (found by reading the circuit diagram,
                     13:    sheet 6, unit 24D, the latch for the GSR).  More importantly for us,
                     14:    the low->high transition causes an interrupt, autovectored, level 2.
                     15:    The interrupt is acknowledged to the hardware by writing to data reg.
                     16:    (It doesn't have to be the "next byte", since the printer will ignore
                     17:    data written to the port if there is no strobe signal.) */ 
                     18: 
                     19: /* the 8-bit data port, output only-- */
                     20: #define PI_DATA ((volatile unsigned char *)0x4f0000)
                     21: /* Note: MCR is also used for clock interrupt control--should have package
                     22:    controlling updates to it like we have for the console control reg */
                     23: #define MCR ((volatile unsigned short *)0x4a0000)
                     24: /* one bit in MCR for lp--data strobe */
                     25: #define LP_STROBE (1<<13)
                     26: /* status register--input-only bits */
                     27: #define PI_STATUS ((volatile unsigned short *)0x470000)
                     28: /* bits in status reg--not needed to do the basic output operation,
                     29:    but needed for features such as stopping when the paper runs out */
                     30: /* from pin 11 of the interface: 1 if busy (printing, set offline, or in error
                     31:    condition)-- */
                     32: #define LP_BUSY (1<<7)
                     33: /* from pin 13 of the interface, 1 if printer online, but may be 1 all the 
                     34:    time, so not terribly useful--use LP_BUSY or LP_ERROR instead */
                     35: #define LP_SELECT (1<<6)
                     36: /* from pin 12 of the interface: 1 if the printer is out of paper */
                     37: #define LP_PAPEREND (1<<5)
                     38: /* from pin 32 of the interface: 0 if the printer is out of paper, offline,
                     39:     or in error state */
                     40: #define LP_ERROR (1<<4)
                     41: /* The rest of the bits relate to other devices */
                     42: 
                     43: /* The PI interrupts using autovector for level 2 */
                     44: /* (is this the right type spec??) */
                     45: #define PI_INTVEC_ADDR ((int (**)())(0x68))
                     46: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.