| ISF 2.2 rev 5 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
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 dependency graph for isf_init.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros
#define | ISF_SYSTEM_READY_EVENT (1<<1)
| Definition of the system ready event. More...
#define | ISF_TASK_PRIORITY (9)
| Definition of the event handle to the system ready event. More...
#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. More...
#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. More...
#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. More...
#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. More...
#define | ISF_TASK_ATTRIBUTE_SM
#define | ISF_APP_CALLBACK_DEV_INFO (isf_app_callback_dev_info)
#define | ISF_APP_CALLBACK_MBOX (isf_app_callback_mbox),
#define | ISF_TASK_CI_INDEX (ISF_TASK_INDEX_START + 2)
| The following macros define the individual attributes for ISF Command Interpreter task task-startup. Note: These macro definitions must not be changed by the user. More...
#define | ISF_TASK_CI_STACK_SIZE 1200
#define | ISF_TASK_CI_PRIORITY 8
#define | ISF_TASK_CI_NAME ("ci")
#define | ISF_TASK_CI_PARAM (0)
#define | ISF_TASK_CI_TIMESLICE (0)
#define | ISF_TASK_ATTRIBUTE_CI
| Definition of the ISF Command Interpreter task task-startup attributes macro. This task initialization macro is used to initialize and launch the Command Interpreter task. More...
#define | ISF_TASK_BM_INDEX (ISF_TASK_INDEX_START + 3)
| The following macros define the individual attributes for the ISF Bus Manager task task-startup. Note: These macro definitions must not be changed by the user. More...
#define | ISF_TASK_BM_STACK_SIZE 1024
#define | ISF_TASK_BM_PRIORITY 9
#define | ISF_TASK_BM_NAME ("BusManager")
#define | ISF_TASK_BM_PARAM (0)
#define | ISF_TASK_BM_TIMESLICE (0)
#define | ISF_TASK_ATTRIBUTE_BM
| Definition of the ISF Bus Manager task task-startup attributes macro. This task initialization macro is used during the initial task-startup process to initialize and launch the Bus Manager task. More...
#define | ISF_TASK_ATTRIBUTE_PM
#define | ISF_TASKS_ATTRIBUTES
| ISF tasks attributes. The user puts these tasks in the MQX_template_list[] array. More...
#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. More...

## Functions
isf_status_t | isf_lib_init (void *pOptions)
| This function initializes the ISF library. More...
void | isf_init_task (uint32 initial_data)
| This function initializes the ISF components for operation. More...
void | isf_system_sync (void)
| This function synchronizes the user tasks and the system initialization. More...
void | task_ci (uint32)
| Command Interpreter Task - main task to handle communication via mailboxes with the host. More...
isf_status_t | ci_init (void)
| This API initializes the Command Interpreter. More...
void | task_bm (uint32)
| Bus Manager Task - main task to handle communication via mailboxes with the host. More...
isf_status_t | bm_init (void)
| Bus management initialization . More...

## 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.

Copyright
  Copyright (c) 2015, Freescale Semiconductor, Inc.

Definition in file isf_init.h.

## Macro Definition Documentation

#define ISF_APP_CALLBACK_DEV_INFO (isf_app_callback_dev_info)

Definition at line 209 of file isf_init.h.

#define ISF_APP_CALLBACK_MBOX (isf_app_callback_mbox),

Definition at line 210 of file isf_init.h.

#define ISF_APP_CALLBACKS

Value:
ISF_APP_CALLBACK_DEV_INFO, \
ISF_APP_CALLBACK_MBOX
ISF_APP_CALLBACK_DEV_INFO
#define ISF_APP_CALLBACK_DEV_INFO
Definition: isf_init.h:209

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 341 of file isf_init.h.

#define ISF_SYSTEM_READY_EVENT (1<<1)

Definition of the system ready event.

Definition at line 23 of file isf_init.h.

Referenced by isf_lib_init(), and isf_system_sync().

#define ISF_TASK_ATTRIBUTE_BM

Value:
{ ISF_TASK_BM_INDEX, \
task_bm, \
ISF_TASK_BM_STACK_SIZE, \
ISF_TASK_BM_PRIORITY, \
ISF_TASK_BM_NAME, \
MQX_AUTO_START_TASK, \
ISF_TASK_BM_PARAM, \
ISF_TASK_BM_TIMESLICE },
ISF_TASK_BM_INDEX
#define ISF_TASK_BM_INDEX
The following macros define the individual attributes for the ISF Bus Manager task task-startup...
Definition: isf_init.h:260

