@@ -1205,8 +1205,14 @@ static int uarte_instance_init(struct device *dev,
1205
1205
static void uarte_nrfx_set_power_state (struct device * dev , u32_t new_state )
1206
1206
{
1207
1207
NRF_UARTE_Type * uarte = get_uarte_instance (dev );
1208
+ u32_t tx_pin = nrf_uarte_tx_pin_get (uarte );
1209
+ u32_t rx_pin = nrf_uarte_rx_pin_get (uarte );
1208
1210
1209
1211
if (new_state == DEVICE_PM_ACTIVE_STATE ) {
1212
+ nrf_gpio_pin_write (tx_pin , 1 );
1213
+ nrf_gpio_cfg_output (tx_pin );
1214
+ nrf_gpio_cfg_input (rx_pin , NRF_GPIO_PIN_NOPULL );
1215
+
1210
1216
nrf_uarte_enable (uarte );
1211
1217
#ifdef CONFIG_UART_ASYNC_API
1212
1218
if (get_dev_data (dev )-> async ) {
@@ -1225,6 +1231,8 @@ static void uarte_nrfx_set_power_state(struct device *dev, u32_t new_state)
1225
1231
#ifdef CONFIG_UART_ASYNC_API
1226
1232
if (get_dev_data (dev )-> async ) {
1227
1233
nrf_uarte_disable (uarte );
1234
+ nrf_gpio_cfg_default (tx_pin );
1235
+ nrf_gpio_cfg_default (rx_pin );
1228
1236
return ;
1229
1237
}
1230
1238
#endif
@@ -1234,6 +1242,8 @@ static void uarte_nrfx_set_power_state(struct device *dev, u32_t new_state)
1234
1242
}
1235
1243
nrf_uarte_event_clear (uarte , NRF_UARTE_EVENT_RXTO );
1236
1244
nrf_uarte_disable (uarte );
1245
+ nrf_gpio_cfg_default (tx_pin );
1246
+ nrf_gpio_cfg_default (rx_pin );
1237
1247
}
1238
1248
}
1239
1249
0 commit comments