Skip to content

Commit

Permalink
Start to add program flow description
Browse files Browse the repository at this point in the history
  • Loading branch information
suikan4github committed Feb 20, 2019
1 parent 7bb385d commit c294343
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions Inc/murasaki_2_ug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href= "http://www.st.com/ja/development-tools/stm32cubemx.html"> CubeMX </a>
Expand Down Expand Up @@ -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_ */

0 comments on commit c294343

Please sign in to comment.