2 \mainpage Library description
4 The RPP library is a high-level API that allows user to control the RPP
5 hardware. It is designed from the board user perspective and exposes a
6 simplified API to handle the board's peripheral modules in a safe manner.
8 If you're using Simulink, the block set is implemented on top of this API.
10 This library works on top of the DRV layer (RPP driver library). For advanced
11 use, configuration and low-level access of the board please refers to the DRV
15 \section blocks Block diagram:
17 The RPP library is divided into modules, one module per hardware peripheral.
19 Click on a block in the following diagram to see the API for that module.
22 <div style="float: right;">
25 CATEGORY NAME MNEMONIC
26 ----------------------------------------------------------------
30 Digital (Logic) Output [LOUT]
35 H-Bridge output [HBR ]
36 Power output (12V, 2A) [MOUT]
37 High-Power output (12V, 10A) [HOUT]
41 LIN (Local Interconnect Network) [LIN ]
43 Serial Communication Interface [SCI ]
54 \htmlinclude blocks_map.html
57 \section example Base application:
59 \subsection ex_layout Application Layout
61 A base RPP application is structured in the following manner:
63 - Include RPP library header file.
68 - Create one or as many FreeRTOS task function definitions as required. Those
69 tasks should use functions from this library.
73 static const portTickType freq_ticks = 1000 / portTICK_RATE_MS;
74 portTickType last_wake_time = xTaskGetTickCount();
78 /* Wait until next step */
79 vTaskDelayUntil(&last_wake_time, freq_ticks);
80 rpp_sci_printf((const char*)"Hello RPP.\r\n");
86 - Create the main function that will:
87 - Initialize the RPP board.
88 - Spawn the tasks the application requires. Refer to FreeRTOS API for
90 - Start the FreeRTOS Scheduler. Refer to FreeRTOS API for details.
91 - Catch if idle task could not be created.
96 /* Initialize RPP board */
100 if(xTaskCreate(my_task, (const signed char*)"my_task",
101 512, NULL, CONTROL_PRIORITY, NULL) != pdPASS) {
103 rpp_sci_printf((const char*)
104 "ERROR: cannot spawn control task.\r\n"
112 /* Start the FreeRTOS Scheduler */
113 vTaskStartScheduler();
115 /* Catch scheduler start error */
117 rpp_sci_printf((const char*)
118 "ERROR: Problem allocating memory for idle task.\r\n"
128 \subsection ex_make Compilation
131 \note If using the RPP Static Library, rpp-lib.lib, make sure the linker is
132 retaining the .intvecs sections, and that the startup symbol is resolved
133 to the library and not to the support ABI.