keybrd library is an open source library for creating custom-keyboard firmware.
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.

config_keybrd.h 1.3KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef CONFIG_KEYBRD_H
  2. #define CONFIG_KEYBRD_H
  3. #include <inttypes.h>
  4. /* The maximum number of pins scanned by RowScanner depends on size of read_pins_t.
  5. By default, read_pins_t is set to uint32_t.
  6. If your 8-bit AVR (Teensy 2) is running low on memory, using a smaller type saves SRAM.
  7. Using smaller types on a 32-bit uC (Teensy LC) would accomplish nothing.
  8. read_pins_t is used in:
  9. Row bit patterns
  10. ScannerInterface::scan()
  11. Scanner_ShiftRegsPISO::scan()
  12. Scanner_uC::scan()
  13. DebouncerInterface::debounce()
  14. Debouncer_Samples::debounce()
  15. Use a read_pins_t size that covers all read pins of all Scanner objects i.e.
  16. For Scanner_uC: read_pins_t bits >= Scanner_uC::readPinCount
  17. For Scanner_ShiftRegsPISO: read_pins_t bits >= Scanner_ShiftRegsPISO::byte_count * 8
  18. (For Scanner_IOE: I/O expanders are assumed to have 8 bits per port or less)
  19. */
  20. //typedef uint8_t read_pins_t;
  21. //typedef uint16_t read_pins_t;
  22. typedef uint32_t read_pins_t;
  23. /* SAMPLE_COUNT_MACRO is used in Debouncer_Samples.h
  24. SAMPLE_COUNT_MACRO = 4 is very reliable for a keyboard.
  25. Split keyboards with a long connecting wire or in environment with
  26. strong electromagnetic interference (EMI) may need a larger SAMPLE_COUNT_MACRO for reliability.
  27. */
  28. #define SAMPLE_COUNT_MACRO 4 //number of consecutive equal bits needed to change a debounced bit
  29. #endif