\section{include/rom/lcd.h File Reference}
\label{rom_2lcd_8h}\index{include/rom/lcd.h@{include/rom/lcd.h}}
ROM Interface: RCX LCD control. 

\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf lcd\_\-int}(i)\ lcd\_\-number(i,sign,e0)
\begin{CompactList}\small\item\em display an integer in decimal \item\end{CompactList}\item 
\#define {\bf lcd\_\-unsigned}(u)\ lcd\_\-number(u,unsign,e0)
\begin{CompactList}\small\item\em display an unsigned value in decimal \item\end{CompactList}\item 
\#define {\bf lcd\_\-clock}(t)\ lcd\_\-number(t,unsign,e\_\-2)
\begin{CompactList}\small\item\em display a clock. \item\end{CompactList}\item 
\#define {\bf lcd\_\-digit}(d)\ lcd\_\-number(d,digit,digit\_\-comma)
\begin{CompactList}\small\item\em display a single digit right of the man symbol \item\end{CompactList}\item 
\#define {\bf ASMVOLATILE}\ \_\-\_\-volatile\_\-\_\-
\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum {\bf lcd\_\-segment} \{ \par
{\bf man\_\-stand} =  0x3006, 
{\bf man\_\-run} =  0x3007, 
{\bf s1\_\-select} =  0x3008, 
{\bf s1\_\-active} =  0x3009, 
\par
{\bf s2\_\-select} =  0x300A, 
{\bf s2\_\-active} =  0x300B, 
{\bf s3\_\-select} =  0x300C, 
{\bf s3\_\-active} =  0x300D, 
\par
{\bf a\_\-select} =  0x300E, 
{\bf a\_\-left} =  0x300F, 
{\bf a\_\-right} =  0x3010, 
{\bf b\_\-select} =  0x3011, 
\par
{\bf b\_\-left} =  0x3012, 
{\bf b\_\-right} =  0x3013, 
{\bf c\_\-select} =  0x3014, 
{\bf c\_\-left} =  0x3015, 
\par
{\bf c\_\-right} =  0x3016, 
{\bf unknown\_\-1} =  0x3017, 
{\bf circle} =  0x3018, 
{\bf dot} =  0x3019, 
\par
{\bf dot\_\-inv} =  0x301A, 
{\bf battery\_\-x} =  0x301B, 
{\bf ir\_\-half} =  0x301C, 
{\bf ir\_\-full} =  0x301D, 
\par
{\bf everything} =  0x3020
 \}
\begin{CompactList}\small\item\em LCD segment codes. \item\end{CompactList}\item 
enum {\bf lcd\_\-number\_\-style} \{ {\bf digit} =  0x3017, 
{\bf sign} =  0x3001, 
{\bf unsign} =  0x301F
 \}
\begin{CompactList}\small\item\em LCD number display styles. \item\end{CompactList}\item 
enum {\bf lcd\_\-comma\_\-style} \{ \par
{\bf digit\_\-comma} =  0x0000, 
{\bf e0} =  0x3002, 
{\bf e\_\-1} =  0x3003, 
{\bf e\_\-2} =  0x3004, 
\par
{\bf e\_\-3} =  0x3005
 \}
\begin{CompactList}\small\item\em LCD comma display styles. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf lcd\_\-show} ({\bf lcd\_\-segment} segment)
\begin{CompactList}\small\item\em show LCD segment \item\end{CompactList}\item 
void {\bf lcd\_\-hide} ({\bf lcd\_\-segment} segment)
\begin{CompactList}\small\item\em hide LCD segment \item\end{CompactList}\item 
void {\bf lcd\_\-number} (int i, {\bf lcd\_\-number\_\-style} n, {\bf lcd\_\-comma\_\-style} c)
\begin{CompactList}\small\item\em show number on LCD display \item\end{CompactList}\item 
void {\bf lcd\_\-clear} (void)
\begin{CompactList}\small\item\em clear LCD display \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
ROM Interface: RCX LCD control. 

