OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [drivers/] [src/] [include/] [vgatext.h] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 jlechner
/**
2
 * \brief Driver for apbvga AMBA module from the GRLIB
3
 * \author Martin Luipersbeck
4
 */
5
 
6
 
7
#ifndef __VGATEXT_H__
8
#define __VGATEXT_H__
9
 
10
#include "drivers.h"
11
 
12
#define VGATEXT_DATA             0
13
#define VGATEXT_BG_COLOR         4
14
#define VGATEXT_FG_COLOR         8
15
 
16
/**
17
 * \struct module_handle_t
18
 * \brief Stores context for access of a specific extension module.
19
 */
20
typedef struct {
21
  scarts_addr_t baseAddress;
22
  uint16_t cursor;
23
} vgatext_handle_t;
24
 
25
 
26
#include <stdint.h>
27
 
28
/**
29
 * \brief Initializes handle. Clears the screen and sets back- and
30
 *   foreground color to default values.
31
 * \param h Handle.
32
 * \param baseAddress Base address of the hardware module.
33
 */
34
void vgatext_initHandle(vgatext_handle_t *h, scarts_addr_t baseAddress);
35
 
36
/**
37
 * \brief Frees all allocated resources for module handle.
38
 * \param h Handle.
39
 */
40
void vgatext_releaseHandle(vgatext_handle_t *h);
41
 
42
/**
43
 * \brief Clears the screen.
44
 * \param h Handle.
45
 */
46
void vgatext_clear(vgatext_handle_t *h);
47
 
48
/**
49
 * \brief Sets the cursor position where characters are drawn.
50
 * \param h Handle.
51
 * \param c Cursor position. Possible value range: 0 - 4079.
52
 */
53
void vgatext_set_cursor(vgatext_handle_t *h, uint16_t c);
54
 
55
/**
56
 * \brief Moves the cursor to the next line.
57
 * \param h Handle.
58
 */
59
void vgatext_newline(vgatext_handle_t *h);
60
 
61
/**
62
 * \brief Draws a given 8-bit value as hexadecimal string
63
 *   at the current cursor position.
64
 * \param h Handle.
65
 * \param value Output value.
66
 */
67
void vgatext_printByteHex(vgatext_handle_t *h, uint8_t value);
68
 
69
/**
70
 * \brief Draws a given 32-bit value as hexadecimal string
71
 * at the current cursor position.
72
 * \param h Handle.
73
 * \param value Output value.
74
 */
75
void vgatext_printIntHex(vgatext_handle_t *h, uint32_t value);
76
 
77
/**
78
 * \brief Draws a given 32-bit value as decimal string
79
 *   at the current cursor position.
80
 * \param h Handle.
81
 * \value value Output value.
82
 */
83
void vgatext_printUInt(vgatext_handle_t *h, uint32_t value);
84
 
85
/**
86
 * \brief Draws a given string at the current cursor position.
87
 * \param h Handle.
88
 * \param pStr String pointer.
89
 * \param length String length.
90
 */
91
void vgatext_print_str(vgatext_handle_t *h, const char* pStr, int length);
92
 
93
/**
94
 * \brief Draws a character at the current cursor position.
95
 * \param h Handle.
96
 * \param c Output character.
97
 */
98
void vgatext_print_char(vgatext_handle_t *h, uint8_t c);
99
 
100
/**
101
 * \brief Sets the foreground color.
102
 * \param h Handle.
103
 * \param r Red color value.
104
 * \param g Green color value.
105
 * \param b Blue color value.
106
 */
107
void vgatext_set_fg_color(vgatext_handle_t *h, uint8_t r, uint8_t g, uint8_t b);
108
 
109
/**
110
 * \brief Sets the background color.
111
 * \param h Handle.
112
 * \param r Red color value.
113
 * \param g Green color value.
114
 * \param b Blue color value.
115
 */
116
void vgatext_set_bg_color(vgatext_handle_t *h, uint8_t r, uint8_t g, uint8_t b);
117
 
118
#endif // __VGATEXT_H__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.