2016-06-22 02:40:35 +00:00
|
|
|
#ifndef CONFIG_KEYBRD_H
|
|
|
|
#define CONFIG_KEYBRD_H
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2016-07-09 09:59:28 +00:00
|
|
|
/* size of read_pins_t depends on the maximum number of pins scanned by RowScanner.
|
|
|
|
By default, read_pins_t is set to the largest type.
|
2016-07-14 23:28:16 +00:00
|
|
|
If your 8-bit AVR (Teensy 2) is running low on memory, using a smaller type saves SRAM.
|
2016-06-22 02:40:35 +00:00
|
|
|
Using smaller types on a 32-bit uC (Teensy LC) would accomplish nothing.
|
|
|
|
*/
|
|
|
|
|
2016-09-17 05:45:12 +00:00
|
|
|
/* Use a read_pins_t size that covers all read pins of all Scanner objects i.e.
|
|
|
|
For Scanner_uC: read_pins_t bits >= Scanner_uC::readPinCount
|
|
|
|
For Scanner_ShiftRegsPISO: read_pins_t bits >= Scanner_ShiftRegsPISO::byte_count * 8
|
|
|
|
(For Scanner_IOE: I/O expanders are assumed to have 8 bits per port or less)
|
2016-06-22 02:40:35 +00:00
|
|
|
*/
|
2016-09-22 02:29:40 +00:00
|
|
|
//typedef uint8_t read_pins_t;
|
2016-06-22 02:40:35 +00:00
|
|
|
//typedef uint16_t read_pins_t;
|
2016-09-22 02:29:40 +00:00
|
|
|
typedef uint32_t read_pins_t;
|
2016-06-22 02:40:35 +00:00
|
|
|
|
2016-07-15 05:15:38 +00:00
|
|
|
/* SAMPLE_COUNT_MACRO is used in Debouncer_Samples.h
|
|
|
|
SAMPLE_COUNT_MACRO = 4 is very reliable for a keyboard.
|
2016-06-22 02:40:35 +00:00
|
|
|
Split keyboards with a long connecting wire or in environment with
|
2016-07-15 05:15:38 +00:00
|
|
|
strong electromagnetic interference (EMI) may need a larger SAMPLE_COUNT_MACRO for reliability.
|
2016-06-22 02:40:35 +00:00
|
|
|
*/
|
2016-07-15 05:15:38 +00:00
|
|
|
#define SAMPLE_COUNT_MACRO 4 //number of consecutive equal bits needed to change a debounced bit
|
2016-06-22 02:40:35 +00:00
|
|
|
|
|
|
|
#endif
|