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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
task_ci.c File Reference

Command Interpreter (CI) task source file that implements the top level CI protocol features and functionality. This file is internal ISF code. More...

`#include "isf.h"`
`#include "isf_ci.h"`
`#include "task_ci.h"`
`#include "isf_ci_protocol.h"`
`#include "isf_devmsg.h"`
`#include "isf_ci_stream.h"`
`#include "isf_init.h"`
Include dependency graph for task_ci.c:

Go to the source code of this file.

## Macros
#define | CI_TASK_NAME ISF_TASK_CI_NAME
#define | CI_TASK_STACK_SIZE ISF_TASK_CI_STACK_SIZE
#define | CI_TASK_PRIORITY ISF_TASK_CI_PRIORITY

## Functions
void | isf_system_sync (void)
| This function synchronizes the user tasks and the system initialization. More...
uint32 | get_ci_comm (void)
ci_packet_recv_status_t | process_recv_byte (uint8 c)
| Process data received over comm port. Perform CI packet processing and return to caller status. More...
uint32 | isf_ci_get_recv_size (void)
| CI Receive buffer size. More...
| OSA_TASK_DEFINE (CI, CI_TASK_STACK_SIZE)
void | CI_task (os_task_param_t task_init_data)
| Command Interpreter Task - main task to handle communication via mailboxes with the host. More...
isf_status_t | ci_send_packet (uint32 anumBytes, uint8 *apSrc)
| CI send packet - main function to send data to host. More...
void | task_ci (uint32 initial_data)
| 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...

## Variables
const uint8 | packet_marker = CI_PACKET_MARKER
dm_ChannelDescriptor_t | dm_channel_desc
dm_DeviceDescriptor_t | dm_dev_desc
const ci_protocol_t | ci_protocol_table []
| CI protocol routing table. More...
ci_protocol_initdata_ptr_t | ci_protocol_initptr_table []
| CI protocol user defined initialization data pointer table. More...

## Detailed Description

Command Interpreter (CI) task source file that implements the top level CI protocol features and functionality. This file is internal ISF code.

Definition in file task_ci.c.

## Macro Definition Documentation

#define CI_TASK_NAME ISF_TASK_CI_NAME

Definition at line 56 of file task_ci.c.

Referenced by ci_init().

#define CI_TASK_PRIORITY ISF_TASK_CI_PRIORITY

Definition at line 60 of file task_ci.c.

Referenced by ci_init().

#define CI_TASK_STACK_SIZE ISF_TASK_CI_STACK_SIZE

Definition at line 58 of file task_ci.c.

Referenced by ci_init().

## Function Documentation

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:

isf_status_t ci_send_packet | ( | uint32 | anumBytes,
|  | uint8 * | apSrc
| ) |  |

CI send packet - main function to send data to host.

Parameters

  anumBytes | - number of bytes to transmit.
  apSrc | - pointer to source of data to transmit.

Returns
  See ci_response_enum type for possible return values

Errors:
  None

Constraints:
  Only one caller can have access to the transmit operation. Other callers will be blocked by a semaphore until the current transmit operation has completed.

Reentrant: Yes.

Link Libraries:

See also

Definition at line 338 of file task_ci.c.

References ci_tx_packet_t::bytesLeft, CI_ESCAPE_STATE_WAIT_1ST_CHAR, CI_ESCAPE_STATE_WAIT_2ND_CHAR, CI_PACKET_MARKER, CI_TX_STATE_NULL, CI_TX_STATE_SEND_ENDMARKER4, CI_TX_STATE_SEND_PACKETDATA2, CI_TX_STATE_SEND_STARTMARKER1, dm_device_write(), FALSE, ISF_CI_FAILURE, ISF_SUCCESS, packet_marker, ci_tx_packet_t::pTxbuf, TRUE, and ci_tx_packet_t::txState.

Referenced by ci_protocol_CB_mbox(), ci_protocol_CB_stream(), isf_ci_qr_update(), and isf_ci_stream_update_data().

Here is the call graph for this function:

Here is the caller graph for this function:

void CI_task | ( | os_task_param_t | task_init_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

Definition at line 670 of file task_ci.c.

References isf_system_sync(), and task_ci().

Referenced by ci_init().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 get_ci_comm | ( | void |  | ) |

Definition at line 93 of file isf_sysconf_comms.c.

Referenced by ci_init().

Here is the caller graph for this function:

uint32 isf_ci_get_recv_size | ( | void |  | ) |

CI Receive buffer size.

Definition at line 31 of file isf_ci_protocol.c.

Referenced by ci_init().

Here is the caller graph for this function:

void isf_system_sync | ( | void |  | ) |

This function synchronizes the user tasks and the system initialization.

Definition at line 50 of file isf_init.c.

Referenced by CI_task().

Here is the caller graph for this function:

OSA_TASK_DEFINE | ( | CI | ,
|  | CI_TASK_STACK_SIZE |
| ) |  |

ci_packet_recv_status_t process_recv_byte | ( | uint8 | c | ) |

Process data received over comm port. Perform CI packet processing and return to caller status.

Parameters

  (in) | c - character to process

Returns
  process_recv_byte() returns a value of type ci_packet_recv_status_t indicating the status of the packet received status.

Return values

  CI_PACKET_RECV_STATUS_NO | indicating no packet has been received.
  CI_PACKET_RECV_STATUS_YES | indicating a packet has been received.

See also
  task_ci()

Definition at line 141 of file task_ci.c.

References CI_MIN_RX_BYTES, CI_PACKET_MARKER, CI_PACKET_RECV_STATUS_NO, CI_PACKET_RECV_STATUS_YES, CI_RX_STATE_GETTINGPACKETDATA2, CI_RX_STATE_WAITFORPACKETMARKER1, FALSE, ci_rx_packet_t::mbIndex, ci_rx_packet_t::packetSize, ci_rx_packet_t::pRxbuf, ci_rx_packet_t::rxState, and TRUE.

Referenced by task_ci().

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:

## Variable Documentation

ci_protocol_initdata_ptr_t ci_protocol_initptr_table[]

CI protocol user defined initialization data pointer table.

Definition at line 42 of file isf_ci_protocol.c.

Referenced by ci_init().

const ci_protocol_t ci_protocol_table[]

CI protocol routing table.

Definition at line 53 of file isf_ci_protocol.c.

dm_ChannelDescriptor_t dm_channel_desc

Definition at line 35 of file task_ci.c.

Referenced by ci_init().

dm_DeviceDescriptor_t dm_dev_desc

Definition at line 36 of file task_ci.c.

const uint8 packet_marker = CI_PACKET_MARKER

Definition at line 32 of file task_ci.c.

Referenced by ci_send_packet().

- © Freescale Semiconductor, Inc. 2016. All Rights Reserved.