1 /* 2 * Copyright (c) 2023 Yonatan Schachter 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/kernel.h> 8 #include <zephyr/device.h> 9 #include <zephyr/drivers/uart.h> 10 main(void)11int main(void) 12 { 13 char data; 14 const struct device *uart0 = DEVICE_DT_GET(DT_NODELABEL(pio1_uart0)); 15 const struct device *uart1 = DEVICE_DT_GET(DT_NODELABEL(pio1_uart1)); 16 17 if (!device_is_ready(uart0)) { 18 return 0; 19 } 20 21 if (!device_is_ready(uart1)) { 22 return 0; 23 } 24 25 while (1) { 26 if (!uart_poll_in(uart0, &data)) { 27 uart_poll_out(uart0, data); 28 } 29 30 if (!uart_poll_in(uart1, &data)) { 31 uart_poll_out(uart1, data); 32 } 33 } 34 35 return 0; 36 } 37