elements on the implementations files only and never on the interface files. Never expose any
other layer to the application or to the whole system below that layer will be exposed. In other
words, never \texttt{\#include "foo/foo.h"} in any RPP Layer interface file.
-\item Any module is conditionally included by using \texttt{rppCONFIG\_INCLUDE\_\{MNEMONIC\}} directive on the
- \texttt{RppConfig.h} configuration file.
\end{compactitem}
\vspace{-0.40cm}
To use this library just include this file and this file only. Also, before using any library
function please call \texttt{rpp\_init()} function for hardware initialization.
-\noindent$\rightarrow$ \texttt{rpp/include/rpp/RppConfig.h}
-
-Library configuration file.
-
-Please refer to the API documentation and header file comments for specific documentation for each
-configuration parameter.
-
\noindent$\rightarrow$ \texttt{rpp/include/rpp/rpp\_\{mnemonic\}.h}
Header file for \texttt{\{mnemonic\}} module.
-This files includes function definitions, pin definitions, etc, specific to \{mnemonic\} module. The
-inclusion of this header can be configured in \texttt{RppConfig.h} using
-\texttt{rppCONFIG\_INCLUDE\_\{MNEMONIC\}} directive. See
+This files includes function definitions, pin definitions, etc, specific to \{mnemonic\} module. See
\htmladdnormallink{API development guidelines}{\#api\_development\_guidelines}.
\noindent$\rightarrow$ \texttt{rpp/src/rpp/rpp\_\{mnemonic\}.c}
\item Include headers files of the OS for which the library was compiled against. At the time of this
writing the OS is FreeRTOS 7.0.2. See \htmladdnormallink{OS interchangeable layer}{\#os\_interchangeable\_layer}
section above.
-\item Include header files for the RPP library.
+\item Include header files for the RPP library or for modules you want to use rpp\_can.h for CAN module for example.
\item Add library \texttt{rpp-lib.lib} to the linker libraries. The RPP library \textbf{MUST} be looked for
before Texas Instruments support library \texttt{rtsv7R4\_T\_be\_v3D16\_eabi.lib}.
\item Configure linker to retain \texttt{.intvecs} section from RPP Library:\newline{}
\begin{compactitem}
\item Include headers files of the OS for Simulation. At the time of this writing the OS is POSIX
FreeRTOS 6.0.4.
-\item Include header files for the RPP library.
-\item Create a \texttt{RppConfig.h} override file and drop DRV layer dependency: \texttt{rppCONFIG\_DRV 0}.
-\item Includes must be configured in a way that the \texttt{RppConfig.h} taken under consideration is the
- override and not the library one.
+\item Include header files for the RPP library or for modules you want to use (rpp\_can.h for CAN module for example).
\item Add library \texttt{librpp.a} to the linker libraries.
\item Add \texttt{pthread} to the linker libraries.
\end{compactitem}
\item Add \texttt{rpp} and \texttt{pthread}to linker libraries and add \texttt{RPP\_LIB\_ROOT} to the library search
path.\newline{}
\noindent\includegraphics[width=400px]{images/base_posix_3.png}
-\item Copy \texttt{RppConfig.h} from RPP Library to a new folder \texttt{include/rpp} and configure it drop DRV
- layer dependency: \texttt{rppCONFIG\_DRV 0}.\newline{}
-\noindent\includegraphics[width=200px]{images/base_posix_4.png}
\end{compactenum}
\textbf{In general any RPP application uses the layout/template:}
\begin{enumerate}
-\item Include RPP library header file.
+\item Include RPP library header file. You may also include only a selected modules to save space.
\lstset{language=c++}
\begin{lstlisting}
#include "rpp/rpp.h"
\end{lstlisting}
+You may not want to include the whole library to save space and compile time. In this case you may
+include only those modules, that you want to use. Inclusion selected modules only requires two more
+header files to be included as well: base.h and, in case sci is used for printing, rpp/sci.h.
+\begin{lstlisting}
+#include "rpp/hbr.h" /* We want to use H-bridge */
+#include <base.h> /* This is a necessary base header file of the rpp library. */
+#include "rpp/sci.h" /* This is needed, because we are using rpp_sci_printf in following examples. */
+\end{lstlisting}
+
\newpage
\item Create one or as many FreeRTOS task function definitions as required. Those tasks should use
functions from this library.
\item Create the main function that will:
\begin{itemize}
- \item Initialize the RPP board.
+ \item Initialize the RPP board. If you have included only selected modules in step 1, initialize only
+ those modules by calling their init functions, for example rpp\_hbr\_init\(\).
\item Spawn the tasks the application requires. Refer to FreeRTOS API for
details.
\item Start the FreeRTOS Scheduler. Refer to FreeRTOS API for details.
\begin{lstlisting}
void main(void)
{
- /* Initialize RPP board */
- rpp_init();
+ /* In case whole library is included: */
+ /* Initialize RPP board */
+ rpp_init();
+ /* In case only selected modules are included: */
+ /* Initialize HBR */
+ rpp_hbr_init();
+ /* Initialize sci for printf */
+ rpp_sci_init();
+ /* Enable interrups */
+ _enable_IRQ();
/* Spawn tasks */
if (xTaskCreate(my_task, (const signed char*)"my_task",
\begin{center}\begin{tabular}{lllll}
\textbf{Category} & \textbf{Name} & \textbf{Status*} & \textbf{Mnemonic} & \textbf{Header} \\
\input{block_table.tex}
-System blocks & Configuration block & \texttt{X} & \texttt{[CONF]} & \texttt{RppConfig.h} \\
- & High-Power output block & \texttt{X} & \texttt{[HOUT]} & \texttt{rpp\_hout.h} \\
+System blocks & High-Power output block & \texttt{X} & \texttt{[HOUT]} & \texttt{rpp\_hout.h} \\
& LIN receive block & \texttt{X} & \texttt{[LINR]} & \texttt{rpp\_lin.h} \\
& LIN send msg block & \texttt{X} & \texttt{[LINS]} & - Idem - \\
& Ethernet receive block & \texttt{X} & \texttt{[ETHR]} & \texttt{rpp\_eth.h} \\