avr-lc7981/doc/latex/lc7981_8h.tex

278 lines
13 KiB
TeX

\section{include/lc7981.h File Reference}
\label{lc7981_8h}\index{include/lc7981.h@{include/lc7981.h}}
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$util/delay.h$>$}\par
{\tt \#include $<$avr/pgmspace.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item
\#define {\bf LC7981\_\-H\_\-}~LC7981\_\-H\_\-
\item
\#define {\bf LCD\_\-CTRL}~PORTC
\item
\#define {\bf LCD\_\-CRTL\_\-DDR}~DDRC
\item
\#define {\bf LCD\_\-RS}~PC4
\item
\#define {\bf LCD\_\-RW}~PC2
\item
\#define {\bf LCD\_\-EN}~PC0
\item
\#define {\bf LCD\_\-DATA}~PORTD
\item
\#define {\bf LCD\_\-DATA\_\-DDR}~DDRD
\item
\#define {\bf lcd\_\-rs\_\-high}()~(LCD\_\-CTRL $|$= (1 $<$$<$ LCD\_\-RS))
\item
\#define {\bf lcd\_\-rs\_\-low}()~(LCD\_\-CTRL \&= $\sim$(1 $<$$<$ LCD\_\-RS))
\item
\#define {\bf lcd\_\-rw\_\-high}()~(LCD\_\-CTRL $|$= (1 $<$$<$ LCD\_\-RW))
\item
\#define {\bf lcd\_\-rw\_\-low}()~(LCD\_\-CTRL \&= $\sim$(1 $<$$<$ LCD\_\-RW))
\item
\#define {\bf lcd\_\-en\_\-high}()~(LCD\_\-CTRL $|$= (1 $<$$<$ LCD\_\-EN))
\item
\#define {\bf lcd\_\-en\_\-low}()~(LCD\_\-CTRL \&= $\sim$(1 $<$$<$ LCD\_\-EN))
\item
\#define {\bf LCD\_\-TEXT}~0
\item
\#define {\bf LCD\_\-TEXT\_\-LINES}~10
\item
\#define {\bf LCD\_\-TEXT\_\-COLUMNS}~26
\item
\#define {\bf LCD\_\-GRAPHIC}~1
\item
\#define {\bf LCD\_\-GRAPHIC\_\-WIDTH}~160
\item
\#define {\bf LCD\_\-GRAPHIC\_\-HEIGHT}~80
\item
\#define {\bf PIXEL\_\-ON}~1
\item
\#define {\bf PIXEL\_\-OFF}~0
\end{CompactItemize}
\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\_\-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)
\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, uint8\_\-t y, const uint8\_\-t $\ast$bitmap, uint8\_\-t w, uint8\_\-t h)
\item
void {\bf lcd\_\-strobe} ()
\begin{CompactList}\small\item\em Generates the strobe signal for writing data. \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}\end{CompactItemize}
\subsection{Define Documentation}
\index{lc7981.h@{lc7981.h}!LC7981\_\-H\_\-@{LC7981\_\-H\_\-}}
\index{LC7981\_\-H\_\-@{LC7981\_\-H\_\-}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LC7981\_\-H\_\-~LC7981\_\-H\_\-}\label{lc7981_8h_e6ff861bd55f4dc46f25f5f6abfca15f}
\index{lc7981.h@{lc7981.h}!LCD\_\-CRTL\_\-DDR@{LCD\_\-CRTL\_\-DDR}}
\index{LCD\_\-CRTL\_\-DDR@{LCD\_\-CRTL\_\-DDR}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-CRTL\_\-DDR~DDRC}\label{lc7981_8h_4b6c8400da9a1ca3d4d83f3ef1f9c34a}
\index{lc7981.h@{lc7981.h}!LCD\_\-CTRL@{LCD\_\-CTRL}}
\index{LCD\_\-CTRL@{LCD\_\-CTRL}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-CTRL~PORTC}\label{lc7981_8h_8e945df7ca614325cafa08258e82a63c}
\index{lc7981.h@{lc7981.h}!LCD\_\-DATA@{LCD\_\-DATA}}
\index{LCD\_\-DATA@{LCD\_\-DATA}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-DATA~PORTD}\label{lc7981_8h_25e9d818788f36ed74d7c4579f87f2a6}
\index{lc7981.h@{lc7981.h}!LCD\_\-DATA\_\-DDR@{LCD\_\-DATA\_\-DDR}}
\index{LCD\_\-DATA\_\-DDR@{LCD\_\-DATA\_\-DDR}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-DATA\_\-DDR~DDRD}\label{lc7981_8h_0c114e723aa4c162c415fb6d4d963dd7}
\index{lc7981.h@{lc7981.h}!LCD\_\-EN@{LCD\_\-EN}}
\index{LCD\_\-EN@{LCD\_\-EN}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-EN~PC0}\label{lc7981_8h_1640ffbc0d8ec0f7edb04a2b93918072}
\index{lc7981.h@{lc7981.h}!lcd\_\-en\_\-high@{lcd\_\-en\_\-high}}
\index{lcd\_\-en\_\-high@{lcd\_\-en\_\-high}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-en\_\-high()~(LCD\_\-CTRL $|$= (1 $<$$<$ LCD\_\-EN))}\label{lc7981_8h_e14be306d3620577abc8613d40401b04}
\index{lc7981.h@{lc7981.h}!lcd\_\-en\_\-low@{lcd\_\-en\_\-low}}
\index{lcd\_\-en\_\-low@{lcd\_\-en\_\-low}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-en\_\-low()~(LCD\_\-CTRL \&= $\sim$(1 $<$$<$ LCD\_\-EN))}\label{lc7981_8h_d8dcdb36a9410fd96b2c936b7c9355dd}
\index{lc7981.h@{lc7981.h}!LCD\_\-GRAPHIC@{LCD\_\-GRAPHIC}}
\index{LCD\_\-GRAPHIC@{LCD\_\-GRAPHIC}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-GRAPHIC~1}\label{lc7981_8h_dfaedf8da8e73d39a98d709b519a3117}
\index{lc7981.h@{lc7981.h}!LCD\_\-GRAPHIC\_\-HEIGHT@{LCD\_\-GRAPHIC\_\-HEIGHT}}
\index{LCD\_\-GRAPHIC\_\-HEIGHT@{LCD\_\-GRAPHIC\_\-HEIGHT}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-GRAPHIC\_\-HEIGHT~80}\label{lc7981_8h_70265c4f840ef78872243e91c923af2f}
\index{lc7981.h@{lc7981.h}!LCD\_\-GRAPHIC\_\-WIDTH@{LCD\_\-GRAPHIC\_\-WIDTH}}
\index{LCD\_\-GRAPHIC\_\-WIDTH@{LCD\_\-GRAPHIC\_\-WIDTH}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-GRAPHIC\_\-WIDTH~160}\label{lc7981_8h_51e83be6f6929f2a29d5467cd937dfc6}
\index{lc7981.h@{lc7981.h}!LCD\_\-RS@{LCD\_\-RS}}
\index{LCD\_\-RS@{LCD\_\-RS}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-RS~PC4}\label{lc7981_8h_4781e073871c6f27f89b9463ad3a4ed1}
\index{lc7981.h@{lc7981.h}!lcd\_\-rs\_\-high@{lcd\_\-rs\_\-high}}
\index{lcd\_\-rs\_\-high@{lcd\_\-rs\_\-high}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-rs\_\-high()~(LCD\_\-CTRL $|$= (1 $<$$<$ LCD\_\-RS))}\label{lc7981_8h_795b48274d3f80bc744a707b67fd93e9}
\index{lc7981.h@{lc7981.h}!lcd\_\-rs\_\-low@{lcd\_\-rs\_\-low}}
\index{lcd\_\-rs\_\-low@{lcd\_\-rs\_\-low}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-rs\_\-low()~(LCD\_\-CTRL \&= $\sim$(1 $<$$<$ LCD\_\-RS))}\label{lc7981_8h_6edb13d59460246fb4cc32ada1c9f4a8}
\index{lc7981.h@{lc7981.h}!LCD\_\-RW@{LCD\_\-RW}}
\index{LCD\_\-RW@{LCD\_\-RW}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-RW~PC2}\label{lc7981_8h_26089a10ddd59a0dc7283c19ccc02533}
\index{lc7981.h@{lc7981.h}!lcd\_\-rw\_\-high@{lcd\_\-rw\_\-high}}
\index{lcd\_\-rw\_\-high@{lcd\_\-rw\_\-high}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-rw\_\-high()~(LCD\_\-CTRL $|$= (1 $<$$<$ LCD\_\-RW))}\label{lc7981_8h_d0ce3cd9b481370ad4de36eff08440c8}
\index{lc7981.h@{lc7981.h}!lcd\_\-rw\_\-low@{lcd\_\-rw\_\-low}}
\index{lcd\_\-rw\_\-low@{lcd\_\-rw\_\-low}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-rw\_\-low()~(LCD\_\-CTRL \&= $\sim$(1 $<$$<$ LCD\_\-RW))}\label{lc7981_8h_7f5ebe0ca71b1298a7d3423850cc82b1}
\index{lc7981.h@{lc7981.h}!LCD\_\-TEXT@{LCD\_\-TEXT}}
\index{LCD\_\-TEXT@{LCD\_\-TEXT}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-TEXT~0}\label{lc7981_8h_90a69d37f5c80f3ded970acf2dacf4c0}
\index{lc7981.h@{lc7981.h}!LCD\_\-TEXT\_\-COLUMNS@{LCD\_\-TEXT\_\-COLUMNS}}
\index{LCD\_\-TEXT\_\-COLUMNS@{LCD\_\-TEXT\_\-COLUMNS}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-TEXT\_\-COLUMNS~26}\label{lc7981_8h_82f0a630f3c41b5233f2ceb07c7dd736}
\index{lc7981.h@{lc7981.h}!LCD\_\-TEXT\_\-LINES@{LCD\_\-TEXT\_\-LINES}}
\index{LCD\_\-TEXT\_\-LINES@{LCD\_\-TEXT\_\-LINES}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define LCD\_\-TEXT\_\-LINES~10}\label{lc7981_8h_720ef60606ac38ca3a5ab96a9c2b8168}
\index{lc7981.h@{lc7981.h}!PIXEL\_\-OFF@{PIXEL\_\-OFF}}
\index{PIXEL\_\-OFF@{PIXEL\_\-OFF}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PIXEL\_\-OFF~0}\label{lc7981_8h_cda2f1b1cf6310700d0d91643c40e068}
\index{lc7981.h@{lc7981.h}!PIXEL\_\-ON@{PIXEL\_\-ON}}
\index{PIXEL\_\-ON@{PIXEL\_\-ON}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define PIXEL\_\-ON~1}\label{lc7981_8h_eb2d212a26da4a5a4d3231b2773023e5}
\subsection{Function Documentation}
\index{lc7981.h@{lc7981.h}!lcd\_\-clear@{lcd\_\-clear}}
\index{lcd\_\-clear@{lcd\_\-clear}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-clear ()\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8h_35c08b1fa742e650f4873939707b893b}
Clears the display by setting the whole memory to 0.
\index{lc7981.h@{lc7981.h}!lcd\_\-gotoxy@{lcd\_\-gotoxy}}
\index{lcd\_\-gotoxy@{lcd\_\-gotoxy}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-gotoxy (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y})\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8h_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.h@{lc7981.h}!lcd\_\-init@{lcd\_\-init}}
\index{lcd\_\-init@{lcd\_\-init}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-init (uint8\_\-t {\em mode})}\label{lc7981_8h_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.h@{lc7981.h}!lcd\_\-plot\_\-bitmap@{lcd\_\-plot\_\-bitmap}}
\index{lcd\_\-plot\_\-bitmap@{lcd\_\-plot\_\-bitmap}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-bitmap (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y}, \/ const uint8\_\-t $\ast$ {\em bitmap}, \/ uint8\_\-t {\em w}, \/ uint8\_\-t {\em h})}\label{lc7981_8h_175d691feb304584c8c18e6456e07401}
\index{lc7981.h@{lc7981.h}!lcd\_\-plot\_\-pixel@{lcd\_\-plot\_\-pixel}}
\index{lcd\_\-plot\_\-pixel@{lcd\_\-plot\_\-pixel}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-plot\_\-pixel (uint8\_\-t {\em x}, \/ uint8\_\-t {\em y}, \/ uint8\_\-t {\em set})}\label{lc7981_8h_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.h@{lc7981.h}!lcd\_\-read\_\-byte@{lcd\_\-read\_\-byte}}
\index{lcd\_\-read\_\-byte@{lcd\_\-read\_\-byte}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t lcd\_\-read\_\-byte ()\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8h_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.h@{lc7981.h}!lcd\_\-strobe@{lcd\_\-strobe}}
\index{lcd\_\-strobe@{lcd\_\-strobe}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-strobe ()\hspace{0.3cm}{\tt [inline]}}\label{lc7981_8h_b4f286d6a313df7a5f692e0b4a9509ad}
Generates the strobe signal for writing data.
This function is meant for internal usage only. \index{lc7981.h@{lc7981.h}!lcd\_\-write\_\-command@{lcd\_\-write\_\-command}}
\index{lcd\_\-write\_\-command@{lcd\_\-write\_\-command}!lc7981.h@{lc7981.h}}
\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_8h_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.h@{lc7981.h}!lcd\_\-write\_\-text@{lcd\_\-write\_\-text}}
\index{lcd\_\-write\_\-text@{lcd\_\-write\_\-text}!lc7981.h@{lc7981.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-write\_\-text (char $\ast$ {\em txt})}\label{lc7981_8h_30251238a49999658455fdb0233757fb}