Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!think!ames!ucbcad!ucbvax!BRL.ARPA!gwyn From: gwyn@BRL.ARPA (Doug Gwyn, VLD/VMB) Newsgroups: comp.sys.apple Subject: IIGS SCC info Message-ID: <8705210443.aa02621@SMOKE.BRL.ARPA> Date: Thu, 21-May-87 04:43:46 EDT Article-I.D.: SMOKE.8705210443.aa02621 Posted: Thu May 21 04:43:46 1987 Date-Received: Sat, 23-May-87 12:35:02 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 51 In an accompanying message is a C header file I use on my Apple IIGS to define macros for using the Zilog 8530L Serial Communications Controller that controls access to the "printer" and "modem" ports. That file is heavily commented and gives references for further details. The following is a portion of the C source for a program that uses the header file in order to directly control the printer port, as an example of usage of the macros. /* example of "scc8530.h" usage -- taken from a printout utility */ #include "scc8530.h" static void prinit() { char warned = 0; SCCA_ctrl( 9, WR9_RSTA ); SCCA_ctrl( 10, WR10_NRZ | WR10_MIDLE ); SCCA_ctrl( 11, WR11_RXTAL | WR11_RBRG | WR11_TBRG ); SCCA_ctrl( 12, X16_9600 ); SCCA_ctrl( 13, X16_9600 >> 8 ); SCCA_ctrl( 15, 0 ); SCCA_ctrl( 0, WR0_RUND | WR0_RERR ); SCCA_ctrl( 1, WR1_RIDIS ); SCCA_ctrl( 4, WR4_X16 | WR4_1SB ); SCCA_ctrl( 14, WR14_DPLL | WR14_BREN ); SCCA_ctrl( 3, WR3_R8B | WR3_SCLI | WR3_RXEN ); SCCA_ctrl( 5, WR5_T8B | WR5_TXEN | WR5_RTS ); while ( (SCCA_stat( 0 ) & RR0_CTS) == 0 ) if ( warned == 0 ) { write( 2, "\007printer off-line\n", 18 ); ++warned; } } static void prc( c ) int c; { while ( (SCCA_stat( 0 ) & (RR0_CTS | RR0_EMPTY)) != (RR0_CTS | RR0_EMPTY) ) ; /* wait until transmitter ready */ SCCA_out( c ); }