Definition of the ISF Bus Manager task task-startup attributes macro. This task initialization macro is used during the initial task-startup process to initialize and launch the Bus Manager task.

Definition at line 272 of file isf_init.h.

#define ISF_TASK_ATTRIBUTE_CI

Value:
{ ISF_TASK_CI_INDEX, \
task_ci, \
ISF_TASK_CI_STACK_SIZE, \
ISF_TASK_CI_PRIORITY, \
ISF_TASK_CI_NAME, \
MQX_AUTO_START_TASK, \
ISF_TASK_CI_PARAM, \
ISF_TASK_CI_TIMESLICE },
ISF_TASK_CI_INDEX
#define ISF_TASK_CI_INDEX
The following macros define the individual attributes for ISF Command Interpreter task task-startup...
Definition: isf_init.h:217

Definition of the ISF Command Interpreter task task-startup attributes macro. This task initialization macro is used to initialize and launch the Command Interpreter task.

Definition at line 228 of file isf_init.h.

#define ISF_TASK_ATTRIBUTE_INIT

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 },
ISF_TASK_INIT_INDEX
#define ISF_TASK_INIT_INDEX
The following macros define the individual attributes for ISF Initialization Task startup...
Definition: isf_init.h:126

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 137 of file isf_init.h.

#define ISF_TASK_ATTRIBUTE_PM

Definition at line 319 of file isf_init.h.

#define ISF_TASK_ATTRIBUTE_SM

Definition at line 194 of file isf_init.h.

#define ISF_TASK_BM_INDEX (ISF_TASK_INDEX_START + 3)

The following macros define the individual attributes for the ISF Bus Manager task task-startup.
Note: These macro definitions must not be changed by the user.

Definition at line 260 of file isf_init.h.

#define ISF_TASK_BM_NAME ("BusManager")

Definition at line 263 of file isf_init.h.

#define ISF_TASK_BM_PARAM (0)

Definition at line 264 of file isf_init.h.

#define ISF_TASK_BM_PRIORITY 9

Definition at line 262 of file isf_init.h.

#define ISF_TASK_BM_STACK_SIZE 1024

Definition at line 261 of file isf_init.h.

#define ISF_TASK_BM_TIMESLICE (0)

Definition at line 265 of file isf_init.h.

#define ISF_TASK_CI_INDEX (ISF_TASK_INDEX_START + 2)

The following macros define the individual attributes for ISF Command Interpreter task task-startup.
Note: These macro definitions must not be changed by the user.

Definition at line 217 of file isf_init.h.

#define ISF_TASK_CI_NAME ("ci")

Definition at line 220 of file isf_init.h.

#define ISF_TASK_CI_PARAM (0)

Definition at line 221 of file isf_init.h.

#define ISF_TASK_CI_PRIORITY 8

Definition at line 219 of file isf_init.h.

#define ISF_TASK_CI_STACK_SIZE 1200

Definition at line 218 of file isf_init.h.

#define ISF_TASK_CI_TIMESLICE (0)

Definition at line 222 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 50 of file isf_init.h.

#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.

Definition at line 126 of file isf_init.h.

#define ISF_TASK_INIT_NAME ("ii")

Definition at line 129 of file isf_init.h.

#define ISF_TASK_INIT_PARAM (0)

Definition at line 130 of file isf_init.h.

#define ISF_TASK_INIT_PRIORITY (ISF_TASK_PRIORITY-1)

Definition at line 128 of file isf_init.h.

#define ISF_TASK_INIT_STACK_SIZE (384)

Definition at line 127 of file isf_init.h.

#define ISF_TASK_INIT_TIMESLICE (0)

Definition at line 131 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 44 of file isf_init.h.

#define ISF_TASK_PRIORITY (9)

Definition of the event handle to the system ready event.

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 34 of file isf_init.h.

#define ISF_TASKS_ATTRIBUTES

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 330 of file isf_init.h.

## Function Documentation

isf_status_t bm_init | ( | void |  | ) |

Bus management initialization
.

This API initializes the Bus Manager.

