@@ -259,7 +259,7 @@ struct uarte_async_rx {
259259 int32_t timeout_slab ; /* rx_timeout divided by RX_TIMEOUT_DIV */
260260 int32_t timeout_left ; /* Current time left until user callback */
261261 union {
262- uint8_t ppi ;
262+ nrfx_gppi_handle_t ppi ;
263263 uint32_t cnt ;
264264 } cnt ;
265265 /* Flag to ensure that RX timeout won't be executed during ENDRX ISR */
@@ -310,7 +310,7 @@ struct uarte_nrfx_data {
310310 atomic_val_t poll_out_lock ;
311311 atomic_t flags ;
312312#ifdef UARTE_ENHANCED_POLL_OUT
313- uint8_t ppi_ch_endtx ;
313+ nrfx_gppi_handle_t ppi_h_endtx ;
314314#endif
315315};
316316
@@ -1081,17 +1081,14 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev)
10811081 return - EINVAL ;
10821082 }
10831083
1084- nrfx_timer_clear (& cfg -> timer );
1085-
1086- ret = nrfx_gppi_channel_alloc (& data -> async -> rx .cnt .ppi );
1087- if (ret != NRFX_SUCCESS ) {
1084+ ret = nrfx_gppi_conn_alloc (evt_addr , tsk_addr , & data -> async -> rx .cnt .ppi );
1085+ if (ret < 0 ) {
10881086 LOG_ERR ("Failed to allocate PPI Channel" );
10891087 nrfx_timer_uninit (& cfg -> timer );
1090- return - EINVAL ;
1088+ return ret ;
10911089 }
10921090
1093- nrfx_gppi_channel_endpoints_setup (data -> async -> rx .cnt .ppi , evt_addr , tsk_addr );
1094- nrfx_gppi_channels_enable (BIT (data -> async -> rx .cnt .ppi ));
1091+ nrfx_gppi_conn_enable (data -> async -> rx .cnt .ppi );
10951092 } else {
10961093 nrf_uarte_int_enable (uarte , NRF_UARTE_INT_RXDRDY_MASK );
10971094 }
@@ -3142,18 +3139,17 @@ static DEVICE_API(uart, uart_nrfx_uarte_driver_api) = {
31423139static int endtx_stoptx_ppi_init (NRF_UARTE_Type * uarte ,
31433140 struct uarte_nrfx_data * data )
31443141{
3145- nrfx_err_t ret ;
3142+ int ret ;
31463143
3147- ret = nrfx_gppi_channel_alloc (& data -> ppi_ch_endtx );
3148- if (ret != NRFX_SUCCESS ) {
3144+ ret = nrfx_gppi_conn_alloc (
3145+ nrf_uarte_event_address_get (uarte , NRF_UARTE_EVENT_ENDTX ),
3146+ nrf_uarte_task_address_get (uarte , NRF_UARTE_TASK_STOPTX , & data -> ppi_h_endtx ));
3147+ if (ret < 0 ) {
31493148 LOG_ERR ("Failed to allocate PPI Channel" );
3150- return - EIO ;
3149+ return ret ;
31513150 }
31523151
3153- nrfx_gppi_channel_endpoints_setup (data -> ppi_ch_endtx ,
3154- nrf_uarte_event_address_get (uarte , NRF_UARTE_EVENT_ENDTX ),
3155- nrf_uarte_task_address_get (uarte , NRF_UARTE_TASK_STOPTX ));
3156- nrfx_gppi_channels_enable (BIT (data -> ppi_ch_endtx ));
3152+ nrfx_gppi_conn_enable (data -> ppi_h_endtx );
31573153
31583154 return 0 ;
31593155}
0 commit comments