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.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright (C) 2013-2014 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. #ifndef __SCAN_LOOP_H
  17. #define __SCAN_LOOP_H
  18. // ----- Includes -----
  19. // Compiler Includes
  20. #include <stdint.h>
  21. // Local Includes
  22. // ----- Defines -----
  23. #define KEYBOARD_KEYS 0xFF // TODO Determine max number of keys
  24. #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer
  25. // This limits the NKRO-ability, so at 24, the keyboard is 24KRO
  26. // The buffer is really only needed for converter modules
  27. // An alternative macro module could be written for matrix modules and still work well
  28. // ----- Variables -----
  29. extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
  30. extern volatile uint8_t KeyIndex_BufferUsed;
  31. // ----- Functions -----
  32. // Functions used by main.c
  33. void Scan_setup( void );
  34. uint8_t Scan_loop( void );
  35. // Functions available to macro.c
  36. uint8_t Scan_sendData( uint8_t dataPayload );
  37. void Scan_finishedWithBuffer( uint8_t sentKeys );
  38. void Scan_finishedWithUSBBuffer( uint8_t sentKeys );
  39. void Scan_lockKeyboard( void );
  40. void Scan_unlockKeyboard( void );
  41. void Scan_resetKeyboard( void );
  42. #endif // __SCAN_LOOP_H