Returns
  ISF_SUCCESS if initialization is successful. ISF_ERR_LIB_INIT if initialization failed.

Errors:

Constraints:

Reentrant: No.

Link Libraries:

See also

Definition at line 445 of file bus_management.c.

References BM_PIPELINE_STAGES, BM_task(), BM_TASK_NAME, BM_TASK_PRIORITY, BM_TASK_STACK_SIZE, bm_timer_init(), bm_t::cb_events, bm_t::cb_list_cur_cnt, bm_t::cb_token_active_mask, bm_t::cb_token_registered_mask, event_bm_callback, gpBm_cb_list, ISF_SUCCESS, bm_t::pipeline_index, and sema_bm_access.

Referenced by isf_lib_init().

Here is the call graph for this function:

Here is the caller graph for this function:

isf_status_t ci_init | ( | void |  | ) |

This API initializes the Command Interpreter.

The Command Interpreter requires a one time initialization at system startup performed by this API call. It creates and initializes internal variables. In addition, it installs an interrupt service routine for the slave-port interrupt.

Returns
  ci_init() returns a value of type isf_status_t providing the status of the initialization operation.

Return values

  ISF_SUCCESS | The initialization completed successfully.
  ISF_ERR_LIB_INIT | The interrupt service routine for the uart channel used by the Command Interpereter could not installed.

Constraints:
  The following constraints must be observed when using this function. If these constraints are not met, this API returns an error.
  - An interrupt routine for the uart channel used by the Command Interpereter has not been installed.

Reentrant: No

Link Libraries:
  isf_core.lib

See also
  ci_status_t

Definition at line 580 of file task_ci.c.

References CI_ALLOC_MEM_ZERO, CI_MAX_PROTOCOL, ci_protocol_initptr_table, CI_task(), CI_TASK_NAME, CI_TASK_PRIORITY, CI_TASK_STACK_SIZE, COMM_STATE_INIT, dm_channel_desc, dm_channel_get_state(), dm_channel_init(), dm_channel_start(), dm_device_open(), get_ci_comm(), isf_ci_get_recv_size(), ISF_ERR_LIB_INIT, ISF_SUCCESS, ci_protocol_t::protcolID, and ci_rx_packet_t::pRxbuf.

Referenced by isf_lib_init().

Here is the call graph for this function:

Here is the caller graph for this function:

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_data | This 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

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] | pOptions | This 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_SUCCESS | is returned when the library initializes successfully.
  ISF_ERR_LIB_INIT | is returned when the library does not initialize successfully.

Reentrant: No

Link Libraries:
  None.

This function initializes the ISF library.

API to get ISF 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, and isfSysEventHandler.

Here is the call graph for this function:

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 50 of file isf_init.c.

References FALSE, ISF_SYSTEM_READY_EVENT, isfSysEventHandler, and synchCreate.

void task_bm | ( | uint32 | initial_data | ) |

Bus Manager Task - main task to handle communication
via mailboxes with the host.

Parameters

  initial_data | - value passed in when task is created, not used.

Returns
  None

Errors:

Constraints:

Reentrant: No.

Link Libraries:

See also
  main.c/MQX_template_list[]

Definition at line 673 of file bus_management.c.

References bm_t::cb_token_active_mask, event_bm_callback, FALSE, gpBm_cb_list, and bm_cb_config_t::pCallback.

Referenced by BM_task().

Here is the caller graph for this function:

void task_ci | ( | uint32 | initial_data | ) |

Command Interpreter Task - main task to handle communication
via mailboxes with the host.

Parameters

  initial_data | - value passed in when task is created, not used.

Returns
  None

Errors:

Constraints:

Reentrant: No.

Link Libraries:

See also
  main.c/MQX_template_list[]

Definition at line 492 of file task_ci.c.

References ci_get_protocol_id, CI_PACKET_RECV_STATUS_YES, CI_PROTOCOL_DATA_OFFSET, CI_PROTOCOL_ID_MAX, CI_PROTOCOL_ID_NULL, CI_PROTOCOL_ID_SIZE, dm_device_read(), ISF_SUCCESS, ci_rx_packet_t::mbIndex, process_recv_byte(), and ci_rx_packet_t::pRxbuf.

Referenced by CI_task().

Here is the call graph for this function:

Here is the caller graph for this function:
- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.