diff options
Diffstat (limited to 'platform/utilities/inc/debug_console_imx.h')
-rw-r--r-- | platform/utilities/inc/debug_console_imx.h | 116 |
1 files changed, 4 insertions, 112 deletions
diff --git a/platform/utilities/inc/debug_console_imx.h b/platform/utilities/inc/debug_console_imx.h index 21069b8..dd4bd06 100644 --- a/platform/utilities/inc/debug_console_imx.h +++ b/platform/utilities/inc/debug_console_imx.h @@ -31,122 +31,14 @@ #ifndef __DEBUG_CONSOLE_IMX_H__ #define __DEBUG_CONSOLE_IMX_H__ +#include <stdbool.h> #include <stdint.h> #include "device_imx.h" +#include "debug_console.h" -/*! - * @addtogroup debug_console - * @{ - */ - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define IO_MAXLINE 20 - -/*! @brief Configuration for toolchain's printf/scanf or Freescale version printf/scanf */ -#define PRINTF debug_printf -//#define PRINTF printf -#define SCANF debug_scanf -//#define SCANF scanf -#define PUTCHAR debug_putchar -//#define PUTCHAR putchar -#define GETCHAR debug_getchar -//#define GETCHAR getchar - -/*! @brief Error code for the debug console driver. */ -typedef enum _debug_console_status { - status_DEBUGCONSOLE_Success = 0U, - status_DEBUGCONSOLE_InvalidDevice, - status_DEBUGCONSOLE_AllocateMemoryFailed, - status_DEBUGCONSOLE_Failed -} debug_console_status_t; - -/******************************************************************************* - * API - ******************************************************************************/ - -#if defined(__cplusplus) -extern "C" { -#endif - -/*! - * @name Initialization - * @{ - */ - -/*! - * @brief Init the UART_IMX used for debug messages. - * - * Call this function to enable debug log messages to be output via the specified UART_IMX - * base address and at the specified baud rate. Just initializes the UART_IMX to the given baud - * rate and 8N1. After this function has returned, stdout and stdin will be connected to the - * selected UART_IMX. The debug_printf() function also uses this UART_IMX. - * - * @param base Which UART_IMX instance is used to send debug messages. - * @param clockRate The input clock of UART_IMX module. - * @param baudRate The desired baud rate in bits per second. - * @param mode The Modem mode (DTE/DCE), (see _uart_modem_mode enumeration). - * @return Whether initialization was successful or not. - */ -debug_console_status_t DbgConsole_Init(UART_Type* base, - uint32_t clockRate, - uint32_t baudRate, +void imx_DbgConsole_Init(UART_Type* base, uint32_t clockRate, uint32_t baudRate, uint32_t mode); - -/*! - * @brief Deinit the UART/LPUART used for debug messages. - * - * Call this function to disable debug log messages to be output via the specified UART/LPUART - * base address and at the specified baud rate. - * @return Whether de-initialization was successful or not. - */ -debug_console_status_t DbgConsole_DeInit(void); - -/*! - * @brief Prints formatted output to the standard output stream. - * - * Call this function to print formatted output to the standard output stream. - * - * @param fmt_s Format control string. - * @return Returns the number of characters printed, or a negative value if an error occurs. - */ -int debug_printf(const char *fmt_s, ...); - -/*! - * @brief Writes a character to stdout. - * - * Call this function to write a character to stdout. - * - * @param ch Character to be written. - * @return Returns the character written. - */ -int debug_putchar(int ch); - -/*! - * @brief Reads formatted data from the standard input stream. - * - * Call this function to read formatted data from the standard input stream. - * - * @param fmt_ptr Format control string. - * @return Returns the number of fields successfully converted and assigned. - */ -int debug_scanf(const char *fmt_ptr, ...); - -/*! - * @brief Reads a character from standard input. - * - * Call this function to read a character from standard input. - * - * @return Returns the character read. - */ -int debug_getchar(void); - -#if defined(__cplusplus) -} -#endif - -/*! @}*/ +void imx_DbgConsole_DeInit(void); #endif /* __DEBUG_CONSOLE_IMX_H__ */ /******************************************************************************* |