ps2.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_PS2_HEADER
  19. #define GRUB_PS2_HEADER 1
  20. #include <grub/types.h>
  21. #define GRUB_AT_ACK 0xfa
  22. #define GRUB_AT_NACK 0xfe
  23. #define GRUB_AT_TRIES 5
  24. /* Make sure it's zeroed-out and set current_set at init. */
  25. struct grub_ps2_state
  26. {
  27. int e0_received;
  28. int f0_received;
  29. grub_uint8_t led_status;
  30. short at_keyboard_status;
  31. grub_uint8_t current_set;
  32. };
  33. /* If there is a key pending, return it; otherwise return GRUB_TERM_NO_KEY. */
  34. int
  35. grub_ps2_process_incoming_byte (struct grub_ps2_state *ps2_state,
  36. grub_uint8_t data);
  37. #endif