diff --git a/Inc/murasaki_2_ug.hpp b/Inc/murasaki_2_ug.hpp index 3e55cab..079b508 100644 --- a/Inc/murasaki_2_ug.hpp +++ b/Inc/murasaki_2_ug.hpp @@ -21,6 +21,7 @@ * \li \subpage ug_sec_3 * \li \subpage ug_sec_4 * \li \subpage ug_sec_5 + * \li \subpage ug_sec_6 * * For the easy-to-understand description, we assumes several things on the application skeleton which we are going to use Murasaki : * \li The application skeleton is generated by CubeMX @@ -362,4 +363,108 @@ */ + +/** + * @page ug_sec_6 Program flow + * @brief In this section, we see the program flow of a Murasaki application. + * + * Murasaki has 3 program flows. The start point of these flows are always inside + * CubeMX generated code. 2 out of 3 flows are for debugging. Only 1 flow have to be + * understood well by an application programmer. + * + * @li @subpage ug_sect_6_1 + * @li @subpage ug_sect_6_2 + * @li @subpage ug_sect_6_3 + */ + +/** + * @page ug_sect_6_1 Application flow + * @brief The application program flow is the main flow of a Murasaki application. + * + * @details + * This program flow starts from the StartDefaultTask() in the Src/main.c. + * The StartDefaultTas() is a default and first task created by CubeMX. + * In the other words, this task is automatically created without configuration. + * + * From this function, two Murasaki function is called. One is InitPlatoform(). + * The other is ExecPlatform(). Note that both function calls are inserted by + * installer. See @ref spg_6 of the @ref spg for details. + * + * @code + * void StartDefaultTask(void const * argument) + * { + * + * // USER CODE BEGIN 5 + * InitPlatform(); + * ExecPlatform(); + * // Infinite loop + * for(;;) + * { + * osDelay(1); + * } + * // USER CODE END 5 + * } + * @endcode + * + * The InitPlatform() function is defined in the Src/murasaki_platform.cpp. + * Because the file extention is .cpp, the murasaki_platfrom.cpp is compiled + * by C++ compiler while the main.c is compiled by C compiler. + * This allows programmer uses C++ language. Thus, the InitPlatform() is the + * good place to initialize the class based variables. + * + * As the name suggests, InitPlatform() is where programmer initialize the + * platform variables murasaki::platform and murasaki::debugger. + * @code + * void InitPlatform() + * { + * // UART device setting for console interface. + * // On Nucleo, the port connected to the USB port of ST-Link is + * // referred here. + * murasaki::platform.uart_console = new murasaki::DebuggerUart(&huart3); + * // UART is used for logging port. + * // At least one logger is needed to run the debugger class. + * murasaki::platform.logger = new murasaki::UartLogger(murasaki::platform.uart_console); + * // Setting the debugger + * murasaki::debugger = new murasaki::Debugger(murasaki::platform.logger); + * // Set the debugger as AutoRePrint mode, for the easy operation. + * murasaki::debugger->AutoRePrint(); // type any key to show history. + + + * // For demonstration, one GPIO LED port is reserved. + * // The port and pin names are fined by CubeMX. + * murasaki::platform.led = new murasaki::BitOut(LD2_GPIO_Port, LD2_Pin); + + * // For demonstration of master and slave I2C + * murasaki::platform.i2c_master = new murasaki::I2cMaster(&hi2c1); + + * murasaki::platform.sync_with_button = new murasaki::Synchronizer(); + + * // For demonstration of FreeRTOS task. + * murasaki::platform.task1 = new murasaki::Task( + * "Master", + * 256, + * 1, + * nullptr, + * &TaskBodyFunction + * ); + + * // Following block is just for sample. + + * } + * @endcode + * + */ + +/** + * @page ug_sect_6_2 HAL Assertion flow + * @brief @ref murasaki::BitOut and murasaki::BitIn provides the GPIO functionality + */ + +/** + * @page ug_sect_6_3 Sprious Interrupt flow + * @brief @ref murasaki::BitOut and murasaki::BitIn provides the GPIO functionality + */ + + + #endif /* MURASAKI_2_UG_HPP_ */