This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Reading GPIO status when configuring it to PWM pin

Dear Nordic, 

  I configure a GPIO pin to PWM output, from this diagram, if we enable `PIN[0].CNF.INPUT`, we can read GPIO status while the PWM is running. But I check the driver in `nrfx_pwm.c`. It disconnect  `PIN[0].CNF.INPUT`. That means I couldn't read output status, but I did read it. Is it a bug in hardware? Can I just simply read  `PIN[0].CNF.INPUT` without configuring `PIN[0].CNF.INPUT`?

__STATIC_INLINE void nrf_gpio_cfg_output(uint32_t pin_number)
{
    nrf_gpio_cfg(
        pin_number,
        NRF_GPIO_PIN_DIR_OUTPUT,
        NRF_GPIO_PIN_INPUT_DISCONNECT,
        NRF_GPIO_PIN_NOPULL,
        NRF_GPIO_PIN_S0S1,
        NRF_GPIO_PIN_NOSENSE);
}

Best Regards,

Eugene

Related