Files
Sylva/include/serial.h
T

17 lines
627 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <efi.h>
#include <efiser.h>
#include <string_utils.h>
struct serial_context { // 串行内容结构体
EFI_SERIAL_IO_PROTOCOL *SerialIo;
};
extern serial_context g_serial;
void serial_init(EFI_SERIAL_IO_PROTOCOL *SerialIo); // 初始化串行驱动
void serial_write(String str); // 往串行写string
void serial_write_char(char c); // 往串行写char(不推荐使用)
void serial_write_hex(UINTN val, bool fill = true); // 往串行写十六进制数字(fill=false 不补前导0
char serial_read_char(); // 读串行