metalsvm/arch/x86/include/asm/uart.h

74 lines
1.7 KiB
C

/*
* Copyright 2010 Steffen Vogel, Chair for Operating Systems,
* RWTH Aachen University
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of MetalSVM.
*/
/**
* @author Steffen Vogel
* @file arch/x86/include/asm/uart.h
* @brief COM port related code
*/
#ifndef __ARCH_UART_H__
#define __ARCH_UART_H__
#include <metalsvm/stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef CONFIG_UART
/** @brief Initialize VGA output and clear the screen */
void uart_init(void);
/** @brief Send a single character to the uart
*
* @return The original input character casted to int
*/
void uart_putchar(char c);
/** @brief Receive a single character on the uart
*
* @return The original input character casted to int
*/
char uart_getchar(void);
/** @brief Simple string output on screen.
*
* If you want a new line you will have to "\\n".
*
* @return Length of output in bytes
*/
void uart_puts(const char *str);
/** @brief Simple string output on screen.
*
* If you want a new line you will have to "\\n".
*
* @return Length of output in bytes
*/
int uart_gets(char *str, size_t len);
#endif
#ifdef __cplusplus
}
#endif
#endif