OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel-0-3-0-rc1/] [or1ksim/] [peripheral/] [ps2kbd.h] - Diff between revs 1371 and 1748

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1371 Rev 1748
Line 1... Line 1...
/* ps2kbd.h -- Very simple PS/2 keyboard simulation header file
/* ps2kbd.h -- Very simple PS/2 keyboard simulation header file
 
 
   Copyright (C) 2002 Marko Mlinar, markom@opencores.org
   Copyright (C) 2002 Marko Mlinar, markom@opencores.org
 
   Copyright (C) 2008 Embecosm Limited
 
 
 
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
 
 
 
   This file is part of Or1ksim, the OpenRISC 1000 Architectural Simulator.
 
 
 
   This program is free software; you can redistribute it and/or modify it
 
   under the terms of the GNU General Public License as published by the Free
 
   Software Foundation; either version 3 of the License, or (at your option)
 
   any later version.
 
 
 
   This program is distributed in the hope that it will be useful, but WITHOUT
 
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
   more details.
 
 
 
   You should have received a copy of the GNU General Public License along
 
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
This file is part of OpenRISC 1000 Architectural Simulator.
/* This program is commented throughout in a fashion suitable for processing
 
   with Doxygen. */
 
 
This program is free software; you can redistribute it and/or modify
 
it under the terms of the GNU General Public License as published by
 
the Free Software Foundation; either version 2 of the License, or
 
(at your option) any later version.
 
 
 
This program is distributed in the hope that it will be useful,
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
GNU General Public License for more details.
 
 
 
You should have received a copy of the GNU General Public License
 
along with this program; if not, write to the Free Software
 
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 
#ifndef _PS2KBD_H_
 
#define _PS2KBD_H_
 
 
 
/* Device registers */
 
#define KBD_CTRL        4
 
#define KBD_DATA        0
 
#define KBD_SPACE       8
 
 
 
/* Keyboard commands */
 
#define KBD_KCMD_RST    0xFF
 
#define KBD_KCMD_DK     0xF5
 
#define KBD_KCMD_EK     0xF4
 
#define KBD_KCMD_ECHO   0xFF
 
#define KBD_KCMD_SRL    0xED
 
 
 
/* Keyboard responses */
 
#define KBD_KRESP_RSTOK 0xAA
 
#define KBD_KRESP_ECHO  0xEE
 
#define KBD_KRESP_ACK   0xFA
 
 
 
/* Controller commands */
 
#define KBD_CCMD_RCB    0x20
 
#define KBD_CCMD_WCB    0x60
 
#define KBD_CCMD_ST1    0xAA
 
#define KBD_CCMD_ST2    0xAB
 
#define KBD_CCMD_DKI    0xAD
 
#define KBD_CCMD_EKI    0xAE
 
 
 
/* Status register bits */
 
#define KBD_STATUS_OBF  0x01
 
#define KBD_STATUS_IBF  0x02
 
#define KBD_STATUS_SYS  0x04
 
#define KBD_STATUS_A2   0x08
 
#define KBD_STATUS_INH  0x10
 
#define KBD_STATUS_MOBF 0x20
 
#define KBD_STATUS_TO   0x40
 
#define KBD_STATUS_PERR 0x80
 
 
 
/* Command byte register bits */
 
#define KBD_CCMDBYTE_INT        0x01
 
#define KBD_CCMDBYTE_INT2       0x02
 
#define KBD_CCMDBYTE_SYS        0x04
 
#define KBD_CCMDBYTE_EN         0x10
 
#define KBD_CCMDBYTE_EN2        0x20
 
#define KBD_CCMDBYTE_XLAT       0x40
 
 
 
/* Length of internal scan code fifo */
#ifndef PS2KBD__H
#define KBD_MAX_BUF     0x100
#define PS2KBD__H
 
 
/* Keyboard is checked every KBD_SLOWDOWN cycle */
/* Prototypes for external use */
#define KBD_BAUD_RATE   1200
void  reg_kbd_sec ();
 
 
#endif /* !_PS2KBD_H_ */
#endif /* PS2KBD__H */
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.