ISF  1.1
Intelligent Sensing Framework
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Include/isf_init.h File Reference

The isf_init.h file contains the task initialization attributes required for initialization of the following ISF tasks:
. More...

#include "isf_user_config.h"
#include "isf.h"
#include <mqx.h>
#include <lwevent.h>

Go to the source code of this file.

Defines

#define ISF_SYSTEM_READY_EVENT   (1<<1)
 Definition of the system ready event.
#define ISF_TASK_PRIORITY   (9)
 Definition of the base task priority for ISF tasks.
Note: Task priority of all ISF tasks must be set higher than user task priorities.
Note: Lower numbers represent higher task priorities and higher numbers represent lower priorities.
#define ISF_TASK_LOWEST_PRIORITY   (20)
 Definition of the task priority used by the lowest priority ISF task.
Note: User tasks must be set to a higher priority level than the task priority used by the lowest priority ISF task.
Note: Lower numbers represent higher task priorities and higher numbers represent lower priorities.
#define ISF_TASK_INDEX_START   (50)
 Definition of the starting task index for ISF tasks.
Note: User task indexes must have a LOWER value than the value defined here.
#define ISF_TASK_INIT_INDEX   (ISF_TASK_INDEX_START + 0)
 The following macros define the individual attributes for ISF Initialization Task startup.
Note: These macro definitions must not be changed by the user.
#define ISF_TASK_INIT_STACK_SIZE   (384)
#define ISF_TASK_INIT_PRIORITY   (ISF_TASK_PRIORITY-1)
#define ISF_TASK_INIT_NAME   ("ii")
#define ISF_TASK_INIT_PARAM   (0)
#define ISF_TASK_INIT_TIMESLICE   (0)
#define ISF_TASK_ATTRIBUTE_INIT
 Definition of the task-startup attributes macro for the ISF Initialization Task. This task initialization macro is used to initialize and launch the ISF initialization task.
#define ISF_TASK_ATTRIBUTE_SM
#define ISF_TASK_ATTRIBUTE_CI
#define ISF_APP_CALLBACK_DEV_INFO
#define ISF_APP_CALLBACK_MBOX
#define ISF_TASK_ATTRIBUTE_BM
#define ISF_TASK_ATTRIBUTE_PM
#define ISF_TASKS_ATTRIBUTES
 ISF tasks attributes. The user puts these tasks
in the MQX_template_list[] array.
#define ISF_APP_CALLBACKS
 This macro defines the ISF application Command Interpreter callback(s).
Note: The user must put these callbacks at the beginning of the ci_callback[] array.

Functions

isf_status_t isf_lib_init (void *pOptions)
 This function initializes the ISF library.
void isf_init_task (uint32 initial_data)
 This function initializes the ISF components for operation.
void isf_system_sync (void)
 This function synchronizes the user tasks and the system initialization.

Variables

LWEVENT_STRUCT isfSysEventHandler
 Definition of the event handle to the system ready event.

Detailed Description

The isf_init.h file contains the task initialization attributes required for initialization of the following ISF tasks:
.

  • ISF Initialization task
  • ISF Sensor Manager task
  • ISF Command Interpreter task
  • ISF Bus Manager task.

Definition in file isf_init.h.


Define Documentation

Definition at line 243 of file isf_init.h.

Definition at line 244 of file isf_init.h.

Value:
ISF_APP_CALLBACK_DEV_INFO,   \
       ISF_APP_CALLBACK_MBOX

This macro defines the ISF application Command Interpreter callback(s).
Note: The user must put these callbacks at the beginning of the ci_callback[] array.

Definition at line 346 of file isf_init.h.

#define ISF_SYSTEM_READY_EVENT   (1<<1)

Definition of the system ready event.

Definition at line 24 of file isf_init.h.

Referenced by isf_lib_init(), and isf_system_sync().

Definition at line 286 of file isf_init.h.

Definition at line 242 of file isf_init.h.

Value:
{ ISF_TASK_INIT_INDEX, \
                                            isf_init_task, \
                                                ISF_TASK_INIT_STACK_SIZE, \
                                                ISF_TASK_INIT_PRIORITY, \
                                                ISF_TASK_INIT_NAME, \
                                                MQX_AUTO_START_TASK, \
                                                ISF_TASK_INIT_PARAM, \
                                                ISF_TASK_INIT_TIMESLICE   },

Definition of the task-startup attributes macro for the ISF Initialization Task. This task initialization macro is used to initialize and launch the ISF initialization task.

