Hello,
I want to install my own Button & LED handling (not using the default board support). It works on the nRF52840 Dongle, but I also want it to work on the PCA10056 Board where I can debug.
*** No board support header files or c-files is included in the project. ***
On the Dongle I have configured 4 pins for Button Handling:
#define BUTTON_1 2 // P0.02 --> 0 + 2
#define BUTTON_2 47 // P1.15 --> 32 + 15
#define BUTTON_3 45 // P1.13 --> 32 + 13
#define BUTTON_4 42 // P1.10 --> 32 + 10
On the PCA10056 Board:
#define BUTTON_1 39
#define BUTTON_2 40
#define BUTTON_3 24
#define BUTTON_4 25
The following is set in sdk_config.h:
BSP_BTN_BLE_ENABLED 0
BUTTON_ENABLED 0
BLE_LBS_C_ENABLED 0
Buttons are set up as follows, using Button 1 as an example:
nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(false); // true means high accuracy
in_config.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrf_drv_gpiote_in_init(BUTTON_1, &in_config, casting_power_on_pin_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(BUTTON_1, true);
// I disable some buttons when they are pressed in the Event Handlers (and enable them again when others are pressed)
// Eg.g BUTTON_1 is Disabled with this code
nrf_gpio_cfg_sense_input(BUTTON_1, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_NOSENSE);
// And later re-enabled with this code in another Button Event handler:
nrf_gpio_cfg_sense_input(BUTTON_1, GPIO_PIN_CNF_PULL_Pullup, NRF_GPIO_PIN_SENSE_LOW);
*** All this works on the Dongle, but on the PCA10056 (1.0.0 2018.35) only BUTTON_3 & BUTTON_4 works. ***
I have tried to move SW7 to the ALT positon and use the alternate Pins for BUTTON_1 (11) and BUTTON_2 (12), but that does not work either.
Can someone please help ?