\hypertarget{odds__and__ends_8c}{
\section{odds\_\-and\_\-ends.c File Reference}
\label{odds__and__ends_8c}\index{odds\_\-and\_\-ends.c@{odds\_\-and\_\-ends.c}}
}
{\tt \#include \char`\"{}odds\_\-and\_\-ends.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
uint8\_\-t \hyperlink{odds__and__ends_8c_7bf23234c6eaf2e937d558b791e1249d}{asciitovalue} (uint8\_\-t ascii)
\begin{CompactList}\small\item\em Convert an ASCII character to its numeric equivalent. \item\end{CompactList}\item 
uint8\_\-t \hyperlink{odds__and__ends_8c_f52153b03b1a05fea5b4eb3eadf52a25}{hex2ascii\_\-h} (uint8\_\-t hexval)
\begin{CompactList}\small\item\em Convert the top nibble of a btye to ASCII. \item\end{CompactList}\item 
uint8\_\-t \hyperlink{odds__and__ends_8c_68043f0b43c0d8b5f39a370f055e7a74}{hex2ascii\_\-l} (uint8\_\-t hexval)
\begin{CompactList}\small\item\em Convert the bottom nibble of a btye to ASCII. \item\end{CompactList}\item 
uint8\_\-t \hyperlink{odds__and__ends_8c_2f379772b393d02eab966d60b3491916}{bcd\_\-to\_\-hex} (uint8\_\-t bcd)
\begin{CompactList}\small\item\em Convert a BCD value in a byte to the correct hex value. \item\end{CompactList}\item 
uint8\_\-t \hyperlink{odds__and__ends_8c_04a179d346cf3ec953f18d9df9f6149a}{get\_\-bcd\_\-switch\_\-setting} (void)
\begin{CompactList}\small\item\em return a value derived from a BCD switch \item\end{CompactList}\end{CompactItemize}


\subsection{Function Documentation}
\hypertarget{odds__and__ends_8c_7bf23234c6eaf2e937d558b791e1249d}{
\index{odds\_\-and\_\-ends.c@{odds\_\-and\_\-ends.c}!asciitovalue@{asciitovalue}}
\index{asciitovalue@{asciitovalue}!odds_and_ends.c@{odds\_\-and\_\-ends.c}}
\subsubsection[{asciitovalue}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t asciitovalue (uint8\_\-t {\em ascii})}}
\label{odds__and__ends_8c_7bf23234c6eaf2e937d558b791e1249d}


Convert an ASCII character to its numeric equivalent. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ascii}]ASCII character to convert \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]uint8\_\-t Converted value \end{Desc}
\hypertarget{odds__and__ends_8c_2f379772b393d02eab966d60b3491916}{
\index{odds\_\-and\_\-ends.c@{odds\_\-and\_\-ends.c}!bcd\_\-to\_\-hex@{bcd\_\-to\_\-hex}}
\index{bcd\_\-to\_\-hex@{bcd\_\-to\_\-hex}!odds_and_ends.c@{odds\_\-and\_\-ends.c}}
\subsubsection[{bcd\_\-to\_\-hex}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t bcd\_\-to\_\-hex (uint8\_\-t {\em bcd})}}
\label{odds__and__ends_8c_2f379772b393d02eab966d60b3491916}


Convert a BCD value in a byte to the correct hex value. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bcd}]uint8\_\-t value in BCD \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]returns uint8\_\-t hex value converted from BCD\end{Desc}
For example, 23 -$>$ 0x17 \hypertarget{odds__and__ends_8c_04a179d346cf3ec953f18d9df9f6149a}{
\index{odds\_\-and\_\-ends.c@{odds\_\-and\_\-ends.c}!get\_\-bcd\_\-switch\_\-setting@{get\_\-bcd\_\-switch\_\-setting}}
\index{get\_\-bcd\_\-switch\_\-setting@{get\_\-bcd\_\-switch\_\-setting}!odds_and_ends.c@{odds\_\-and\_\-ends.c}}
\subsubsection[{get\_\-bcd\_\-switch\_\-setting}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t get\_\-bcd\_\-switch\_\-setting (void)}}
\label{odds__and__ends_8c_04a179d346cf3ec953f18d9df9f6149a}


return a value derived from a BCD switch 

\begin{Desc}
\item[Returns:]uint8\_\-t Top bit set if there has been a change since function last called Bottom (usually 4) bits represent the number on the switch dial. eg dial=6, and this is a change from previous value, return value is 0x86\end{Desc}
requires the BCD switch to be on 4 consecutive bits of a single port Needs definitions of BCD\_\-PIN The PIN the switch is on, eg PINB BCD\_\-SHIFT The number of bit positions to shift right to get the value bottom aligned BCD\_\-MASK The mask required to select the switch bits once shifted, nearly always 0x0F \hypertarget{odds__and__ends_8c_f52153b03b1a05fea5b4eb3eadf52a25}{
\index{odds\_\-and\_\-ends.c@{odds\_\-and\_\-ends.c}!hex2ascii\_\-h@{hex2ascii\_\-h}}
\index{hex2ascii\_\-h@{hex2ascii\_\-h}!odds_and_ends.c@{odds\_\-and\_\-ends.c}}
\subsubsection[{hex2ascii\_\-h}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t hex2ascii\_\-h (uint8\_\-t {\em hexval})}}
\label{odds__and__ends_8c_f52153b03b1a05fea5b4eb3eadf52a25}


Convert the top nibble of a btye to ASCII. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hexval}]8 bit value whose top 4 bits are to be converted to ASCII \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]uint8\_\-t Converted value \end{Desc}
\hypertarget{odds__and__ends_8c_68043f0b43c0d8b5f39a370f055e7a74}{
\index{odds\_\-and\_\-ends.c@{odds\_\-and\_\-ends.c}!hex2ascii\_\-l@{hex2ascii\_\-l}}
\index{hex2ascii\_\-l@{hex2ascii\_\-l}!odds_and_ends.c@{odds\_\-and\_\-ends.c}}
\subsubsection[{hex2ascii\_\-l}]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t hex2ascii\_\-l (uint8\_\-t {\em hexval})}}
\label{odds__and__ends_8c_68043f0b43c0d8b5f39a370f055e7a74}


Convert the bottom nibble of a btye to ASCII. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hexval}]8 bit value whose bottom 4 bits are to be converted to ASCII \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]uint8\_\-t Converted value \end{Desc}
