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

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef CONFIG_KEYBRD_H
  2. #define CONFIG_KEYBRD_H
  3. #include <inttypes.h>
  4. /* This config_keybrd.h file is included by several keybrd library files.
  5. If you change any values in this file, copy the entire library into your sketch folder,
  6. and use double quotes to include the files in your sketch.
  7. That way libary updates don't overwrite your changes.
  8. The maximum number of pins scanned by RowScanner depends on size of read_pins_t.
  9. By default, read_pins_t is set to uint32_t.
  10. If your 8-bit AVR (Teensy 2) is running low on memory, using a smaller type saves SRAM.
  11. Using smaller types on a 32-bit uC (Teensy LC) would accomplish nothing.
  12. read_pins_t is used in:
  13. Row bit patterns
  14. ScannerInterface::scan()
  15. Scanner_ShiftRegsRead::scan()
  16. Scanner_ShiftRegsReadStrobed::scan()
  17. Scanner_uC::scan()
  18. DebouncerInterface::debounce()
  19. Debouncer_Samples::debounce()
  20. Use a read_pins_t size that covers all read pins of all Scanner objects i.e.
  21. For Scanner_uC: read_pins_t bits >= Scanner_uC::readPinCount
  22. For Scanner_ShiftRegsRead: read_pins_t bits >= Scanner_ShiftRegsRead::byte_count * 8
  23. (For Scanner_IOE: I/O expanders are assumed to have 8 bits per port or less)
  24. */
  25. //typedef uint8_t read_pins_t;
  26. //typedef uint16_t read_pins_t;
  27. typedef uint32_t read_pins_t;
  28. /* SAMPLE_COUNT is used in Debouncer_Samples.h
  29. SAMPLE_COUNT = 4 is very reliable for a keyboard.
  30. Split keyboards with a long connecting wire or in environment with
  31. strong electromagnetic interference (EMI) may need a larger SAMPLE_COUNT for reliability.
  32. */
  33. const uint8_t SAMPLE_COUNT = 4; //number of consecutive equal bits needed to change a debounced bit
  34. #endif