/*
* Keyboarb description:
* PORT Bit Keyboard
*
* B 6 -> o--------------------+
* B 5 -> o---------------+ |
* B 4 -> o----------+ | |
* | | |
* B 0 <- o---------[1]--[2]--[3]
* B 1 <- o------+ | | |
* B 2 <- o----+ +--[4]--[5]--[6]
* B 3 <- o--+ | | | |
* | +----[7]--[8]--[9]
* | | | |
* +------[*]--[0]--[#]
*
* Edit the Keyboard map in the file kbd_keys.h
*/
//----------------- Keyboard interface parameters -----------------
// Edit this parameters
// Define Keyboard Ouput port. Only one output line will be selected at a time
#define kbd_c PORTB
#define kbd_cc TRISB
// Define how many lines will be configured as output [1 up to 8]
#define KBD_COLS 3
//Define all output columns pins
#define COL0 (1 << 4)
#define COL1 (1 << 5)
#define COL2 (1 << 6)
//#define COL3 (1 << 3)
//#define COL4 (1 << 4)
//#define COL5 (1 << 5)
//#define COL6 (1 << 6)
//#define COL7 (1 << 7)
// Define Keyboard input port. It will be read after each selected output line
#define kbd_l PORTB
#define kbd_lc TRISB
// How many register are used for IO
#define KBD_IO 1 // 1: Same register for input and output
// 2: Different register for input and output
// Define how many lines will be configured as input [1 up to 8]
#define KBD_LINES 4
// Define all input lines pins
#define LINE0 (1 << 0)
#define LINE1 (1 << 1)
#define LINE2 (1 << 2)
#define LINE3 (1 << 3)
//#define LINE4 (1 << 4)
//#define LINE5 (1 << 5)
//#define LINE6 (1 << 6)
//#define LINE7 (1 << 7)
// Set this number to apx n/333 where n is the number of times you expect
// to call kbd_getc each second
#define KBD_DEBOUNCE_FACTOR 333
//----------------- Functions interface -----------------
char kbd_Getc(void);