1*49883887Ssnj /* $NetBSD: acia.h,v 1.4 2009/10/20 19:10:11 snj Exp $ */ 28b0113cfSleo 38b0113cfSleo /* 48b0113cfSleo * Copyright (c) 1995 Leo Weppelman. 58b0113cfSleo * All rights reserved. 68b0113cfSleo * 78b0113cfSleo * Redistribution and use in source and binary forms, with or without 88b0113cfSleo * modification, are permitted provided that the following conditions 98b0113cfSleo * are met: 108b0113cfSleo * 1. Redistributions of source code must retain the above copyright 118b0113cfSleo * notice, this list of conditions and the following disclaimer. 128b0113cfSleo * 2. Redistributions in binary form must reproduce the above copyright 138b0113cfSleo * notice, this list of conditions and the following disclaimer in the 148b0113cfSleo * documentation and/or other materials provided with the distribution. 158b0113cfSleo * 168b0113cfSleo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 178b0113cfSleo * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 188b0113cfSleo * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 198b0113cfSleo * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 208b0113cfSleo * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 218b0113cfSleo * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 228b0113cfSleo * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 238b0113cfSleo * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 248b0113cfSleo * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 258b0113cfSleo * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 268b0113cfSleo */ 278b0113cfSleo 288b0113cfSleo #ifndef _MACHINE_ACIA_H 298b0113cfSleo #define _MACHINE_ACIA_H 308b0113cfSleo /* 318b0113cfSleo * Atari ST hardware: 328b0113cfSleo * Motorola 6850 Asynchronous Communications Interface Adapter 338b0113cfSleo */ 348b0113cfSleo 358b0113cfSleo #define KBD (((struct acia *)AD_ACIA)) 368b0113cfSleo #define MDI (((struct acia *)AD_ACIA) + 1) 378b0113cfSleo 388b0113cfSleo struct acia { 39f8c615afSleo volatile u_char acb[4]; /* use only the even bytes */ 408b0113cfSleo }; 418b0113cfSleo 428b0113cfSleo #define ac_cs acb[0] /* control and status register */ 438b0113cfSleo #define ac_da acb[2] /* data register */ 448b0113cfSleo 458b0113cfSleo /* bits in control register: */ 468b0113cfSleo /* 0x03 *//* clock divider */ 478b0113cfSleo #define A_Q01 0x00 /* don't divide */ 488b0113cfSleo #define A_Q16 0x01 /* divide by 16 */ 498b0113cfSleo #define A_Q64 0x02 /* divide by 64 */ 508b0113cfSleo #define A_RESET 0x03 /* master reset */ 518b0113cfSleo /* 0x1C *//* word select bits */ 528b0113cfSleo #define A_72E 0x00 /* 7 data, 2 stop, parity even */ 538b0113cfSleo #define A_72O 0x04 /* 7 data, 2 stop, parity odd */ 548b0113cfSleo #define A_71E 0x08 /* 7 data, 1 stop, parity even */ 558b0113cfSleo #define A_71O 0x0C /* 7 data, 1 stop, parity odd */ 568b0113cfSleo #define A_82N 0x10 /* 8 data, 2 stop, no parity */ 578b0113cfSleo #define A_81N 0x14 /* 8 data, 1 stop, no parity */ 588b0113cfSleo #define A_81E 0x18 /* 8 data, 1 stop, parity even */ 598b0113cfSleo #define A_81O 0x1C /* 8 data, 1 stop, parity odd */ 608b0113cfSleo /* 0x60 *//* RTS Low/High, TXINT en/dis, BREAK */ 618b0113cfSleo #define A_TXPOL 0x00 /* RTS Low, TXINT disabled */ 628b0113cfSleo #define A_TXINT 0x20 /* RTS Low, TXINT enabled */ 638b0113cfSleo #define A_TXOFF 0x40 /* RTS High, TXINT disabled */ 648b0113cfSleo #define A_BREAK 0x60 /* RTS Low, TXINT disabled, BREAK */ 658b0113cfSleo #define A_RXINT 0x80 /* enable receiver interrupt */ 668b0113cfSleo 678b0113cfSleo /* bits in status register: */ 688b0113cfSleo #define A_RXRDY 0x01 /* receiver ready */ 698b0113cfSleo #define A_TXRDY 0x02 /* transmitter ready */ 708b0113cfSleo #define A_CLOST 0x04 /* Carrier Lost */ 718b0113cfSleo #define A_CTS 0x08 /* Clear To Send */ 728b0113cfSleo #define A_FE 0x10 /* Frame Error */ 738b0113cfSleo #define A_OE 0x20 /* Overrun Error */ 748b0113cfSleo #define A_PE 0x40 /* Parity Error */ 758b0113cfSleo #define A_IRQ 0x80 /* State of IRQ signal */ 768b0113cfSleo 778b0113cfSleo /* values for the TT: */ 788b0113cfSleo #define KBD_INIT (A_81N|A_Q64) 798b0113cfSleo #define MDI_INIT (A_81N|A_Q16) 808b0113cfSleo 818b0113cfSleo #endif /* _MACHINE_ACIA_H */ 82