#include <os.h>
Go to the source code of this file.
Data Structures | |
struct | nio_console |
Typedefs | |
typedef struct nio_console | nio_console |
Functions | |
void | nio_load (char *path, nio_console *c) |
void | nio_save (char *path, nio_console *c) |
void | setPixel (int x, int y, unsigned int color) |
void | putChar (int x, int y, char ch, int bgColor, int textColor) |
void | putStr (int x, int y, char *str, int bgColor, int textColor) |
void | nio_drawstr (int offset_x, int offset_y, int x, int y, char *str, char bgColor, char textColor) |
void | nio_drawch (int offset_x, int offset_y, int x, int y, char ch, char bgColor, char textColor) |
char | nio_getch (void) |
void | nio_InitConsole (nio_console *c, int size_x, int size_y, int offset_x, int offset_y, char background_color, char foreground_color) |
void | nio_DrawConsole (nio_console *c) |
void | nio_ScrollDown (nio_console *c) |
void | nio_Clear (nio_console *c) |
void | nio_DrawChar (nio_console *c, int pos_x, int pos_y) |
void | nio_SetChar (nio_console *c, char ch, int pos_x, int pos_y) |
void | nio_PrintChar (nio_console *c, char ch) |
void | nio_EnableDrawing (nio_console *c, BOOL drawing_enabled) |
void | nio_PrintStr (nio_console *c, char *str) |
void | nio_printf (nio_console *c, char *format,...) |
char | nio_GetChar (nio_console *c) |
int | nio_GetStr (nio_console *c, char *str) |
void | nio_SetColor (nio_console *c, char background_color, char foreground_color) |
void | nio_CleanUp (nio_console *c) |
int | reg_store (void *dataptr, size_t size, char *regpath) |
void * | reg_get (char *regpath) |
BOOL | uart_ready (void) |
char | uart_getc (void) |
void | uart_getline (char *dest) |
void | uart_putc (char c) |
void | uart_puts (const char *str) |
void | uart_printf (char *format,...) |
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/copyleft/gpl.html
Nspire I/O 2.0 header file
void nio_CleanUp | ( | nio_console * | c | ) |
Frees the allocated memory.
c | Console |
void nio_Clear | ( | nio_console * | c | ) |
Clears a console.
c | Console |
void nio_drawch | ( | int | offset_x, |
int | offset_y, | ||
int | x, | ||
int | y, | ||
char | ch, | ||
char | bgColor, | ||
char | textColor | ||
) |
Draws a char to the screen
offset_x | x offset (pixel) |
offset_y | y offset (pixel) |
x | Column |
y | Row |
ch | String |
bgColor | Background color |
textColor | Text color |
void nio_DrawChar | ( | nio_console * | c, |
int | pos_x, | ||
int | pos_y | ||
) |
Draws a char from a console to the screen at the given position; It is not saved.
c | Console |
pos_x | Column |
pos_y | Row |
void nio_DrawConsole | ( | nio_console * | c | ) |
Draws a console to the screen.
c | Console |
void nio_drawstr | ( | int | offset_x, |
int | offset_y, | ||
int | x, | ||
int | y, | ||
char * | str, | ||
char | bgColor, | ||
char | textColor | ||
) |
Draws a string to the screen
offset_x | x offset (pixel) |
offset_y | y offset (pixel) |
x | Column |
y | Row |
str | String |
bgColor | Background color |
textColor | Text color |
void nio_EnableDrawing | ( | nio_console * | c, |
BOOL | drawing_enabled | ||
) |
Enables immediate drawing when a character is written to the console.
c | Console |
drawing_enabled | When this is true, a char will be immediately drawn to the screen, false: The console will not refresh if you write data to it |
char nio_getch | ( | void | ) |
Reads a char from the keyboard
char nio_GetChar | ( | nio_console * | c | ) |
Reads a char and prints it to the console.
c | Console |
int nio_GetStr | ( | nio_console * | c, |
char * | str | ||
) |
Reads a string and prints it to the console.
c | Console |
str | String destination |
void nio_InitConsole | ( | nio_console * | c, |
int | size_x, | ||
int | size_y, | ||
int | offset_x, | ||
int | offset_y, | ||
char | background_color, | ||
char | foreground_color | ||
) |
Initializes a console.
c | Console |
size_x | Number of columns |
size_y | Number of rows |
offset_x | x offset (pixel) |
offset_y | y offset (pixel) |
background_color | Default background color |
foreground_color | Default foreground color |
void nio_load | ( | char * | path, |
nio_console * | c | ||
) |
Loads a console to flash storage.
path | File path |
c | Console |
void nio_PrintChar | ( | nio_console * | c, |
char | ch | ||
) |
Prints a char in a console.
c | Console |
ch | Char |
void nio_printf | ( | nio_console * | c, |
char * | format, | ||
... | |||
) |
Prints a formatted string to a console.
c | Console |
format | Format string |
... | Additional arguments |
void nio_PrintStr | ( | nio_console * | c, |
char * | str | ||
) |
Prints a string in a console.
c | Console |
str | String |
void nio_save | ( | char * | path, |
nio_console * | c | ||
) |
Saves a console to flash storage.
path | File path |
c | Console |
void nio_ScrollDown | ( | nio_console * | c | ) |
Scrolls the console one line down.
c | Console |
void nio_SetChar | ( | nio_console * | c, |
char | ch, | ||
int | pos_x, | ||
int | pos_y | ||
) |
Saves a char in a console at the given position; It is not drawn.
c | Console |
ch | char to be stored |
pos_x | Column |
pos_y | Row |
void nio_SetColor | ( | nio_console * | c, |
char | background_color, | ||
char | foreground_color | ||
) |
Sets the Foreground/Background color.
c | Console |
background_color | Background color |
foreground_color | Foreground color |
void putChar | ( | int | x, |
int | y, | ||
char | ch, | ||
int | bgColor, | ||
int | textColor | ||
) |
Draws a char to the screen using the charmap.
x | X coordinate |
y | Y coordinate |
ch | Char to draw |
bgColor | Background color of the character |
textColor | Color of the character |
void putStr | ( | int | x, |
int | y, | ||
char * | str, | ||
int | bgColor, | ||
int | textColor | ||
) |
Draws a string to the screen using the charmap.
x | X coordinate |
y | Y coordinate |
str | String to draw |
bgColor | Background color of the character |
textColor | Color of the character |
void* reg_get | ( | char * | regpath | ) |
Reads binary data from a file.
regpath | Path to file |
int reg_store | ( | void * | dataptr, |
size_t | size, | ||
char * | regpath | ||
) |
Stores binary data in a file.
dataptr | Pointer to the data to be stored |
size | Length in bytes |
regpath | Path to file |
void setPixel | ( | int | x, |
int | y, | ||
unsigned int | color | ||
) |
Draws a pixel to the screen.
x | X coordinate |
y | Y coordinate |
color | Pixel color |
char uart_getc | ( | void | ) |
Gets a char from RS232.
void uart_getline | ( | char * | dest | ) |
Gets a line (ended with
) from RS232.
dest | String destination |
void uart_printf | ( | char * | format, |
... | |||
) |
Puts a formatted string to RS232.
format | Format string |
... | Additional arguments |
void uart_putc | ( | char | c | ) |
Puts a char to RS232.
c | Char |
void uart_puts | ( | const char * | str | ) |
Puts a string to RS232.
str | String |
BOOL uart_ready | ( | void | ) |
Checks if there is data available at the serial port.