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

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef CONFIG_KEYBRD_H
  2. #define CONFIG_KEYBRD_H
  3. #include <inttypes.h>
  4. /* size of read_pins_t and read_pins_mask_t depends on the maximum number of pins scanned by RowScanner.
  5. By default, read_pins_t and read_pins_mask_t are set to the largest type.
  6. If your 8-bit AVR 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. */
  9. /* Uncomment a typedef read_pins_t that covers all col pins of the RowScanner object with the most col pins i.e.
  10. For RowScanner_PinsArray, RowScanner_PinsArray::READ_PIN_COUNT
  11. For RowScanner_SPIShiftRegisters, RowScanner_SPIShiftRegisters::KEY_COUNT
  12. For RowScanner_PinsBitwise, cover the last 1 bit in RowScanner_PinsBitwise::strobePin
  13. */
  14. typedef uint8_t read_pins_t;
  15. //typedef uint16_t read_pins_t;
  16. //typedef uint32_t read_pins_t;
  17. /* read_pins_mask_t is only used for rowEnd, which extends one bit beyond the last col pin.
  18. uncomment typedef that covers one bit beyond the last col pin.
  19. This could be the same typedef as read_pins_t, or the next larger typedef.
  20. */
  21. typedef uint8_t read_pins_mask_t;
  22. //typedef uint16_t read_pins_mask_t;
  23. //typedef uint32_t read_pins_mask_t;
  24. /* SAMPLE_COUNT = 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 for reliability.
  27. SAMPLE_COUNT is used in Debouncer_Samples.h
  28. */
  29. #define SAMPLE_COUNT 4 //number of consecutive equal bits needed to change a debounced bit
  30. #endif