avr-lc7981/doc/latex/lc7981_8c.tex

145 lines
10 KiB
TeX

\section{include/lc7981.c File Reference}
\label{lc7981_8c}\index{include/lc7981.c@{include/lc7981.c}}
{\ttfamily \#include \char`\"{}lc7981.h\char`\"{}}\par
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
void {\bf lcd\_\-init} (uint8\_\-t mode)
\begin{DoxyCompactList}\small\item\em lcd\_\-init set the to default values. \item\end{DoxyCompactList}\item
void {\bf lcd\_\-clear} ()
\begin{DoxyCompactList}\small\item\em Clears the display by setting the whole memory to 0. \item\end{DoxyCompactList}\item
void {\bf lcd\_\-write\_\-text} (char $\ast$txt)
\begin{DoxyCompactList}\small\item\em Outputs text in at the current cursor position. \item\end{DoxyCompactList}\item
void {\bf lcd\_\-gotoxy} (uint8\_\-t x, uint8\_\-t y)
\begin{DoxyCompactList}\small\item\em Set the display cursor to a specific location. \item\end{DoxyCompactList}\item
void {\bf lcd\_\-plot\_\-pixel} (uint8\_\-t x, uint8\_\-t y, uint8\_\-t set)
\begin{DoxyCompactList}\small\item\em set or unset a pixel at the specified location \item\end{DoxyCompactList}\item
void {\bf lcd\_\-plot\_\-bitmap} (uint8\_\-t x, uint8\_\-t y, PGM\_\-P bitmap, uint8\_\-t w, uint8\_\-t h)
\begin{DoxyCompactList}\small\item\em This function will plot a bitmap with the upper left corner to the given coordinates. \item\end{DoxyCompactList}\item
void {\bf lcd\_\-plot\_\-char} (uint8\_\-t x\_\-off, uint8\_\-t y\_\-off, uint8\_\-t c, uint8\_\-t fw, uint8\_\-t fh, PGM\_\-P font)
\begin{DoxyCompactList}\small\item\em Plots a single character in graphicmode. \item\end{DoxyCompactList}\item
void {\bf lcd\_\-plot\_\-text} (uint8\_\-t x\_\-off, uint8\_\-t y\_\-off, const char $\ast$text, uint8\_\-t fw, uint8\_\-t fh, PGM\_\-P font)
\begin{DoxyCompactList}\small\item\em Plots a text using lcd\_\-plot\_\-char. \item\end{DoxyCompactList}\item
void {\bf lcd\_\-plot\_\-pgmtext} (uint8\_\-t x\_\-off, uint8\_\-t y\_\-off, PGM\_\-P text, uint8\_\-t fw, uint8\_\-t fh, PGM\_\-P font)
\begin{DoxyCompactList}\small\item\em Plots a text using lcd\_\-plot\_\-char. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item
uint8\_\-t {\bf lcd\_\-mode}
\begin{DoxyCompactList}\small\item\em Currently used mode, can be text or graphic. \item\end{DoxyCompactList}\item
uint8\_\-t {\bf lcd\_\-curline}
\begin{DoxyCompactList}\small\item\em Current line. Used for scrolling in text mode. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection{Function Documentation}
\index{lc7981.c@{lc7981.c}!lcd\_\-clear@{lcd\_\-clear}}
\index{lcd\_\-clear@{lcd\_\-clear}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-clear}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-clear (void)}\label{lc7981_8c_a35c08b1fa742e650f4873939707b893b}
Clears the display by setting the whole memory to 0. \index{lc7981.c@{lc7981.c}!lcd\_\-gotoxy@{lcd\_\-gotoxy}}
\index{lcd\_\-gotoxy@{lcd\_\-gotoxy}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-gotoxy}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-gotoxy (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y})}\label{lc7981_8c_adbf47a5efdf02367ded1ebf8f9edb5fe}
Set the display cursor to a specific location. Right now this does only work in text mode, since there's no need for it now in graphics mode. \par
If the x and y values are to big, the function does nothing.
\begin{DoxyParams}{Parameters}
\item[{\em x}]the horizontal cursorposition (starts at 0) \item[{\em y}]the vertical cursorposition (starts at 0) \end{DoxyParams}
\index{lc7981.c@{lc7981.c}!lcd\_\-init@{lcd\_\-init}}
\index{lcd\_\-init@{lcd\_\-init}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-init (uint8\_\-t {\em mode})}\label{lc7981_8c_a9b18aca098d68e55bd7dd4b83f4f36e9}
lcd\_\-init set the to default values.
\begin{DoxyParams}{Parameters}
\item[{\em mode}]LCD\_\-TEXT for text mode and LCD\_\-GRAPHIC for graphic mode \end{DoxyParams}
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-bitmap@{lcd\_\-plot\_\-bitmap}}
\index{lcd\_\-plot\_\-bitmap@{lcd\_\-plot\_\-bitmap}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-plot\_\-bitmap}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-bitmap (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y}, \/ PGM\_\-P {\em bitmap}, \/ uint8\_\-t {\em w}, \/ uint8\_\-t {\em h})}\label{lc7981_8c_aa89be137ee35d3fd7e88782aafb0efdf}
This function will plot a bitmap with the upper left corner to the given coordinates. \par
If the bitmap doesn't fit on the display at this location, nothing is drawn at all.\par
Unset pixels are treated as transparent \par
This function is by far the most tricky piece of code in this project,\par
don't worry if you don't understand it at first sight. \par
Actually it just loops bitwise through the bitmap and uses some \par
nice bit shifting magic to get it anywhere you want.
\begin{DoxyParams}{Parameters}
\item[{\em x}]horizontal position of the bitmap \item[{\em y}]vertical position of the bitmap \item[{\em bitmap}]pointer to the bitmap in pgmspace \item[{\em w}]width of the bitmap \item[{\em h}]height of the bitmap\end{DoxyParams}
This function is dedicated to Greta, one of the most important persons in my life so far.\par
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-char@{lcd\_\-plot\_\-char}}
\index{lcd\_\-plot\_\-char@{lcd\_\-plot\_\-char}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-plot\_\-char}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-char (uint8\_\-t {\em x\_\-off}, \/ uint8\_\-t {\em y\_\-off}, \/ uint8\_\-t {\em c}, \/ uint8\_\-t {\em fw}, \/ uint8\_\-t {\em fh}, \/ PGM\_\-P {\em font})}\label{lc7981_8c_a2615737020b222e49a4d9c8d08a54f43}
Plots a single character in graphicmode. Each character of the font is stored linewise. \par
This means for a 8x8 Pixel font the 8 bytes are needed. \par
The first byte is the first line and the last byte is the last line. \par
The next 8byte are the next character.\par
\par
If the position is too close to the display edge so it can't be displayed completely,\par
It won't be displayed at all.
\begin{DoxyParams}{Parameters}
\item[{\em x\_\-off}]horizontal position of the character \item[{\em y\_\-off}]vertical position of the character \item[{\em c}]the character or it's ascii code \item[{\em fw}]width of the font (we start counting from 0, so a 10px width font will have fw = 9) \item[{\em fh}]height of the font (we start counting from 0, so a 10px height font will have fh = 9) \item[{\em font}]pointer to the flash area where the font is stored \end{DoxyParams}
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-pgmtext@{lcd\_\-plot\_\-pgmtext}}
\index{lcd\_\-plot\_\-pgmtext@{lcd\_\-plot\_\-pgmtext}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-plot\_\-pgmtext}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-pgmtext (uint8\_\-t {\em x\_\-off}, \/ uint8\_\-t {\em y\_\-off}, \/ PGM\_\-P {\em text}, \/ uint8\_\-t {\em fw}, \/ uint8\_\-t {\em fh}, \/ PGM\_\-P {\em font})}\label{lc7981_8c_a0af06316c8d3d3a57b1ddcf949d85a8c}
Plots a text using lcd\_\-plot\_\-char.
\begin{DoxyParams}{Parameters}
\item[{\em x\_\-off}]horizontal position of the character \item[{\em y\_\-off}]vertical position of the character \item[{\em text}]flash area where the text is stored \item[{\em fw}]width of the font (we start counting from 0, so a 10px width font will have fw = 9) \item[{\em fh}]height of the font (we start counting from 0, so a 10px height font will have fh = 9) \item[{\em font}]pointer to the flash area where the font is stored\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{lcd\_\-plot\_\-char}{p.}{lc7981_8h_a3d66dccc8324afe2e7b4cdd0970916f6}
\doxyref{lcd\_\-plot\_\-text}{p.}{lc7981_8h_a0a47b2eaae0a5e028c0065e945147aed}
\end{DoxySeeAlso}
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-pixel@{lcd\_\-plot\_\-pixel}}
\index{lcd\_\-plot\_\-pixel@{lcd\_\-plot\_\-pixel}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-plot\_\-pixel}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-pixel (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y}, \/ uint8\_\-t {\em set})}\label{lc7981_8c_a735111507ed83172f58d5af2953e31c6}
set or unset a pixel at the specified location
\begin{DoxyParams}{Parameters}
\item[{\em x}]horizontal position of the pixel (starts at 0) \item[{\em y}]horizontal position of the pixel (starts at 0) \item[{\em set}]can be PIXEL\_\-ON or PIXEL\_\-OFF \end{DoxyParams}
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-text@{lcd\_\-plot\_\-text}}
\index{lcd\_\-plot\_\-text@{lcd\_\-plot\_\-text}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-plot\_\-text}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-text (uint8\_\-t {\em x\_\-off}, \/ uint8\_\-t {\em y\_\-off}, \/ const char $\ast$ {\em text}, \/ uint8\_\-t {\em fw}, \/ uint8\_\-t {\em fh}, \/ PGM\_\-P {\em font})}\label{lc7981_8c_a71a77094675e2850e8a4b442fb6a366e}
Plots a text using lcd\_\-plot\_\-char.
\begin{DoxyParams}{Parameters}
\item[{\em x\_\-off}]horizontal position of the character \item[{\em y\_\-off}]vertical position of the character \item[{\em text}]the text that is plotted \item[{\em fw}]width of the font (we start counting from 0, so a 10px width font will have fw = 9) \item[{\em fh}]height of the font (we start counting from 0, so a 10px height font will have fh = 9) \item[{\em font}]pointer to the flash area where the font is stored\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{lcd\_\-plot\_\-char}{p.}{lc7981_8h_a3d66dccc8324afe2e7b4cdd0970916f6}
\end{DoxySeeAlso}
\index{lc7981.c@{lc7981.c}!lcd\_\-write\_\-text@{lcd\_\-write\_\-text}}
\index{lcd\_\-write\_\-text@{lcd\_\-write\_\-text}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-write\_\-text}]{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-write\_\-text (char $\ast$ {\em txt})}\label{lc7981_8c_a30251238a49999658455fdb0233757fb}
Outputs text in at the current cursor position. If a $\backslash$n occurs in the last line of the display, all the other line will be 'scrolled' up. This function is textmode only. The the second line becomes the first, the third the second and so on ...
\begin{DoxyParams}{Parameters}
\item[{\em txt}]the text \end{DoxyParams}
\subsection{Variable Documentation}
\index{lc7981.c@{lc7981.c}!lcd\_\-curline@{lcd\_\-curline}}
\index{lcd\_\-curline@{lcd\_\-curline}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-curline}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t {\bf lcd\_\-curline}}\label{lc7981_8c_a76f8e26cf50274635b544f68752b2a0f}
Current line. Used for scrolling in text mode. \index{lc7981.c@{lc7981.c}!lcd\_\-mode@{lcd\_\-mode}}
\index{lcd\_\-mode@{lcd\_\-mode}!lc7981.c@{lc7981.c}}
\subsubsection[{lcd\_\-mode}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t {\bf lcd\_\-mode}}\label{lc7981_8c_aa29c0577fe01129f48b5b21301d3ea49}
Currently used mode, can be text or graphic.