/* * Hewlett Packard Human Interface Loop (HP-HIL) Protocol -- header. * * Copyright (c) 2001 Brian S. Julin * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL"). * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * * References: * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A * * A note of thanks to HP for providing and shipping reference materials * free of charge to help in the development of HIL support for Linux. *
*/
#include <asm/types.h>
/* Physical constants relevant to raw loop/device timing.
*/
/* HP documentation uses these bit positions to refer to commands; * we will call these "packets".
*/ enum hil_pkt_bitpos {
HIL_PKT_CMD = 0x00000800,
HIL_PKT_ADDR2 = 0x00000400,
HIL_PKT_ADDR1 = 0x00000200,
HIL_PKT_ADDR0 = 0x00000100,
HIL_PKT_ADDR_MASK = 0x00000700,
HIL_PKT_ADDR_SHIFT = 8,
HIL_PKT_DATA7 = 0x00000080,
HIL_PKT_DATA6 = 0x00000040,
HIL_PKT_DATA5 = 0x00000020,
HIL_PKT_DATA4 = 0x00000010,
HIL_PKT_DATA3 = 0x00000008,
HIL_PKT_DATA2 = 0x00000004,
HIL_PKT_DATA1 = 0x00000002,
HIL_PKT_DATA0 = 0x00000001,
HIL_PKT_DATA_MASK = 0x000000FF,
HIL_PKT_DATA_SHIFT = 0
};
/* The HIL MLC also has several error/status/control bits. We extend the * "packet" to include these when direct access to the MLC is available, * or emulate them in cases where they are not available. * * This way the device driver knows that the underlying MLC driver * has had to deal with loop errors.
*/ enum hil_error_bitpos {
HIL_ERR_OB = 0x00000800, /* MLC is busy sending an auto-poll, or we have filled up the output
buffer and must wait. */
HIL_ERR_INT = 0x00010000, /* A normal interrupt has occurred. */
HIL_ERR_NMI = 0x00020000, /* An NMI has occurred. */
HIL_ERR_LERR = 0x00040000, /* A poll didn't come back. */
HIL_ERR_PERR = 0x01000000, /* There was a Parity Error. */
HIL_ERR_FERR = 0x02000000, /* There was a Framing Error. */
HIL_ERR_FOF = 0x04000000 /* Input FIFO Overflowed. */
};
/* Bits 30,31 are unused, we use them to control write behavior. */ #define HIL_DO_ALTER_CTRL 0x40000000 /* Write MSW of packet to control
before writing LSW to loop */ #define HIL_CTRL_ONLY 0xc0000000 /* *Only* alter the control registers */
/* This gives us a 32-bit "packet"
*/ typedef u32 hil_packet;
/* Last defined locale code. Everything above this is "Reserved", and note that this same table applies to the Device ID Byte where
keyboards may have a nationality code which is only 5 bits. */ #define HIL_LOCALE_MAX 0x1f
/* Map to hopefully useful strings. I was trying to make these look like locale.aliases strings do; maybe that isn't the right table to
emulate. In either case, I didn't have much to work on. */ #define HIL_LOCALE_MAP \ "", /* 0x00 Reserved */ \ "", /* 0x01 Reserved */ \ "", /* 0x02 Reserved */ \ "swiss.french", /* 0x03 Swiss/French */ \ "portuguese", /* 0x04 Portuguese */ \ "arabic", /* 0x05 Arabic */ \ "hebrew", /* 0x06 Hebrew */ \ "english.canadian", /* 0x07 Canadian English */ \ "turkish", /* 0x08 Turkish */ \ "greek", /* 0x09 Greek */ \ "thai", /* 0x0a Thai (Thailand) */ \ "italian", /* 0x0b Italian */ \ "korean", /* 0x0c Hangul (Korea) */ \ "dutch", /* 0x0d Dutch */ \ "swedish", /* 0x0e Swedish */ \ "german", /* 0x0f German */ \ "chinese", /* 0x10 Chinese-PRC */ \ "chinese", /* 0x11 Chinese-ROC */ \ "swiss.french", /* 0x12 Swiss/French II */ \ "spanish", /* 0x13 Spanish */ \ "swiss.german", /* 0x14 Swiss/German II */ \ "flemish", /* 0x15 Belgian (Flemish) */ \ "finnish", /* 0x16 Finnish */ \ "english.uk", /* 0x17 United Kingdom */ \ "french.canadian", /* 0x18 French/Canadian */ \ "swiss.german", /* 0x19 Swiss/German */ \ "norwegian", /* 0x1a Norwegian */ \ "french", /* 0x1b French */ \ "danish", /* 0x1c Danish */ \ "japanese", /* 0x1d Katakana */ \ "spanish", /* 0x1e Latin American/Spanish*/\ "english.us"/* 0x1f United States */ \
/* Response to POL command, the "poll record header" */
#define HIL_POL_NUM_AXES_MASK 0x03 /* Number of axis reported */ #define HIL_POL_CTS 0x04 /* Device ready to receive data */ #define HIL_POL_STATUS_PENDING 0x08 /* Device has status to report */ #define HIL_POL_CHARTYPE_MASK 0x70 /* Type of character data to follow */ #define HIL_POL_CHARTYPE_NONE 0x00 /* No character data to follow */ #define HIL_POL_CHARTYPE_RSVD1 0x10 /* Reserved Set 1 */ #define HIL_POL_CHARTYPE_ASCII 0x20 /* U.S. ASCII */ #define HIL_POL_CHARTYPE_BINARY 0x30 /* Binary data */ #define HIL_POL_CHARTYPE_SET1 0x40 /* Keycode Set 1 */ #define HIL_POL_CHARTYPE_RSVD2 0x50 /* Reserved Set 2 */ #define HIL_POL_CHARTYPE_SET2 0x60 /* Keycode Set 2 */ #define HIL_POL_CHARTYPE_SET3 0x70 /* Keycode Set 3 */ #define HIL_POL_AXIS_ALT 0x80 /* Data is from axis set 2 */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.