From 3e27d25e47ad67206500256dea52ce7938149310 Mon Sep 17 00:00:00 2001 From: suikan <26223147+suikan4github@users.noreply.github.com> Date: Fri, 22 Feb 2019 00:01:23 +0900 Subject: [PATCH] Added applicaiton flow. --- Inc/murasaki_2_ug.hpp | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/Inc/murasaki_2_ug.hpp b/Inc/murasaki_2_ug.hpp index 079b508..29b59bb 100644 --- a/Inc/murasaki_2_ug.hpp +++ b/Inc/murasaki_2_ug.hpp @@ -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. + * */ /**