As an alternative interface to one of my projects, basic VT100 functionality was implemented across serial (USB) on a Cypress PSoC4 BLE device. The Cypress iprintf code was used with a wrapper to implement basic VT100 features.
The screen capture below shows basic control of text and colour.
VT100 Example in TeraTerm |
As a starting reference the Bash Hackers website was used for the VT100 escape codes. A plethora of information can be found at sites such as Technopedia, TermSys, NorthEastern Uni, ASCII-Table and ISP to name a handful. What has been provided is only a portion of the total VT100 commands available.
Code for the PSoC
For Cypress Creator development environment a separate VT100 source and header file were created with the necessary escape commands.
VT100 Commands |
Foreground and background colors.
Cypress already provide a PSoC Creator example project with iprintf, which works effectively as the low level interface. A reference to this library was included in VT100 code.
VT100 Colours |
To use a number of commands at once or to configure the location of the cursor a few functions were written, prototypes below. There is room to improve these functions but for testing they function as required.
VT100 Function Prototypes |
Usage in the software main shown below.
VT100 Example Usage |
Testing
VT100 Example in PuTTY (Windows) |
TermPuTTY under Ubuntu Mate, customised settings
VT100 Example in PuTTY (Ubuntu Mate) |
RealTerm was placed in ANSI mode with good results, except for the colours.
VT100 Example in RealTerm |
vt100.c |
vt100.h |
Change Summary
Version 1.02 (15 March 2017)
- Added GPL details
- Corrected two text command enumerations
- Updated PSoC Creator project
- Added defines for background colour
- Changed names of foreground colour defines
- Updated PSoC Creator project
- Created PSoC Creator project for initial vt100 commands
Old G.Drive links replace
ReplyDelete