208 lines
12 KiB
TeX
208 lines
12 KiB
TeX
\section{include/lc7981.c File Reference}
|
|
\label{lc7981_8c}\index{include/lc7981.c@{include/lc7981.c}}
|
|
{\tt \#include \char`\"{}lc7981.h\char`\"{}}\par
|
|
\subsection*{Functions}
|
|
\begin{CompactItemize}
|
|
\item
|
|
void {\bf lcd\_\-init} (uint8\_\-t mode)
|
|
\begin{CompactList}\small\item\em lcd\_\-init set the to default values. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-write\_\-command} (uint8\_\-t cmd, uint8\_\-t data)
|
|
\begin{CompactList}\small\item\em Writes a command and a data byte to the lcd. \item\end{CompactList}\item
|
|
uint8\_\-t {\bf lcd\_\-read\_\-byte} ()
|
|
\begin{CompactList}\small\item\em Reads a byte from the display memory. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-strobe} ()
|
|
\begin{CompactList}\small\item\em Generates the strobe signal for writing data. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-clear} ()
|
|
\begin{CompactList}\small\item\em Clears the display by setting the whole memory to 0. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-write\_\-text} (char $\ast$txt)
|
|
\begin{CompactList}\small\item\em Outputs text in at the current cursor position. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-gotoxy} (uint8\_\-t x, uint8\_\-t y)
|
|
\begin{CompactList}\small\item\em Set the display cursor to a specific location. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-plot\_\-pixel} (uint8\_\-t x, uint8\_\-t y, uint8\_\-t set)
|
|
\begin{CompactList}\small\item\em set or unset a pixel at the specified location \item\end{CompactList}\item
|
|
void {\bf lcd\_\-plot\_\-bitmap} (uint8\_\-t x\_\-off, uint8\_\-t y\_\-off, const uint8\_\-t $\ast$bitmap, uint8\_\-t w, uint8\_\-t h)
|
|
\begin{CompactList}\small\item\em This function will plot a bitmap with the upper left corner to the given coordinates. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-plot\_\-char} (uint8\_\-t x\_\-off, uint8\_\-t y\_\-off, uint8\_\-t c, uint8\_\-t fw, uint8\_\-t fh, const uint8\_\-t $\ast$font)
|
|
\begin{CompactList}\small\item\em Plots a single character in graphicmode. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-plot\_\-text} (uint8\_\-t x\_\-off, uint8\_\-t y\_\-off, const char $\ast$text, uint8\_\-t fw, uint8\_\-t fh, const uint8\_\-t $\ast$font)
|
|
\begin{CompactList}\small\item\em Plots a text using lcd\_\-plot\_\-char. \item\end{CompactList}\item
|
|
void {\bf lcd\_\-plot\_\-pgmtext} (uint8\_\-t x\_\-off, uint8\_\-t y\_\-off, const char $\ast$text, uint8\_\-t fw, uint8\_\-t fh, const uint8\_\-t $\ast$font)
|
|
\end{CompactItemize}
|
|
\subsection*{Variables}
|
|
\begin{CompactItemize}
|
|
\item
|
|
uint8\_\-t {\bf lcd\_\-mode}
|
|
\begin{CompactList}\small\item\em Currently used mode, can be text or graphic. \item\end{CompactList}\item
|
|
uint8\_\-t {\bf lcd\_\-curline}
|
|
\begin{CompactList}\small\item\em Current line. Used for scrolling in text mode. \item\end{CompactList}\end{CompactItemize}
|
|
|
|
|
|
\subsection{Function Documentation}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-clear@{lcd\_\-clear}}
|
|
\index{lcd\_\-clear@{lcd\_\-clear}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-clear ()\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8c_35c08b1fa742e650f4873939707b893b}
|
|
|
|
|
|
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{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-gotoxy (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y})\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8c_dbf47a5efdf02367ded1ebf8f9edb5fe}
|
|
|
|
|
|
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{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\item[{\em x}]the horizontal cursorposition (starts at 0) \item[{\em y}]the vertical cursorposition (starts at 0) \end{description}
|
|
\end{Desc}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-init@{lcd\_\-init}}
|
|
\index{lcd\_\-init@{lcd\_\-init}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-init (uint8\_\-t {\em mode})}\label{lc7981_8c_9b18aca098d68e55bd7dd4b83f4f36e9}
|
|
|
|
|
|
lcd\_\-init set the to default values.
|
|
|
|
\begin{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\item[{\em mode}]LCD\_\-TEXT for text mode and LCD\_\-GRAPHIC for graphic mode \end{description}
|
|
\end{Desc}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-bitmap@{lcd\_\-plot\_\-bitmap}}
|
|
\index{lcd\_\-plot\_\-bitmap@{lcd\_\-plot\_\-bitmap}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-bitmap (uint8\_\-t {\em x\_\-off}, \/ uint8\_\-t {\em y\_\-off}, \/ const uint8\_\-t $\ast$ {\em bitmap}, \/ uint8\_\-t {\em w}, \/ uint8\_\-t {\em h})}\label{lc7981_8c_f3b584ee8235c6ed4ebefc50f8a95915}
|
|
|
|
|
|
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
|
|
And if you know a better way to do this, tell me.\par
|
|
|
|
|
|
\begin{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\item[{\em x\_\-off}]horizontal position of the bitmap \item[{\em y\_\-off}]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{description}
|
|
\end{Desc}
|
|
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{\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}, \/ const uint8\_\-t $\ast$ {\em font})\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8c_9bbbc52f3cb24a861d11b08e1c14bca2}
|
|
|
|
|
|
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{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\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 \item[{\em fh}]height of the font \item[{\em font}]pointer to the flash area where the font is stored \end{description}
|
|
\end{Desc}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-pgmtext@{lcd\_\-plot\_\-pgmtext}}
|
|
\index{lcd\_\-plot\_\-pgmtext@{lcd\_\-plot\_\-pgmtext}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-pgmtext (uint8\_\-t {\em x\_\-off}, \/ uint8\_\-t {\em y\_\-off}, \/ const char $\ast$ {\em text}, \/ uint8\_\-t {\em fw}, \/ uint8\_\-t {\em fh}, \/ const uint8\_\-t $\ast$ {\em font})}\label{lc7981_8c_cba3fd3277d8785693564bb296d53049}
|
|
|
|
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-pixel@{lcd\_\-plot\_\-pixel}}
|
|
\index{lcd\_\-plot\_\-pixel@{lcd\_\-plot\_\-pixel}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-pixel (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y}, \/ uint8\_\-t {\em set})}\label{lc7981_8c_735111507ed83172f58d5af2953e31c6}
|
|
|
|
|
|
set or unset a pixel at the specified location
|
|
|
|
\begin{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\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{description}
|
|
\end{Desc}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-plot\_\-text@{lcd\_\-plot\_\-text}}
|
|
\index{lcd\_\-plot\_\-text@{lcd\_\-plot\_\-text}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\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}, \/ const uint8\_\-t $\ast$ {\em font})}\label{lc7981_8c_324c97a9fc335bb59fb6f2f56d729dd5}
|
|
|
|
|
|
Plots a text using lcd\_\-plot\_\-char.
|
|
|
|
\begin{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\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 \item[{\em fh}]height of the font \item[{\em font}]pointer to the flash area where the font is stored\end{description}
|
|
\end{Desc}
|
|
\begin{Desc}
|
|
\item[See also:]\doxyref{lcd\_\-plot\_\-char}{p.}{lc7981_8h_9bbbc52f3cb24a861d11b08e1c14bca2} \end{Desc}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-read\_\-byte@{lcd\_\-read\_\-byte}}
|
|
\index{lcd\_\-read\_\-byte@{lcd\_\-read\_\-byte}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t lcd\_\-read\_\-byte ()\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8c_6334333537ad1d0bd51cba1e80f32e74}
|
|
|
|
|
|
Reads a byte from the display memory.
|
|
|
|
lcd\_\-gotoxy can be used to set the location. Important : lcd\_\-gotoxy doesn't work in graphics mode yet.
|
|
|
|
\begin{Desc}
|
|
\item[Returns:]the byte which has been read \end{Desc}
|
|
\begin{Desc}
|
|
\item[See also:]\doxyref{lcd\_\-gotoxy}{p.}{lc7981_8h_dbf47a5efdf02367ded1ebf8f9edb5fe} \end{Desc}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-strobe@{lcd\_\-strobe}}
|
|
\index{lcd\_\-strobe@{lcd\_\-strobe}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-strobe ()\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8c_b4f286d6a313df7a5f692e0b4a9509ad}
|
|
|
|
|
|
Generates the strobe signal for writing data.
|
|
|
|
This function is meant for internal usage only. \index{lc7981.c@{lc7981.c}!lcd\_\-write\_\-command@{lcd\_\-write\_\-command}}
|
|
\index{lcd\_\-write\_\-command@{lcd\_\-write\_\-command}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-write\_\-command (uint8\_\-t {\em cmd}, \/ uint8\_\-t {\em data})\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8c_b69146a9179fc5b5deef3fc61cf0208c}
|
|
|
|
|
|
Writes a command and a data byte to the lcd.
|
|
|
|
\begin{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\item[{\em cmd}]the command byte \item[{\em data}]the data that is going to be written after the command \end{description}
|
|
\end{Desc}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-write\_\-text@{lcd\_\-write\_\-text}}
|
|
\index{lcd\_\-write\_\-text@{lcd\_\-write\_\-text}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-write\_\-text (char $\ast$ {\em txt})}\label{lc7981_8c_30251238a49999658455fdb0233757fb}
|
|
|
|
|
|
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{Desc}
|
|
\item[Parameters:]
|
|
\begin{description}
|
|
\item[{\em txt}]the text \end{description}
|
|
\end{Desc}
|
|
|
|
|
|
\subsection{Variable Documentation}
|
|
\index{lc7981.c@{lc7981.c}!lcd\_\-curline@{lcd\_\-curline}}
|
|
\index{lcd\_\-curline@{lcd\_\-curline}!lc7981.c@{lc7981.c}}
|
|
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t {\bf lcd\_\-curline}}\label{lc7981_8c_76f8e26cf50274635b544f68752b2a0f}
|
|
|
|
|
|
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{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t {\bf lcd\_\-mode}}\label{lc7981_8c_a29c0577fe01129f48b5b21301d3ea49}
|
|
|
|
|
|
Currently used mode, can be text or graphic.
|
|
|