I have the following two lines with pin 21 not connected to anything:
nrf_gpio_cfg_input(21, NRF_GPIO_PIN_PULLUP);
uint32_t value = nrf_gpio_pin_read(21);
I would expect the "value" to be "1" but it is "0". When I measure voltage, I get 1.75 volts. I use NRF51822 AC (Waveshare Core51822 + BLE400 development board). I power it from 3.3v external source (laptop -> ST-Link V2 -> BLE400 -> Core51822).
What do I do wrong?
When I do
nrf_gpio_cfg_output(21);
nrf_gpio_pin_set(21);
I get 3.08 volts.