i8042.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * (C) Copyright 2002 ELTEC Elektronik AG
  3. * Frank Gottschling <fgottschling@eltec.de>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /* i8042.h - Intel 8042 keyboard driver header */
  24. #ifndef _I8042_H_
  25. #define _I8042_H_
  26. #ifdef __I386__
  27. #include <common.h>
  28. #include <asm/io.h>
  29. #define in8(p) inb(p)
  30. #define out8(p,v) outb(v,p)
  31. #endif
  32. /* defines */
  33. #define I8042_DATA_REG (CONFIG_SYS_ISA_IO + 0x0060) /* keyboard i/o buffer */
  34. #define I8042_STATUS_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard status read */
  35. #define I8042_COMMAND_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard ctrl write */
  36. #define KBD_US 0 /* default US layout */
  37. #define KBD_GER 1 /* german layout */
  38. #define KBD_TIMEOUT 1000 /* 1 sec */
  39. #define KBD_RESET_TRIES 3
  40. #define AS 0 /* normal character index */
  41. #define SH 1 /* shift index */
  42. #define CN 2 /* control index */
  43. #define NM 3 /* numeric lock index */
  44. #define AK 4 /* right alt key */
  45. #define CP 5 /* capslock index */
  46. #define ST 6 /* stop output index */
  47. #define EX 7 /* extended code index */
  48. #define ES 8 /* escape and extended code index */
  49. #define NORMAL 0x0000 /* normal key */
  50. #define STP 0x0001 /* scroll lock stop output*/
  51. #define NUM 0x0002 /* numeric lock */
  52. #define CAPS 0x0004 /* capslock */
  53. #define SHIFT 0x0008 /* shift */
  54. #define CTRL 0x0010 /* control*/
  55. #define EXT 0x0020 /* extended scan code 0xe0 */
  56. #define ESC 0x0040 /* escape key press */
  57. #define E1 0x0080 /* extended scan code 0xe1 */
  58. #define BRK 0x0100 /* make break flag for keyboard */
  59. #define ALT 0x0200 /* right alt */
  60. /* exports */
  61. int i8042_kbd_init(void);
  62. int i8042_tstc(void);
  63. int i8042_getc(void);
  64. #endif /* _I8042_H_ */