\begin{Desc}
\item[Author:]Markus L. Noga $<${\tt markus@noga.de}$>$\end{Desc}
\begin{Desc}
\item[Warning:]If CONF\_\-LCD\_\-REFRESH is set in config.h, the kernel will refresh the display automatically every 100ms. Otherwise, display updates are realized exclusively by {\bf lcd\_\-refresh()}{\rm (p.\,\pageref{sys_2lcd_8h_a16})}.\end{Desc}


Definition in file {\bf lcd.h}.

\subsection{Define Documentation}
\index{rom/lcd.h@{rom/lcd.h}!ASMVOLATILE@{ASMVOLATILE}}
\index{ASMVOLATILE@{ASMVOLATILE}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define ASMVOLATILE\ \_\-\_\-volatile\_\-\_\-}\label{rom_2lcd_8h_a4}


g++ warns about \_\-\_\-asm\_\-\_\- \_\-\_\-volatile\_\-\_\-. we define the problem away. the CXX symbol is predefined in the Makefile 

Definition at line 150 of file lcd.h.

Referenced by lcd\_\-clear(), lcd\_\-hide(), and lcd\_\-show().\index{rom/lcd.h@{rom/lcd.h}!lcd_clock@{lcd\_\-clock}}
\index{lcd_clock@{lcd\_\-clock}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-clock(t)\ lcd\_\-number(t,unsign,e\_\-2)}\label{rom_2lcd_8h_a2}


display a clock. 

passing an argument of 1015 will display 10.15 

Definition at line 131 of file lcd.h.\index{rom/lcd.h@{rom/lcd.h}!lcd_digit@{lcd\_\-digit}}
\index{lcd_digit@{lcd\_\-digit}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-digit(d)\ lcd\_\-number(d,digit,digit\_\-comma)}\label{rom_2lcd_8h_a3}


display a single digit right of the man symbol 



Definition at line 134 of file lcd.h.

Referenced by show\_\-off(), and show\_\-on().\index{rom/lcd.h@{rom/lcd.h}!lcd_int@{lcd\_\-int}}
\index{lcd_int@{lcd\_\-int}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-int(i)\ lcd\_\-number(i,sign,e0)}\label{rom_2lcd_8h_a0}


display an integer in decimal 



Definition at line 123 of file lcd.h.\index{rom/lcd.h@{rom/lcd.h}!lcd_unsigned@{lcd\_\-unsigned}}
\index{lcd_unsigned@{lcd\_\-unsigned}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define lcd\_\-unsigned(u)\ lcd\_\-number(u,unsign,e0)}\label{rom_2lcd_8h_a1}


display an unsigned value in decimal 



Definition at line 126 of file lcd.h.

\subsection{Enumeration Type Documentation}
\index{rom/lcd.h@{rom/lcd.h}!lcd_comma_style@{lcd\_\-comma\_\-style}}
\index{lcd_comma_style@{lcd\_\-comma\_\-style}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf lcd\_\-comma\_\-style}}\label{rom_2lcd_8h_a44}


LCD comma display styles. 

\begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{digit_comma@{digit\_\-comma}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!digit_comma@{digit\_\-comma}}\item[{\em 
digit\_\-comma\label{rom_2lcd_8h_a44a33}
}]single digit on the right \index{e0@{e0}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!e0@{e0}}\item[{\em 
e0\label{rom_2lcd_8h_a44a34}
}]whole \index{e_1@{e\_\-1}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!e_1@{e\_\-1}}\item[{\em 
e\_\-1\label{rom_2lcd_8h_a44a35}
}]10ths \index{e_2@{e\_\-2}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!e_2@{e\_\-2}}\item[{\em 
e\_\-2\label{rom_2lcd_8h_a44a36}
}]100ths \index{e_3@{e\_\-3}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!e_3@{e\_\-3}}\item[{\em 
e\_\-3\label{rom_2lcd_8h_a44a37}
}]1000ths, problematic with negatives \end{description}
\end{Desc}



