@@ -756,6 +756,16 @@ NRF_STATIC_INLINE void nrf_gpio_port_retain_set(NRF_GPIO_Type * p_reg, uint32_t
756
756
* @return Mask of retention domains set, created using @ref nrf_gpio_retain_mask_t.
757
757
*/
758
758
NRF_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 );
759
769
#endif
760
770
761
771
#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
774
784
* @param mask Mask of pins to have retention be disabled, created using @ref nrf_gpio_retain_mask_t.
775
785
*/
776
786
NRF_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 );
777
801
#endif
778
802
779
803
@@ -1344,6 +1368,13 @@ NRF_STATIC_INLINE uint32_t nrf_gpio_port_retain_get(NRF_GPIO_Type const * p_reg)
1344
1368
{
1345
1369
return p_reg -> RETAIN ;
1346
1370
}
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
+ }
1347
1378
#endif
1348
1379
1349
1380
#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
1356
1387
{
1357
1388
p_reg -> RETAINCLR = mask ;
1358
1389
}
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
+ }
1359
1404
#endif
1360
1405
1361
1406
#if NRF_GPIO_HAS_DETECT_MODE
0 commit comments