简体   繁体   English

UART,返回页面开头

[英]UART, return to the start of the page

Is it possible,somehow,to return to the beginning of the page, not line, page. 是否有可能以某种方式返回到页面的开头,而不是行,页面。 Using something like "hello\\r" would,obviously, write "hello" and return to the start of the line. 显然,使用"hello\\r"将写成“ hello”并返回到该行的开头。

But what about when I am on a second line? 但是,当我处于第二行时该怎么办? So after "hello\\n" it would put me on a second line. 因此,在"hello\\n" ,我将进入第二行。 Can I somehow return back to the 1st line. 我能以某种方式返回第一行。

From the research I have conducted it seems that you can only operate on 1 line, but I am not 100% sure and thus would like someone to confirm this. 根据我进行的研究,似乎您只能在1条线上进行操作,但是我不确定100%正确,因此希望有人对此进行确认。

Programming in C and using RealTerm. 用C编程并使用RealTerm。

RealTerm has an ANSI terminal emulation mode. RealTerm具有ANSI终端仿真模式。

Find the "Display Formatting " configuration dialog and select the Ansi option. 找到“显示格式”配置对话框,然后选择Ansi选项。

Now you can embed an escape sequence for Cursor Home much like you embed the newline . 现在,您可以像嵌入换行符一样为Cursor Home嵌入转义序列。

<ESC>[H

Where, of course, <ESC> means the single character 0x1b . 当然, <ESC>表示单个字符0x1b You can implement it like this 你可以这样实现

sprintf(buffer, "%c[Hmy text\n", 27);
transmit(buffer);

or similar. 或类似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM