static void uart_init(void) { // Configure UART0 pins. nrf_gpio_cfg_output(TX_PIN_NUMBER);///< this pin remap to pin 21 nrf_gpio_cfg_input(RX_PIN_NUMBER, NRF_GPIO_PIN_NOPULL); ///< this pin remap to pin 22 NRF_UART0->PSELTXD = TX_PIN_NUMBER;///< this pin remap to pin 21 NRF_UART0->PSELRXD = RX_PIN_NUMBER;///< this pin remap to pin 22 NRF_UART0->BAUDRATE = BITRATE; // Clean out possible events from earlier operations NRF_UART0->EVENTS_RXDRDY = 0; NRF_UART0->EVENTS_TXDRDY = 0; NRF_UART0->EVENTS_ERROR = 0; // Activate UART. NRF_UART0->ENABLE = UART_ENABLE_ENABLE_Enabled; NRF_UART0->INTENSET = 0; NRF_UART0->TASKS_STARTTX = 1; NRF_UART0->TASKS_STARTRX = 1; }