Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

scan_loop.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright (C) 2013-2015 by Jacob Alexander
  2. *
  3. * This library is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU Lesser General Public
  5. * License as published by the Free Software Foundation; either
  6. * version 3.0 of the License, or (at your option) any later version.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public
  14. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #pragma once
  17. // ----- Includes -----
  18. // Compiler Includes
  19. #include <stdint.h>
  20. // Local Includes
  21. // ----- Defines -----
  22. #define KEYBOARD_KEYS 0xFF // TODO Determine max number of keys
  23. #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer
  24. // This limits the NKRO-ability, so at 24, the keyboard is 24KRO
  25. // The buffer is really only needed for converter modules
  26. // An alternative macro module could be written for matrix modules and still work well
  27. // ----- Variables -----
  28. extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
  29. extern volatile uint8_t KeyIndex_BufferUsed;
  30. // ----- Functions -----
  31. // Functions used by main.c
  32. void Scan_setup();
  33. uint8_t Scan_loop();
  34. // Functions available to macro.c
  35. uint8_t Scan_sendData( uint8_t dataPayload );
  36. void Scan_finishedWithMacro( uint8_t sentKeys );
  37. void Scan_finishedWithOutput( uint8_t sentKeys );