Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get generic code scanning module for non-nrf52 boards. #291

Open
github-actions bot opened this issue Mar 12, 2022 · 0 comments
Open

get generic code scanning module for non-nrf52 boards. #291

github-actions bot opened this issue Mar 12, 2022 · 0 comments

Comments

@github-actions
Copy link

if DIODE_DIRECTION == COL2ROW
define writeRow(r) digitalWrite(r,LOW)
define modeCol(c) pinMode(c, INPUT_PULLUP)
ifdef NRF52840_XXAA
define gpioIn (((uint64_t)(NRF_P1->IN)^0xffffffff)<<32)|(NRF_P0->IN)^0xffffffff
else
define gpioIn (NRF_GPIO->IN)^0xffffffff
endif
else
define writeRow(r) digitalWrite(r,HIGH)
define modeCol(c) pinMode(c, INPUT_PULLDOWN)
ifdef NRF52840_XXAA
define gpioIn (((uint64_t)NRF_P1->IN)<<32)|(NRF_P0->IN)
else
define gpioIn NRF_GPIO->IN
endif
endif
ifdef NRF52840_XXAA
define PINDATATYPE uint64_t
else
define PINDATATYPE uint32_t
endif

THIS FUNCTION TAKES CARE OF SCANNING THE MATRIX AS WELL AS DEBOUNCING THE KEY PRESSES
IF YOU ARE USING A DIFFERENT METHOD TO READ/WRITE TO GPIOS (SUCH AS SHIFT REGISTERS OR GPIO EXPANDERS), YOU WILL
NEED TO RE-WORK THIS ROUTINE. IDEALLY WE SHOULD HAVE THIS AS A COMPILE-TIME OPTION TO SWITCH BETWEEN ROUTINES.

Line: 12

// Keyboard Scanning
/**************************************************************************************************************************/
//todo get scanning code into separate module
//todo get generic code scanning module for non-nrf52 boards.
#if DIODE_DIRECTION == COL2ROW
#define writeRow(r) digitalWrite(r,LOW)
#define modeCol(c) pinMode(c, INPUT_PULLUP)
#ifdef NRF52840_XXAA
#define gpioIn (((uint64_t)(NRF_P1->IN)^0xffffffff)<<32)|(NRF_P0->IN)^0xffffffff
#else
#define gpioIn (NRF_GPIO->IN)^0xffffffff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants