Get the Drive mode for an output pin

Hi

I need to read the Drive mode of how an output pin has been configured....

I see that there is an API to read pin's Pullup, Direction, Sense, etc configuration... but there is no API to get an Output's Drive mode

Here is the API I wrote if anybody needs it...   maybe this could be added to the SDK in a future release ?

__STATIC_INLINE nrf_gpio_pin_drive_t nrf_gpio_pin_drive_get(uint32_t pin_number)
{
    NRF_GPIO_Type * reg = nrf_gpio_pin_port_decode(&pin_number);

    return (nrf_gpio_pin_drive_t)((reg->PIN_CNF[pin_number] &
    		GPIO_PIN_CNF_DRIVE_Msk) >> GPIO_PIN_CNF_DRIVE_Pos);
}

Related