Hi,
usbd_cdc_acm project implemented UART over usb, which is great. However it cannot send bytes from PC to DK board, only DK board back to PC.
In order to implement sending bytes from PC to DK board, I looked into another project "uart"
If I spliced the following code into usbd_cdc_acm project, would i be able to do double direction communication? Like press 'Q' to exit.
int main(void) { uint32_t err_code; bsp_board_init(BSP_INIT_LEDS); const app_uart_comm_params_t comm_params = { RX_PIN_NUMBER, TX_PIN_NUMBER, RTS_PIN_NUMBER, CTS_PIN_NUMBER, UART_HWFC, false, #if defined (UART_PRESENT) NRF_UART_BAUDRATE_115200 #else NRF_UARTE_BAUDRATE_115200 #endif }; APP_UART_FIFO_INIT(&comm_params, UART_RX_BUF_SIZE, UART_TX_BUF_SIZE, uart_error_handle, APP_IRQ_PRIORITY_LOWEST, err_code); APP_ERROR_CHECK(err_code); #ifndef ENABLE_LOOPBACK_TEST printf("\r\nUART example started.\r\n"); while (true) { uint8_t cr; while (app_uart_get(&cr) != NRF_SUCCESS); while (app_uart_put(cr) != NRF_SUCCESS); if (cr == 'q' || cr == 'Q') { printf(" \r\nExit!\r\n"); while (true) { // Do nothing. } } } }
if yes, what should I set RX_PIN_NUMBER to?