@@ -756,6 +756,16 @@ NRF_STATIC_INLINE void nrf_gpio_port_retain_set(NRF_GPIO_Type * p_reg, uint32_t
756756 * @return Mask of retention domains set, created using @ref nrf_gpio_retain_mask_t.
757757 */
758758NRF_STATIC_INLINE uint32_t nrf_gpio_port_retain_get (NRF_GPIO_Type const * p_reg );
759+
760+ /**
761+ * @brief Function for checking the retention setting of a pin.
762+ *
763+ * @param pin_number Pin number.
764+ *
765+ * @retval true If pin is retained.
766+ * @retval false If pin is not retained.
767+ */
768+ NRF_STATIC_INLINE bool nrf_gpio_pin_retain_check (uint32_t pin_number );
759769#endif
760770
761771#if NRF_GPIO_HAS_RETENTION_SETCLEAR
@@ -774,6 +784,20 @@ NRF_STATIC_INLINE void nrf_gpio_port_retain_enable(NRF_GPIO_Type * p_reg, uint32
774784 * @param mask Mask of pins to have retention be disabled, created using @ref nrf_gpio_retain_mask_t.
775785 */
776786NRF_STATIC_INLINE void nrf_gpio_port_retain_disable (NRF_GPIO_Type * p_reg , uint32_t mask );
787+
788+ /**
789+ * @brief Function for enabling the retention of a pin.
790+ *
791+ * @param pin_number Pin number.
792+ */
793+ NRF_STATIC_INLINE void nrf_gpio_pin_retain_enable (uint32_t pin_number );
794+
795+ /**
796+ * @brief Function for disabling the retention of a pin.
797+ *
798+ * @param pin_number Pin number.
799+ */
800+ NRF_STATIC_INLINE void nrf_gpio_pin_retain_disable (uint32_t pin_number );
777801#endif
778802
779803
@@ -1344,6 +1368,13 @@ NRF_STATIC_INLINE uint32_t nrf_gpio_port_retain_get(NRF_GPIO_Type const * p_reg)
13441368{
13451369 return p_reg -> RETAIN ;
13461370}
1371+
1372+ NRF_STATIC_INLINE bool nrf_gpio_pin_retain_check (uint32_t pin_number )
1373+ {
1374+ NRF_GPIO_Type * reg = nrf_gpio_pin_port_decode (& pin_number );
1375+
1376+ return (nrf_gpio_port_retain_get (reg ) & (1UL << pin_number )) != 0U ;
1377+ }
13471378#endif
13481379
13491380#if NRF_GPIO_HAS_RETENTION_SETCLEAR
@@ -1356,6 +1387,20 @@ NRF_STATIC_INLINE void nrf_gpio_port_retain_disable(NRF_GPIO_Type * p_reg, uint3
13561387{
13571388 p_reg -> RETAINCLR = mask ;
13581389}
1390+
1391+ NRF_STATIC_INLINE void nrf_gpio_pin_retain_enable (uint32_t pin_number )
1392+ {
1393+ NRF_GPIO_Type * reg = nrf_gpio_pin_port_decode (& pin_number );
1394+
1395+ nrf_gpio_port_retain_enable (reg , 1UL << pin_number );
1396+ }
1397+
1398+ NRF_STATIC_INLINE void nrf_gpio_pin_retain_disable (uint32_t pin_number )
1399+ {
1400+ NRF_GPIO_Type * reg = nrf_gpio_pin_port_decode (& pin_number );
1401+
1402+ nrf_gpio_port_retain_disable (reg , 1UL << pin_number );
1403+ }
13591404#endif
13601405
13611406#if NRF_GPIO_HAS_DETECT_MODE
0 commit comments