41
41
#include "hal/serial_api.h"
42
42
43
43
#include "nrf_uarte.h"
44
+ #include "nrfx_uarte.h"
44
45
#include "nrfx_uart.h"
45
46
#include "nrf_atfifo.h"
46
47
#include "app_util_platform.h"
@@ -166,12 +167,12 @@ typedef enum {
166
167
/**
167
168
* UARTE state. One for each instance.
168
169
*/
169
- static nordic_uart_state_t nordic_nrf5_uart_state [NRFX_UART_ENABLED_COUNT ] = { 0 };
170
+ static nordic_uart_state_t nordic_nrf5_uart_state [NRFX_UARTE_ENABLED_COUNT ] = { 0 };
170
171
171
172
/**
172
173
* Array with UARTE register pointers for easy access.
173
174
*/
174
- static NRF_UARTE_Type * nordic_nrf5_uart_register [NRFX_UART_ENABLED_COUNT ] = {
175
+ static NRF_UARTE_Type * nordic_nrf5_uart_register [NRFX_UARTE_ENABLED_COUNT ] = {
175
176
NRF_UARTE0 ,
176
177
#if UART1_ENABLED
177
178
NRF_UARTE1 ,
@@ -193,6 +194,10 @@ NRF_ATFIFO_DEF(nordic_nrf5_uart_fifo_1, uint8_t, UART1_FIFO_BUFFER_SIZE);
193
194
*/
194
195
static uint8_t nordic_nrf5_uart_swi_mask_tx_0 = 0 ;
195
196
static uint8_t nordic_nrf5_uart_swi_mask_rx_0 = 0 ;
197
+ #if UART1_ENABLED
198
+ static uint8_t nordic_nrf5_uart_swi_mask_tx_1 = 0 ;
199
+ static uint8_t nordic_nrf5_uart_swi_mask_rx_1 = 0 ;
200
+ #endif
196
201
197
202
/**
198
203
* Global variables expected by mbed_retarget.cpp for STDOUT.
@@ -881,7 +886,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
881
886
nordic_nrf5_uart_state [1 ].owner = NULL ;
882
887
883
888
/* Allocate a PPI channel for flow control */
884
- ret = nrf_drv_ppi_channel_alloc (& nordic_nrf5_uart_state [1 ].ppi_rts );
889
+ ret = nrfx_ppi_channel_alloc (& nordic_nrf5_uart_state [1 ].ppi_rts );
885
890
MBED_ASSERT (ret == NRF_SUCCESS );
886
891
887
892
/* Clear RTS */
@@ -891,8 +896,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
891
896
nrf_uarte_int_disable (nordic_nrf5_uart_register [1 ], 0xFFFFFFFF );
892
897
893
898
NVIC_SetVector (UARTE1_IRQn , (uint32_t ) nordic_nrf5_uart1_handler );
894
- NRFX_IRQ_PRIORITY_SET (nrfx_get_irq_number ( UARTE1_IRQn ) , APP_IRQ_PRIORITY_HIGHEST );
895
- NRFX_IRQ_ENABLE (nrfx_get_irq_number ( UARTE1_IRQn ) );
899
+ NRFX_IRQ_PRIORITY_SET (UARTE1_IRQn , APP_IRQ_PRIORITY_HIGHEST );
900
+ NRFX_IRQ_ENABLE (UARTE1_IRQn );
896
901
#endif
897
902
}
898
903
0 commit comments