MicrOS
|
Go to the source code of this file.
Classes | |
struct | vga_screen_pos |
Struct that defines position on screen. More... | |
struct | vga_color_with_blink |
Color of one character with blinking bit. More... | |
struct | vga_color_without_blink |
Color of one character without blinking bit. More... | |
union | vga_color |
Color of one character. More... | |
struct | vga_character |
Struct that define one character. More... | |
union | screen_char |
Define one character on screen. More... | |
Enumerations | |
enum | VGA_TEXT_MODES { VGA_MODE_00H = 0x00, VGA_MODE_01H = 0x01, VGA_MODE_02H = 0x02, VGA_MODE_03H = 0x03, VGA_MODE_07H = 0x07 } |
Enum represent available VGA text modes. More... | |
Functions | |
uint8_t | vga_init (uint8_t mode) |
Initialization of VGA. More... | |
void | vga_printchar (char character) |
Print character on screen. More... | |
void | vga_printchar_color (char character, vga_color *color) |
Print character on screen. More... | |
void | vga_printstring (const char *str) |
Print string on screen. More... | |
void | vga_printstring_color (const char *str, vga_color *color) |
Print string on screen. More... | |
void | vga_set_char (uint16_t x, uint16_t y, char character) |
Set character on given point on screen. More... | |
void | vga_set_char_struct (vga_screen_pos spos, char character) |
Set character on given point on screen. More... | |
char | vga_get_char (uint16_t x, uint16_t y) |
Get character from given point on screen. More... | |
char | vga_get_char_struct (vga_screen_pos spos) |
Get character from given point on screen. More... | |
void | vga_set_color (uint16_t x, uint16_t y, vga_color col) |
Set character color on given point on screen. More... | |
void | vga_set_color_struct (vga_screen_pos spos, vga_color col) |
Set character color on given point on screen. More... | |
union vga_color | vga_get_color (uint16_t x, uint16_t y) |
Get character color from given point on screen. More... | |
union vga_color | vga_get_color_struct (vga_screen_pos spos) |
Get character color from given point on screen. More... | |
void | vga_set_character (uint16_t x, uint16_t y, vga_character character) |
Set character and character color on given point on screen. More... | |
void | vga_set_character_struct (vga_screen_pos spos, vga_character character) |
Set character and character color on given point on screen. More... | |
vga_character | vga_get_character (uint16_t x, uint16_t y) |
Get character and character color color from given point on screen. More... | |
vga_character | vga_get_character_struct (vga_screen_pos spos) |
Get character and character color color from given point on screen. More... | |
void | vga_set_cursor_pos (uint16_t x, uint16_t y) |
Set cursor position. More... | |
void | vga_set_cursor_pos_struct (vga_screen_pos spos) |
Set cursor position. More... | |
vga_screen_pos | vga_get_cursor_pos () |
Get cursor position. More... | |
void | vga_clear_screen () |
Clear screen. More... | |
void | vga_clear_given_screen (uint8_t screen) |
Clear given screen. More... | |
void | vga_clear_all_screens () |
Clear all screen. More... | |
void | vga_change_printing_screen (uint8_t screen) |
Change printing screen. More... | |
void | vga_copy_screen (uint8_t from, uint8_t to) |
Copy printing screen. More... | |
void | vga_cursor_on () |
Turn on cursor. More... | |
void | vga_cursor_off () |
Turn off cursor. More... | |
void | vga_newline () |
Print new line. More... | |
uint16_t | __vga_calcualte_position_with_offset (uint16_t x, uint16_t y) |
Calculate position with offset. More... | |
uint16_t | __vga_calcualte_position_without_offset (uint16_t x, uint16_t y) |
Calculate position without offset. More... | |
void | __vga_enable_cursor (uint8_t cursor_start, uint8_t cursor_end) |
Turn on cursor. More... | |
void | __vga_disable_cursor () |
Disable cursor. More... | |
vga_color | __vga_get_default_terminal_color (uint8_t vga_current_mode) |
Get default terminal color. More... | |
#define VGA_BLINK 0x01 |
#define VGA_COLOR_BLACK 0x00 |
#define VGA_COLOR_BLUE 0x01 |
#define VGA_COLOR_BROWN 0x06 |
#define VGA_COLOR_CYAN 0x03 |
#define VGA_COLOR_DARK_GRAY 0x08 |
#define VGA_COLOR_GREEN 0x02 |
#define VGA_COLOR_LIGHT_BLUE 0x09 |
#define VGA_COLOR_LIGHT_CYAN 0x0B |
#define VGA_COLOR_LIGHT_GRAY 0x07 |
#define VGA_COLOR_LIGHT_GREEN 0x0A |
#define VGA_COLOR_LIGHT_MAGENTA 0x0D |
#define VGA_COLOR_LIGHT_RED 0x0C |
#define VGA_COLOR_MAGENTA 0x05 |
#define VGA_COLOR_RED 0x04 |
#define VGA_COLOR_WHITE 0x0F |
#define VGA_COLOR_YELLOW 0x0E |
#define VGA_MODE_00H_BASE_ADDR 0xC00B8000 |
The base memory address for mode 00h.
#define VGA_MODE_00H_BLINK 0x01 |
#define VGA_MODE_00H_COLOR_BLACK 0x00 |
#define VGA_MODE_00H_COLOR_BLUE 0x01 |
#define VGA_MODE_00H_COLOR_BROWN 0x06 |
#define VGA_MODE_00H_COLOR_CYAN 0x03 |
#define VGA_MODE_00H_COLOR_DARK_GRAY 0x08 |
#define VGA_MODE_00H_COLOR_GREEN 0x02 |
#define VGA_MODE_00H_COLOR_LIGHT_BLUE 0x09 |
#define VGA_MODE_00H_COLOR_LIGHT_CYAN 0x0B |
#define VGA_MODE_00H_COLOR_LIGHT_GRAY 0x07 |
#define VGA_MODE_00H_COLOR_LIGHT_GREEN 0x0A |
#define VGA_MODE_00H_COLOR_LIGHT_MAGENTA 0x0D |
#define VGA_MODE_00H_COLOR_LIGHT_RED 0x0C |
#define VGA_MODE_00H_COLOR_MAGENTA 0x05 |
#define VGA_MODE_00H_COLOR_RED 0x04 |
#define VGA_MODE_00H_COLOR_WHITE 0x0F |
#define VGA_MODE_00H_COLOR_YELLOW 0x0E |
#define VGA_MODE_00H_MAX_SCREENS 8 |
#define VGA_MODE_00H_NOT_BLINK 0x00 |
#define VGA_MODE_00H_SCREEN_COLUMNS 40 |
The number of columns in mode 00h.
#define VGA_MODE_00H_SCREEN_OFFSET 4000 |
#define VGA_MODE_00H_SCREEN_ROWS 25 |
The number of rows in mode 00h.
#define VGA_MODE_01H_BASE_ADDR 0xC00B8000 |
The base memory address for mode 01h.
#define VGA_MODE_01H_BLINK 0x01 |
#define VGA_MODE_01H_COLOR_BLACK 0x00 |
#define VGA_MODE_01H_COLOR_BLUE 0x01 |
#define VGA_MODE_01H_COLOR_BROWN 0x06 |
#define VGA_MODE_01H_COLOR_CYAN 0x03 |
#define VGA_MODE_01H_COLOR_DARK_GRAY 0x08 |
#define VGA_MODE_01H_COLOR_GREEN 0x02 |
#define VGA_MODE_01H_COLOR_LIGHT_BLUE 0x09 |
#define VGA_MODE_01H_COLOR_LIGHT_CYAN 0x0B |
#define VGA_MODE_01H_COLOR_LIGHT_GRAY 0x07 |
#define VGA_MODE_01H_COLOR_LIGHT_GREEN 0x0A |
#define VGA_MODE_01H_COLOR_LIGHT_MAGENTA 0x0D |
#define VGA_MODE_01H_COLOR_LIGHT_RED 0x0C |
#define VGA_MODE_01H_COLOR_MAGENTA 0x05 |
#define VGA_MODE_01H_COLOR_RED 0x04 |
#define VGA_MODE_01H_COLOR_WHITE 0x0F |
#define VGA_MODE_01H_COLOR_YELLOW 0x0E |
#define VGA_MODE_01H_MAX_SCREENS 8 |
#define VGA_MODE_01H_NOT_BLINK 0x00 |
#define VGA_MODE_01H_SCREEN_COLUMNS 40 |
The number of columns in mode 01h.
#define VGA_MODE_01H_SCREEN_OFFSET 4000 |
#define VGA_MODE_01H_SCREEN_ROWS 25 |
The number of rows in mode 01h.
#define VGA_MODE_02H_BASE_ADDR 0xC00B8000 |
The base memory address for mode 02h.
#define VGA_MODE_02H_BLINK 0x01 |
#define VGA_MODE_02H_COLOR_BLACK 0x00 |
#define VGA_MODE_02H_COLOR_BLUE 0x01 |
#define VGA_MODE_02H_COLOR_BROWN 0x06 |
#define VGA_MODE_02H_COLOR_CYAN 0x03 |
#define VGA_MODE_02H_COLOR_DARK_GRAY 0x08 |
#define VGA_MODE_02H_COLOR_GREEN 0x02 |
#define VGA_MODE_02H_COLOR_LIGHT_BLUE 0x09 |
#define VGA_MODE_02H_COLOR_LIGHT_CYAN 0x0B |
#define VGA_MODE_02H_COLOR_LIGHT_GRAY 0x07 |
#define VGA_MODE_02H_COLOR_LIGHT_GREEN 0x0A |
#define VGA_MODE_02H_COLOR_LIGHT_MAGENTA 0x0D |
#define VGA_MODE_02H_COLOR_LIGHT_RED 0x0C |
#define VGA_MODE_02H_COLOR_MAGENTA 0x05 |
#define VGA_MODE_02H_COLOR_RED 0x04 |
#define VGA_MODE_02H_COLOR_WHITE 0x0F |
#define VGA_MODE_02H_COLOR_YELLOW 0x0E |
#define VGA_MODE_02H_MAX_SCREENS 8 |
#define VGA_MODE_02H_NOT_BLINK 0x00 |
#define VGA_MODE_02H_SCREEN_COLUMNS 80 |
The number of columns in mode 02h.
#define VGA_MODE_02H_SCREEN_OFFSET 4000 |
#define VGA_MODE_02H_SCREEN_ROWS 25 |
The number of rows in mode 02h.
#define VGA_MODE_03H_BASE_ADDR 0xC00B8000 |
The base memory address for mode 03h.
#define VGA_MODE_03H_BLINK 0x01 |
#define VGA_MODE_03H_COLOR_BLACK 0x00 |
#define VGA_MODE_03H_COLOR_BLUE 0x01 |
#define VGA_MODE_03H_COLOR_BROWN 0x06 |
#define VGA_MODE_03H_COLOR_CYAN 0x03 |
#define VGA_MODE_03H_COLOR_DARK_GRAY 0x08 |
#define VGA_MODE_03H_COLOR_GREEN 0x02 |
#define VGA_MODE_03H_COLOR_LIGHT_BLUE 0x09 |
#define VGA_MODE_03H_COLOR_LIGHT_CYAN 0x0B |
#define VGA_MODE_03H_COLOR_LIGHT_GRAY 0x07 |
#define VGA_MODE_03H_COLOR_LIGHT_GREEN 0x0A |
#define VGA_MODE_03H_COLOR_LIGHT_MAGENTA 0x0D |
#define VGA_MODE_03H_COLOR_LIGHT_RED 0x0C |
#define VGA_MODE_03H_COLOR_MAGENTA 0x05 |
#define VGA_MODE_03H_COLOR_RED 0x04 |
#define VGA_MODE_03H_COLOR_WHITE 0x0F |
#define VGA_MODE_03H_COLOR_YELLOW 0x0E |
#define VGA_MODE_03H_MAX_SCREENS 8 |
#define VGA_MODE_03H_NOT_BLINK 0x00 |
#define VGA_MODE_03H_SCREEN_COLUMNS 80 |
The number of columns in mode 03h.
#define VGA_MODE_03H_SCREEN_OFFSET 4000 |
#define VGA_MODE_03H_SCREEN_ROWS 25 |
The number of rows in mode 03h.
#define VGA_MODE_07H_BASE_ADDR 0xC00B0000 |
The base memory address for mode 07h.
#define VGA_MODE_07H_BLINK 0x01 |
#define VGA_MODE_07H_COLOR_BLACK 0x00 |
#define VGA_MODE_07H_COLOR_BLUE 0x01 |
#define VGA_MODE_07H_COLOR_BROWN 0x06 |
#define VGA_MODE_07H_COLOR_CYAN 0x03 |
#define VGA_MODE_07H_COLOR_DARK_GRAY 0x08 |
#define VGA_MODE_07H_COLOR_GREEN 0x02 |
#define VGA_MODE_07H_COLOR_LIGHT_BLUE 0x09 |
#define VGA_MODE_07H_COLOR_LIGHT_CYAN 0x0B |
#define VGA_MODE_07H_COLOR_LIGHT_GRAY 0x07 |
#define VGA_MODE_07H_COLOR_LIGHT_GREEN 0x0A |
#define VGA_MODE_07H_COLOR_LIGHT_MAGENTA 0x0D |
#define VGA_MODE_07H_COLOR_LIGHT_RED 0x0C |
#define VGA_MODE_07H_COLOR_MAGENTA 0x05 |
#define VGA_MODE_07H_COLOR_RED 0x04 |
#define VGA_MODE_07H_COLOR_WHITE 0x0F |
#define VGA_MODE_07H_COLOR_YELLOW 0x0E |
#define VGA_MODE_07H_MAX_SCREENS 1 |
#define VGA_MODE_07H_NOT_BLINK 0x00 |
#define VGA_MODE_07H_SCREEN_COLUMNS 80 |
The number of columns in mode 07h.
#define VGA_MODE_07H_SCREEN_OFFSET 4000 |
#define VGA_MODE_07H_SCREEN_ROWS 25 |
The number of rows in mode 07h.
#define VGA_NOT_BLINK 0x00 |
enum VGA_TEXT_MODES |
uint16_t __vga_calcualte_position_with_offset | ( | uint16_t | x, |
uint16_t | y | ||
) |
Calculate position with offset.
Calculate position on screen takes into account the current offset. Which means function return value that added to base address will give you position of current character on current screen in memory.
x | x coordinate. |
y | y coordinate. |
uint16_t __vga_calcualte_position_without_offset | ( | uint16_t | x, |
uint16_t | y | ||
) |
Calculate position without offset.
Calculate position on screen doesn't take into account the current offset. Which means function return value that added to base address will give you position of current character on first screen in memory.
x | x coordinate. |
y | y coordinate. |
void __vga_disable_cursor | ( | ) |
Disable cursor.
void __vga_enable_cursor | ( | uint8_t | cursor_start, |
uint8_t | cursor_end | ||
) |
Turn on cursor.
Turn on cursor with given size and position.
cursor_start | Scanline where cursor should start. |
cursor_end | Scanline where cursor should end. |
vga_color __vga_get_default_terminal_color | ( | uint8_t | vga_current_mode | ) |
Get default terminal color.
Get default terminal color for mode.
vga_mode | Current mode of graphic card. |
void vga_change_printing_screen | ( | uint8_t | screen | ) |
Change printing screen.
Change screen where text are printing. /param screen New screen for printing. Value valid for current text mode.
void vga_clear_all_screens | ( | ) |
Clear all screen.
Clears letters and colors from all screens. Set colors to default.
void vga_clear_given_screen | ( | uint8_t | screen | ) |
Clear given screen.
Clears letters and colors from given screen. Set colors to default.
screen | Screen to clear. Value valid for current text mode. |
void vga_clear_screen | ( | ) |
Clear screen.
Clears letters and colors. Set colors to default.
void vga_copy_screen | ( | uint8_t | from, |
uint8_t | to | ||
) |
Copy printing screen.
Copy screen from one to another. /param from Screen to copy. Value valid for current text mode. /param to Destination screen. Value valid for current text mode.
void vga_cursor_off | ( | ) |
Turn off cursor.
void vga_cursor_on | ( | ) |
Turn on cursor.
Turn on cursor with default size and position.
char vga_get_char | ( | uint16_t | x, |
uint16_t | y | ||
) |
Get character from given point on screen.
Get character on given point on screen.
x | x coordinate. |
y | y coordinate. |
char vga_get_char_struct | ( | vga_screen_pos | spos | ) |
Get character from given point on screen.
Get character on given point on screen.
spos | Position on screen. |
vga_character vga_get_character | ( | uint16_t | x, |
uint16_t | y | ||
) |
Get character and character color color from given point on screen.
Get character and character color color on given point on screen.
x | x coordinate. |
y | y coordinate. |
vga_character vga_get_character_struct | ( | vga_screen_pos | spos | ) |
Get character and character color color from given point on screen.
Get character and character color color on given point on screen.
spos | Position on screen. |
union vga_color vga_get_color | ( | uint16_t | x, |
uint16_t | y | ||
) |
Get character color from given point on screen.
Get character color on given point on screen.
x | x coordinate. |
y | y coordinate. |
union vga_color vga_get_color_struct | ( | vga_screen_pos | spos | ) |
Get character color from given point on screen.
Get character color on given point on screen.
spos | Position on screen. |
vga_screen_pos vga_get_cursor_pos | ( | ) |
Get cursor position.
Get cursor position on screen.
uint8_t vga_init | ( | uint8_t | mode | ) |
Initialization of VGA.
Sets internal variables to given text mode and clear all screens.
mode | Text mode you want to switch. |
void vga_newline | ( | ) |
Print new line.
void vga_printchar | ( | char | character | ) |
Print character on screen.
Print character on screen without changing color of character and background.
character | Character. |
void vga_printchar_color | ( | char | character, |
vga_color * | color | ||
) |
Print character on screen.
Print character on screen with given color of character and background.
character | Character. |
color | Color. |
void vga_printstring | ( | const char * | str | ) |
Print string on screen.
Print string on screen without changing color of characters and background.
str | String. |
void vga_printstring_color | ( | const char * | str, |
vga_color * | color | ||
) |
Print string on screen.
Print string on screen with given color of characters and background.
str | String. |
color | Color. |
void vga_set_char | ( | uint16_t | x, |
uint16_t | y, | ||
char | character | ||
) |
Set character on given point on screen.
Set character on given point on screen without changing color of character and background.
x | x coordinate. |
y | y coordinate. |
character | Character. |
void vga_set_char_struct | ( | vga_screen_pos | spos, |
char | character | ||
) |
Set character on given point on screen.
Set character on given point on screen without changing color of character and background.
spos | Position on screen. |
character | Character. |
void vga_set_character | ( | uint16_t | x, |
uint16_t | y, | ||
vga_character | character | ||
) |
Set character and character color on given point on screen.
Set character and character color on given point on screen.
x | x coordinate. |
y | y coordinate. |
character | Character and character color. |
void vga_set_character_struct | ( | vga_screen_pos | spos, |
vga_character | character | ||
) |
Set character and character color on given point on screen.
Set character and character color on given point on screen.
spos | Position on screen. |
character | Character and character color. |
void vga_set_color | ( | uint16_t | x, |
uint16_t | y, | ||
vga_color | col | ||
) |
Set character color on given point on screen.
Set character color on given point on screen without changing letter.
x | x coordinate. |
y | y coordinate. |
col | Color. |
void vga_set_color_struct | ( | vga_screen_pos | spos, |
vga_color | col | ||
) |
Set character color on given point on screen.
Set character color on given point on screen without changing letter.
spos | Position on screen. |
col | Color. |
void vga_set_cursor_pos | ( | uint16_t | x, |
uint16_t | y | ||
) |
Set cursor position.
Set cursor position on screen.
x | x coordinate. |
y | y coordinate. |
void vga_set_cursor_pos_struct | ( | vga_screen_pos | spos | ) |
Set cursor position.
Set cursor position on screen.
spos | Position on screen. |