Skip to content

Commit

Permalink
Added applicaiton flow.
Browse files Browse the repository at this point in the history
  • Loading branch information
suikan4github committed Feb 21, 2019
1 parent c294343 commit 3e27d25
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Inc/murasaki_2_ug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,63 @@
* }
* @endcode
*
* In this sample, the first half of the InitPlatform() is building a murasaki::debugger
* variable. Because this variable is utilized for the debug of the entire application,
* there is a value to make it at first.
*
* Probably the most critical statement in this part is creation of the DebuggerUart class object.
*
* @code
* murasaki::platform.uart_console = new murasaki::DebuggerUart(&huart3);
* @endcode
*
* In this statement, the DebgguerUart receives the pointer to the huart3 as a parameter.
* The hauart3 is a handle variable of the UART3 generated by CubeMx. Let's remind the
* UART3 is utilized as communication path through the USB. So, in this sample code,
* we are making debugging console through the USB-serial line of the Nucleo F722ZE board.
*
* Because the huart3 is generated into the main.c directory, we have to declare this
* variable as external variable. You can find the declaration around the top of the
* Src/murasaki_platform.cpp.
*
* @code
* extern UART_HandleTypeDef huart3;
* @endcode
*
* Note that the UART port number is vary among the different Nucleo board. So, the
* porting programmer have responsibility to refer the right UART.
*
* The second half of the InitPlatform() is the creation part of the other peripheral
* object. This part is fully depend on the application. Programmer can define any
* object, by modifying the murasaki::Platform struct in the Inc/platform_defs.hpp.
*
* The second function called from the @ref StartDefaultTask() is the @ref ExecPlatform().
* This function is also defined in the @ref Src/murasaki_platform.cpp.
*
*
* @code
* void ExecPlatform()
* {
* murasaki::platform.task1->Start();
* // print a message with counter value to the console.
* murasaki::debugger->Printf("Push user button to display the I2C slave device \n\r");
* // Loop forever
* while (true) {
* murasaki::platform.sync_with_button->Wait();
* I2cSearch(murasaki::platform.i2c_master);
* }
* }
* @endcode
*
* This function is the body of application. So, you can read GPIO, ADC other peripherals.
* And output to the DAC, GPIO, and other peripherals from here.
*
*/

/**
Expand Down

0 comments on commit 3e27d25

Please sign in to comment.