maybe the document of GPIO Pin sensing mechanism has some wrong in the nRF51 Series Reference Manual (version 1.1).
sense high/low level defined in the document is different from the code of SDK 9.0.0.
high level is 1, low is 2;
PIN_CNF[n] (n=0..31): E RW SENSE Pin sensing mechanism DISABLED 0 Disabled HIGH 1 Sense for high level LOW 2 Sense for low level
code of sdk 9.0.0: high level is 2, low is 1;
/**
- @enum nrf_gpio_pin_sense_t
- @brief Enumerator used for selecting the pin to sense high or low level on the pin input. */
typedef enum {
NRF_GPIO_PIN_NOSENSE = GPIO_PIN_CNF_SENSE_Disabled, ///< Pin sense level disabled.
NRF_GPIO_PIN_SENSE_LOW = GPIO_PIN_CNF_SENSE_Low, ///< Pin sense low level.
NRF_GPIO_PIN_SENSE_HIGH = GPIO_PIN_CNF_SENSE_High, ///< Pin sense high level.
} nrf_gpio_pin_sense_t;