Definition at line 111 of file lcd.h.\index{rom/lcd.h@{rom/lcd.h}!lcd_number_style@{lcd\_\-number\_\-style}}
\index{lcd_number_style@{lcd\_\-number\_\-style}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf lcd\_\-number\_\-style}}\label{rom_2lcd_8h_a43}


LCD number display styles. 

note: signed and unsigned are taken by the C programming language \begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{digit@{digit}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!digit@{digit}}\item[{\em 
digit\label{rom_2lcd_8h_a43a30}
}]single digit on the right \index{sign@{sign}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!sign@{sign}}\item[{\em 
sign\label{rom_2lcd_8h_a43a31}
}]signed, no leading zeros \index{unsign@{unsign}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!unsign@{unsign}}\item[{\em 
unsign\label{rom_2lcd_8h_a43a32}
}]unsigned, 0 displayed as 0000 \end{description}
\end{Desc}



Definition at line 99 of file lcd.h.\index{rom/lcd.h@{rom/lcd.h}!lcd_segment@{lcd\_\-segment}}
\index{lcd_segment@{lcd\_\-segment}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf lcd\_\-segment}}\label{rom_2lcd_8h_a42}


LCD segment codes. 

these are not to be confused with the codes defined in direct-lcd.h

circle and dot codes cycle. cycle state is preserved on powerdown.

each dot code should be invoked six times before using the other. mixing them will result in strange behaviour. \begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{man_stand@{man\_\-stand}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!man_stand@{man\_\-stand}}\item[{\em 
man\_\-stand\label{rom_2lcd_8h_a42a5}
}]\index{man_run@{man\_\-run}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!man_run@{man\_\-run}}\item[{\em 
man\_\-run\label{rom_2lcd_8h_a42a6}
}]\index{s1_select@{s1\_\-select}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!s1_select@{s1\_\-select}}\item[{\em 
s1\_\-select\label{rom_2lcd_8h_a42a7}
}]\index{s1_active@{s1\_\-active}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!s1_active@{s1\_\-active}}\item[{\em 
s1\_\-active\label{rom_2lcd_8h_a42a8}
}]\index{s2_select@{s2\_\-select}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!s2_select@{s2\_\-select}}\item[{\em 
s2\_\-select\label{rom_2lcd_8h_a42a9}
}]\index{s2_active@{s2\_\-active}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!s2_active@{s2\_\-active}}\item[{\em 
s2\_\-active\label{rom_2lcd_8h_a42a10}
}]\index{s3_select@{s3\_\-select}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!s3_select@{s3\_\-select}}\item[{\em 
s3\_\-select\label{rom_2lcd_8h_a42a11}
}]\index{s3_active@{s3\_\-active}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!s3_active@{s3\_\-active}}\item[{\em 
s3\_\-active\label{rom_2lcd_8h_a42a12}
}]\index{a_select@{a\_\-select}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!a_select@{a\_\-select}}\item[{\em 
a\_\-select\label{rom_2lcd_8h_a42a13}
}]\index{a_left@{a\_\-left}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!a_left@{a\_\-left}}\item[{\em 
a\_\-left\label{rom_2lcd_8h_a42a14}
}]\index{a_right@{a\_\-right}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!a_right@{a\_\-right}}\item[{\em 
a\_\-right\label{rom_2lcd_8h_a42a15}
}]\index{b_select@{b\_\-select}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!b_select@{b\_\-select}}\item[{\em 
b\_\-select\label{rom_2lcd_8h_a42a16}
}]\index{b_left@{b\_\-left}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!b_left@{b\_\-left}}\item[{\em 
b\_\-left\label{rom_2lcd_8h_a42a17}
}]\index{b_right@{b\_\-right}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!b_right@{b\_\-right}}\item[{\em 
b\_\-right\label{rom_2lcd_8h_a42a18}
}]\index{c_select@{c\_\-select}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!c_select@{c\_\-select}}\item[{\em 
c\_\-select\label{rom_2lcd_8h_a42a19}
}]\index{c_left@{c\_\-left}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!c_left@{c\_\-left}}\item[{\em 
c\_\-left\label{rom_2lcd_8h_a42a20}
}]\index{c_right@{c\_\-right}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!c_right@{c\_\-right}}\item[{\em 
c\_\-right\label{rom_2lcd_8h_a42a21}
}]\index{unknown_1@{unknown\_\-1}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!unknown_1@{unknown\_\-1}}\item[{\em 
unknown\_\-1\label{rom_2lcd_8h_a42a22}
}]seemingly without effect. cycle reset? \index{circle@{circle}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!circle@{circle}}\item[{\em 
circle\label{rom_2lcd_8h_a42a23}
}]0..3 quarters: add one. 4 quarters: reset \index{dot@{dot}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!dot@{dot}}\item[{\em 
dot\label{rom_2lcd_8h_a42a24}
}]0..4 dots: add a dot. 5 dots: reset \index{dot_inv@{dot\_\-inv}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!dot_inv@{dot\_\-inv}}\item[{\em 
dot\_\-inv\label{rom_2lcd_8h_a42a25}
}]0 dots: show 5. 1..4 dots: subtract one \index{battery_x@{battery\_\-x}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!battery_x@{battery\_\-x}}\item[{\em 
battery\_\-x\label{rom_2lcd_8h_a42a26}
}]\index{ir_half@{ir\_\-half}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!ir_half@{ir\_\-half}}\item[{\em 
ir\_\-half\label{rom_2lcd_8h_a42a27}
}]\index{ir_full@{ir\_\-full}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!ir_full@{ir\_\-full}}\item[{\em 
ir\_\-full\label{rom_2lcd_8h_a42a28}
}]the IR display values are mutually exclusive. \index{everything@{everything}!rom/lcd.h@{rom/lcd.h}}\index{rom/lcd.h@{rom/lcd.h}!everything@{everything}}\item[{\em 
everything\label{rom_2lcd_8h_a42a29}
}]the IR display values are mutually exclusive. \end{description}
\end{Desc}



