Dear,
I am using nRF9160 DK,
I can re-define pin for UART0 and UART1, from UART0, i can receive data from UART0/UART1.
#include <zephyr.h> #include <misc/printk.h> #include <uart.h> static u8_t uart_buf[1024]; void uart_cb(struct device *x) { uart_irq_update(x); int data_length = 0; if (uart_irq_rx_ready(x)) { data_length = uart_fifo_read(x, uart_buf, sizeof(uart_buf)); uart_buf[data_length] = 0; } printk("%s", uart_buf); } void main(void) { struct device *uart0 = device_get_binding("UART_0"); struct device *uart1 = device_get_binding("UART_1"); uart_irq_callback_set(uart0, uart_cb); uart_irq_rx_enable(uart0); uart_irq_callback_set(uart1, uart_cb); uart_irq_rx_enable(uart1); printk("UART loopback start!\n"); while (1) { k_cpu_idle(); } }
Now, I want to send data to UART1.
Plz help me
Regards,
Thanks