ODeV framework
v2
|
System global initialization. More...
#include "sysinit.h"
#include "syslowpower.h"
#include "sysdebug.h"
#include "NullErrorDelegate.h"
#include "SysDefPowerModeHelper.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "string.h"
Data Structures | |
struct | _System |
Typedefs | |
typedef struct _System | System |
Functions | |
void | SystemClock_Config (void) |
void | SysPowerConfig () |
static void | InitTaskRun (void *pParams) |
__weak sys_error_code_t | SysLoadApplicationContext (ApplicationContext *pAppContext) |
__weak sys_error_code_t | SysOnStartApplication (ApplicationContext *pAppContext) |
sys_error_code_t | SysInit (boolean_t bEnableBootIF) |
EPowerMode | SysGetPowerMode () |
sys_error_code_t | SysTaskErrorHandler (AManagedTask *pxTask) |
SysPowerStatus | SysGetPowerStatus () |
void | SysResetAEDCounter () |
boolean_t | SysEventsPending () |
__weak IApplicationErrorDelegate * | SysGetErrorDelegate () |
__weak IBoot * | SysGetBootIF () |
__weak IAppPowerModeHelper * | SysGetPowerModeHelper () |
Variables | |
static System | s_xTheSystem |
System global initialization.
Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.st.com/software_license_agreement_liberty_v2
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
static |
INIT task control loop. The INIT task is in charge of the system initialization.
pParams | not used. |
INIT task control function. The INIT task is the first created and running task. It is responsible to complete the system initialization and to create all other system task.
pParams | not used |
boolean_t SysEventsPending | ( | ) |
Check if there are pending SysEvent.
TRUE
if there are SysEvent pending (that means to be served by the INIT task), FALSE
otherwise. __weak IBoot* SysGetBootIF | ( | ) |
Get the Application defined Boot interface. A boot loader application should implement this interface. The default implementation is defined as weak so the application can provide its specific implementation. The default implementation does nothing.
__weak IApplicationErrorDelegate* SysGetErrorDelegate | ( | ) |
Get the Application manager error delegate. This function is used by the system during the application startup in order to get an application specific object that implements the IApplicationErrorDelegate. The default implementation is defined as weak so the application can provide its specific implementation. The default implementation does nothing.
EPowerMode SysGetPowerMode | ( | ) |
Get the current system power mode.
__weak IAppPowerModeHelper* SysGetPowerModeHelper | ( | ) |
Get the Application Power Mode Helper. This function is used by the system during the application startup in order to get an application specific object that implements the IAppPowerModeHelper. The default implementation is defined as weak so the application can provide its specific implementation. For more information about the default implementation see TODO: STF ...
SysPowerStatus SysGetPowerStatus | ( | ) |
Get a copy of the system status related to the power management.
sys_error_code_t SysInit | ( | boolean_t | bEnableBootIF | ) |
It initialize the minimum set of resources, hardware and software, in order to start the scheduler, and create the INIT task. If bEnableBootIF == TRUE the system enable the Boot Interface. It is useful to develop a bootloader.
bEnableBootIF | specifies if the system has to enable the Boot Interface. |
__weak sys_error_code_t SysLoadApplicationContext | ( | ApplicationContext * | pAppContext | ) |
This function is used by the system in order to add all the managed tasks to the application context. It is defined as weak in order to allow the user application to redefine it.
pAppContext | [IN] specifies a pointer to the application context to load with the application specific managed tasks. |
__weak sys_error_code_t SysOnStartApplication | ( | ApplicationContext * | pAppContext | ) |
This function is called by the framework at the end of the initialization process and before the Init task releases the control to the application tasks. At this point all managed task has been created and the hardware is initialized. The application has a chance to execute some other initialization code before the scheduler runs the first application task.
pAppContext | [IN] specifies a pointer to the application context to load with the application specific managed tasks. |
void SysPowerConfig | ( | ) |
Configure the unused PIN in analog to minimize the power consumption, and enable the ultra low power mode.
void SysResetAEDCounter | ( | ) |
Reset the counter of the AED. Usually an AED use some kind of timeout to check that all managed tasks are working fine. A task should call this method before a critical operation, that is for example a write operation in FLASH or EEPROM, or a long critical section. For convenience the managed task interface has a function IMTResetAEDCounter() that can be used by a task instead of call directly the system function.
sys_error_code_t SysTaskErrorHandler | ( | AManagedTask * | pxTask | ) |
Not used yet.
pxTask |
void SystemClock_Config | ( | void | ) |
System Clock configuration procedure. It is provided by the CubeMX project.
|
static |
The only instance of System object.