1 |
/*! \file vt100.h \brief VT100 terminal function library. */ |
1 |
/*! \file vt100.h \brief VT100 terminal function library. */ |
2 |
//***************************************************************************** |
2 |
//***************************************************************************** |
3 |
// |
3 |
// |
4 |
// File Name : 'vt100.h' |
4 |
// File Name : 'vt100.h' |
5 |
// Title : VT100 terminal function library |
5 |
// Title : VT100 terminal function library |
6 |
// Author : Pascal Stang - Copyright (C) 2002 |
6 |
// Author : Pascal Stang - Copyright (C) 2002 |
7 |
// Created : 2002.08.27 |
7 |
// Created : 2002.08.27 |
8 |
// Revised : 2002.08.27 |
8 |
// Revised : 2002.08.27 |
9 |
// Version : 0.1 |
9 |
// Version : 0.1 |
10 |
// Target MCU : Atmel AVR Series |
10 |
// Target MCU : Atmel AVR Series |
11 |
// Editor Tabs : 4 |
11 |
// Editor Tabs : 4 |
12 |
// |
12 |
// |
13 |
// NOTE: This code is currently below version 1.0, and therefore is considered |
13 |
// NOTE: This code is currently below version 1.0, and therefore is considered |
14 |
// to be lacking in some functionality or documentation, or may not be fully |
14 |
// to be lacking in some functionality or documentation, or may not be fully |
15 |
// tested. Nonetheless, you can expect most functions to work. |
15 |
// tested. Nonetheless, you can expect most functions to work. |
16 |
// |
16 |
// |
17 |
/// \ingroup general |
17 |
/// \ingroup general |
18 |
/// \defgroup vt100 VT100 Terminal Function Library (vt100.c) |
18 |
/// \defgroup vt100 VT100 Terminal Function Library (vt100.c) |
19 |
/// \code #include "vt100.h" \endcode |
19 |
/// \code #include "vt100.h" \endcode |
20 |
/// \par Overview |
20 |
/// \par Overview |
21 |
/// This library provides functions for sending VT100 escape codes to |
21 |
/// This library provides functions for sending VT100 escape codes to |
22 |
/// control a connected VT100 or ANSI terminal. Commonly useful functions |
22 |
/// control a connected VT100 or ANSI terminal. Commonly useful functions |
23 |
/// include setting the cursor position, clearing the screen, setting the text |
23 |
/// include setting the cursor position, clearing the screen, setting the text |
24 |
/// attributes (bold, inverse, blink, etc), and setting the text color. This |
24 |
/// attributes (bold, inverse, blink, etc), and setting the text color. This |
25 |
/// library will slowly be expanded to include support for codes as needed and |
25 |
/// library will slowly be expanded to include support for codes as needed and |
26 |
/// may eventually receive VT100 escape codes too. |
26 |
/// may eventually receive VT100 escape codes too. |
27 |
// |
27 |
// |
28 |
// This code is distributed under the GNU Public License |
28 |
// This code is distributed under the GNU Public License |
29 |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
29 |
// which can be found at http://www.gnu.org/licenses/gpl.txt |
30 |
// |
30 |
// |
31 |
//***************************************************************************** |
31 |
//***************************************************************************** |
32 |
|
32 |
|
33 |
#ifndef VT100_H |
33 |
#ifndef VT100_H |
34 |
#define VT100_H |
34 |
#define VT100_H |
35 |
|
35 |
|
36 |
#include "global.h" |
36 |
#include "global.h" |
37 |
|
37 |
|
38 |
// constants/macros/typdefs |
38 |
// constants/macros/typdefs |
39 |
// text attributes |
39 |
// text attributes |
40 |
#define VT100_ATTR_OFF 0 |
40 |
#define VT100_ATTR_OFF 0 |
41 |
#define VT100_BOLD 1 |
41 |
#define VT100_BOLD 1 |
42 |
#define VT100_USCORE 4 |
42 |
#define VT100_USCORE 4 |
43 |
#define VT100_BLINK 5 |
43 |
#define VT100_BLINK 5 |
44 |
#define VT100_REVERSE 7 |
44 |
#define VT100_REVERSE 7 |
45 |
#define VT100_BOLD_OFF 21 |
45 |
#define VT100_BOLD_OFF 21 |
46 |
#define VT100_USCORE_OFF 24 |
46 |
#define VT100_USCORE_OFF 24 |
47 |
#define VT100_BLINK_OFF 25 |
47 |
#define VT100_BLINK_OFF 25 |
48 |
#define VT100_REVERSE_OFF 27 |
48 |
#define VT100_REVERSE_OFF 27 |
49 |
|
49 |
|
50 |
// functions |
50 |
// functions |
51 |
|
51 |
|
52 |
//! vt100Init() initializes terminal and vt100 library |
52 |
//! vt100Init() initializes terminal and vt100 library |
53 |
/// Run this init routine once before using any other vt100 function. |
53 |
/// Run this init routine once before using any other vt100 function. |
54 |
void vt100Init(void); |
54 |
void vt100Init(void); |
55 |
|
55 |
|
56 |
//! vt100ClearScreen() clears the terminal screen |
56 |
//! vt100ClearScreen() clears the terminal screen |
57 |
void vt100ClearScreen(void); |
57 |
void vt100ClearScreen(void); |
58 |
|
58 |
|
59 |
//! vt100SetAttr() sets the text attributes like BOLD or REVERSE |
59 |
//! vt100SetAttr() sets the text attributes like BOLD or REVERSE |
60 |
/// Text written to the terminal after this function is called will have |
60 |
/// Text written to the terminal after this function is called will have |
61 |
/// the desired attribuutes. |
61 |
/// the desired attribuutes. |
62 |
void vt100SetAttr(u08 attr); |
62 |
void vt100SetAttr(u08 attr); |
63 |
|
63 |
|
64 |
//! vt100SetCursorMode() sets the cursor to visible or invisible |
64 |
//! vt100SetCursorMode() sets the cursor to visible or invisible |
65 |
void vt100SetCursorMode(u08 visible); |
65 |
void vt100SetCursorMode(u08 visible); |
66 |
|
66 |
|
67 |
//! vt100SetCursorPos() sets the cursor position |
67 |
//! vt100SetCursorPos() sets the cursor position |
68 |
/// All text which is written to the terminal after a SetCursorPos command |
68 |
/// All text which is written to the terminal after a SetCursorPos command |
69 |
/// will begin at the new location of the cursor. |
69 |
/// will begin at the new location of the cursor. |
70 |
void vt100SetCursorPos(u08 line, u08 col); |
70 |
void vt100SetCursorPos(u08 line, u08 col); |
71 |
|
71 |
|
72 |
#endif |
72 |
#endif |