Definition at line 139 of file isf_init.h.

Definition at line 324 of file isf_init.h.

Definition at line 196 of file isf_init.h.

#define ISF_TASK_INDEX_START   (50)

Definition of the starting task index for ISF tasks.
Note: User task indexes must have a LOWER value than the value defined here.

Definition at line 52 of file isf_init.h.

The following macros define the individual attributes for ISF Initialization Task startup.
Note: These macro definitions must not be changed by the user.

Definition at line 128 of file isf_init.h.

#define ISF_TASK_INIT_NAME   ("ii")

Definition at line 131 of file isf_init.h.

#define ISF_TASK_INIT_PARAM   (0)

Definition at line 132 of file isf_init.h.

Definition at line 130 of file isf_init.h.

#define ISF_TASK_INIT_STACK_SIZE   (384)

Definition at line 129 of file isf_init.h.

#define ISF_TASK_INIT_TIMESLICE   (0)

Definition at line 133 of file isf_init.h.

#define ISF_TASK_LOWEST_PRIORITY   (20)

Definition of the task priority used by the lowest priority ISF task.
Note: User tasks must be set to a higher priority level than the task priority used by the lowest priority ISF task.
Note: Lower numbers represent higher task priorities and higher numbers represent lower priorities.

Definition at line 46 of file isf_init.h.

#define ISF_TASK_PRIORITY   (9)

Definition of the base task priority for ISF tasks.
Note: Task priority of all ISF tasks must be set higher than user task priorities.
Note: Lower numbers represent higher task priorities and higher numbers represent lower priorities.

Definition at line 36 of file isf_init.h.

Value:
ISF_TASK_ATTRIBUTE_INIT \
                                ISF_TASK_ATTRIBUTE_SM \
                                ISF_TASK_ATTRIBUTE_CI \
                                ISF_TASK_ATTRIBUTE_BM \
                                ISF_TASK_ATTRIBUTE_PM

ISF tasks attributes. The user puts these tasks
in the MQX_template_list[] array.

Definition at line 335 of file isf_init.h.


Function Documentation

void isf_init_task ( uint32  initial_data)

This function initializes the ISF components for operation.

Purpose:
The ISF initialization task calls each ISF component to perform a one-time initialization. Each ISF component executes its initialization routine, if enabled in isf_user_config.h and if there are any initialization activities to perform.
Parameters:
[in]initial_dataThis is required by MQX and any UINT32 value can be used.
Returns:
This function does not return any values.
Constraints:
(1) The isf_init_task() must be the highest priority task in the system.
(2) This API call must be invoked only once and must run before any other task in the system runs. This can be ensured by using the default setting in isf_init.h, which sets this task as the highest priority task in the system.
Once initialization is complete, the task exits and its task memory is reclaimed by the system and is made available for application use.
Reentrant: No
Link Libraries:
isf_core.lib

Definition at line 60 of file isf_init.c.

References isf_lib_init().

isf_status_t isf_lib_init ( void *  pOptions)

This function initializes the ISF library.

Purpose:
The isf_lib_init() function is called by an application to initialize the ISF library.
Note: This initialization must be done in the user application before it calls any ISF function.
Parameters:
[in]pOptionsThis must be a NULL pointer.
Returns:
isf_lib_init() returns a value of type isf_status_t indicating the result of the operation.
Return values:
ISF_SUCCESSis returned when the library initializes successfully.
ISF_ERR_LIB_INITis returned when the library does not initialize successfully.
Reentrant: No
Link Libraries:
None.

This function initializes the ISF library.

API ISF library get information.

Definition at line 18 of file isf_init.c.

References bm_init(), ci_init(), ISF_ERR_LIB_INIT, ISF_SUCCESS, ISF_SYSTEM_READY_EVENT, isfSysEventHandler, and pm_init().

void isf_system_sync ( void  )

This function synchronizes the user tasks and the system initialization.

Purpose:
This function blocks the user tasks from executing until ISF initialization is completed.
Returns:
This function does not return any values.
Constraints:
Reentrant: No
Link Libraries:
isf_core.lib

Definition at line 74 of file isf_init.c.

References FALSE, ISF_SYSTEM_READY_EVENT, and isfSysEventHandler.


Variable Documentation

LWEVENT_STRUCT isfSysEventHandler

Definition of the event handle to the system ready event.

Definition at line 15 of file isf_init.c.

Referenced by isf_lib_init(), and isf_system_sync().