Nspire I/O  2.0
 All Data Structures Files Functions Variables
Data Structures | Typedefs | Functions
nspireio2.h File Reference
#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,...)

Detailed Description

Author:
Julian Mackeben aka compu compu.nosp@m.juck.nosp@m.el@go.nosp@m.ogle.nosp@m.mail..nosp@m.com
Version:
2.0

LICENSE

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

DESCRIPTION

Nspire I/O 2.0 header file


Function Documentation

void nio_CleanUp ( nio_console c)

Frees the allocated memory.

Parameters:
cConsole
void nio_Clear ( nio_console c)

Clears a console.

Parameters:
cConsole
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

Parameters:
offset_xx offset (pixel)
offset_yy offset (pixel)
xColumn
yRow
chString
bgColorBackground color
textColorText 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.

Parameters:
cConsole
pos_xColumn
pos_yRow

Draws a console to the screen.

Parameters:
cConsole
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

Parameters:
offset_xx offset (pixel)
offset_yy offset (pixel)
xColumn
yRow
strString
bgColorBackground color
textColorText color
void nio_EnableDrawing ( nio_console c,
BOOL  drawing_enabled 
)

Enables immediate drawing when a character is written to the console.

Parameters:
cConsole
drawing_enabledWhen 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

Returns:
ASCII char
char nio_GetChar ( nio_console c)

Reads a char and prints it to the console.

Parameters:
cConsole
Returns:
ASCII char
int nio_GetStr ( nio_console c,
char *  str 
)

Reads a string and prints it to the console.

Parameters:
cConsole
strString 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.

Parameters:
cConsole
size_xNumber of columns
size_yNumber of rows
offset_xx offset (pixel)
offset_yy offset (pixel)
background_colorDefault background color
foreground_colorDefault foreground color
void nio_load ( char *  path,
nio_console c 
)

Loads a console to flash storage.

Parameters:
pathFile path
cConsole
void nio_PrintChar ( nio_console c,
char  ch 
)

Prints a char in a console.

Parameters:
cConsole
chChar
void nio_printf ( nio_console c,
char *  format,
  ... 
)

Prints a formatted string to a console.

Parameters:
cConsole
formatFormat string
...Additional arguments
void nio_PrintStr ( nio_console c,
char *  str 
)

Prints a string in a console.

Parameters:
cConsole
strString
void nio_save ( char *  path,
nio_console c 
)

Saves a console to flash storage.

Parameters:
pathFile path
cConsole
void nio_ScrollDown ( nio_console c)

Scrolls the console one line down.

Parameters:
cConsole
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.

Parameters:
cConsole
chchar to be stored
pos_xColumn
pos_yRow
void nio_SetColor ( nio_console c,
char  background_color,
char  foreground_color 
)

Sets the Foreground/Background color.

Parameters:
cConsole
background_colorBackground color
foreground_colorForeground color
void putChar ( int  x,
int  y,
char  ch,
int  bgColor,
int  textColor 
)

Draws a char to the screen using the charmap.

Parameters:
xX coordinate
yY coordinate
chChar to draw
bgColorBackground color of the character
textColorColor of the character
void putStr ( int  x,
int  y,
char *  str,
int  bgColor,
int  textColor 
)

Draws a string to the screen using the charmap.

Parameters:
xX coordinate
yY coordinate
strString to draw
bgColorBackground color of the character
textColorColor of the character
void* reg_get ( char *  regpath)

Reads binary data from a file.

Parameters:
regpathPath to file
Returns:
Pointer to the data, NULL on failure
int reg_store ( void *  dataptr,
size_t  size,
char *  regpath 
)

Stores binary data in a file.

Parameters:
dataptrPointer to the data to be stored
sizeLength in bytes
regpathPath to file
Returns:
0 on success, -1 on failure
void setPixel ( int  x,
int  y,
unsigned int  color 
)

Draws a pixel to the screen.

Parameters:
xX coordinate
yY coordinate
colorPixel color
char uart_getc ( void  )

Gets a char from RS232.

Returns:
Char
void uart_getline ( char *  dest)

Gets a line (ended with
) from RS232.

Parameters:
destString destination
void uart_printf ( char *  format,
  ... 
)

Puts a formatted string to RS232.

Parameters:
formatFormat string
...Additional arguments
void uart_putc ( char  c)

Puts a char to RS232.

Parameters:
cChar
void uart_puts ( const char *  str)

Puts a string to RS232.

Parameters:
strString
BOOL uart_ready ( void  )

Checks if there is data available at the serial port.

Returns:
TRUE if new data is available.