Line data Source code
1 0 : /* uart_console.h - uart console driver */ 2 : 3 : /* 4 : * Copyright (c) 2011, 2014 Wind River Systems, Inc. 5 : * 6 : * SPDX-License-Identifier: Apache-2.0 7 : */ 8 : 9 : #ifndef ZEPHYR_INCLUDE_DRIVERS_CONSOLE_UART_CONSOLE_H_ 10 : #define ZEPHYR_INCLUDE_DRIVERS_CONSOLE_UART_CONSOLE_H_ 11 : 12 : #include <zephyr/kernel.h> 13 : 14 : #ifdef __cplusplus 15 : extern "C" { 16 : #endif 17 : 18 : /** @brief Register uart input processing 19 : * 20 : * Input processing is started when string is typed in the console. 21 : * Carriage return is translated to NULL making string always NULL 22 : * terminated. Application before calling register function need to 23 : * initialize two fifo queues mentioned below. 24 : * 25 : * @param avail k_fifo queue keeping available input slots 26 : * @param lines k_fifo queue of entered lines which to be processed 27 : * in the application code. 28 : * @param completion callback for tab completion of entered commands 29 : */ 30 1 : void uart_register_input(struct k_fifo *avail, struct k_fifo *lines, 31 : uint8_t (*completion)(char *str, uint8_t len)); 32 : 33 : /* 34 : * Allows having debug hooks in the console driver for handling incoming 35 : * control characters, and letting other ones through. 36 : */ 37 : #ifdef CONFIG_UART_CONSOLE_DEBUG_SERVER_HOOKS 38 : #define UART_CONSOLE_DEBUG_HOOK_HANDLED 1 39 : #define UART_CONSOLE_OUT_DEBUG_HOOK_SIG(x) int(x)(char c) 40 : typedef UART_CONSOLE_OUT_DEBUG_HOOK_SIG(uart_console_out_debug_hook_t); 41 : 42 : void uart_console_out_debug_hook_install( 43 : uart_console_out_debug_hook_t *hook); 44 : 45 : typedef int (*uart_console_in_debug_hook_t) (uint8_t); 46 : 47 : void uart_console_in_debug_hook_install(uart_console_in_debug_hook_t hook); 48 : 49 : #endif 50 : 51 : #ifdef __cplusplus 52 : } 53 : #endif 54 : 55 : #endif /* ZEPHYR_INCLUDE_DRIVERS_CONSOLE_UART_CONSOLE_H_ */