Definition at line 53 of file lcd.h.

\subsection{Function Documentation}
\index{rom/lcd.h@{rom/lcd.h}!lcd_clear@{lcd\_\-clear}}
\index{lcd_clear@{lcd\_\-clear}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-clear (void)\hspace{0.3cm}{\tt  [inline]}}\label{rom_2lcd_8h_a41}


clear LCD display 



Definition at line 191 of file lcd.h.

References \_\-\_\-asm\_\-\_\-(), and ASMVOLATILE.

Referenced by kmain().\index{rom/lcd.h@{rom/lcd.h}!lcd_hide@{lcd\_\-hide}}
\index{lcd_hide@{lcd\_\-hide}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-hide ({\bf lcd\_\-segment} {\em segment})\hspace{0.3cm}{\tt  [inline]}}\label{rom_2lcd_8h_a39}


hide LCD segment 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em segment}]segment to hide \end{description}
\end{Desc}


Definition at line 171 of file lcd.h.

References \_\-\_\-asm\_\-\_\-(), and ASMVOLATILE.\index{rom/lcd.h@{rom/lcd.h}!lcd_number@{lcd\_\-number}}
\index{lcd_number@{lcd\_\-number}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-number (int {\em i}, {\bf lcd\_\-number\_\-style} {\em n}, {\bf lcd\_\-comma\_\-style} {\em c})}\label{rom_2lcd_8h_a40}


show number on LCD display 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em i}]the number \item[{\em n}]a number style \item[{\em c}]a comma style \end{description}
\end{Desc}
\index{rom/lcd.h@{rom/lcd.h}!lcd_show@{lcd\_\-show}}
\index{lcd_show@{lcd\_\-show}!rom/lcd.h@{rom/lcd.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void lcd\_\-show ({\bf lcd\_\-segment} {\em segment})\hspace{0.3cm}{\tt  [inline]}}\label{rom_2lcd_8h_a38}


show LCD segment 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em segment}]segment to show \end{description}
\end{Desc}


Definition at line 156 of file lcd.h.

References \_\-\_\-asm\_\-\_\-(), and ASMVOLATILE.

Referenced by kmain().