1 /* 2 * Copyright (c) 2023 Google LLC 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef SRC_UART_MOCK_H__ 8 #define SRC_UART_MOCK_H__ 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 extern struct device uart_mock; 15 16 struct uart_mock_data { 17 uint8_t *rx_buf; 18 const uint8_t *tx_buf; 19 size_t tx_len; 20 int32_t rx_timeout; 21 size_t rx_buf_size; 22 uart_callback_t cb; 23 void *user_data; 24 struct k_sem resp_sent; 25 }; 26 27 int uart_mock_tx(const struct device *dev, const uint8_t *buf, size_t len, int32_t timeout); 28 29 #ifdef __cplusplus 30 } 31 #endif 32 33 #endif /* SRC_UART_MOCK_H__ */ 34