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

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Functions | Variables
isf_ci_protocol.c File Reference

Command Interpreter (CI) protocol file containing the protocol routing table. More...

`#include "isf.h"`
`#include "isf_ci_protocol.h"`
`#include "Protocol1.h"`
Include dependency graph for isf_ci_protocol.c:

Go to the source code of this file.

## Functions
isf_status_t | ci_mbox_init (uint8, void *)
isf_status_t | ci_protocol_CB_mbox (uint32, uint8 *, uint32 *, uint8 *)
isf_status_t | ci_stream_init (uint8, void *)
| This is a CI stream protocol intialization callback function pointer. More...
isf_status_t | ci_protocol_CB_stream (uint32, uint8 *, uint32 *, uint8 *)
| This is a CI stream protocol callback function pointer. More...
uint32 | isf_ci_get_recv_size (void)
| CI Receive buffer size. More...

## Variables
ci_protocol_initdata_ptr_t | ci_protocol_initptr_table []
| CI protocol user defined initialization data pointer table. More...
const ci_protocol_t | ci_protocol_table []
| CI protocol routing table. More...

## Detailed Description

Command Interpreter (CI) protocol file containing the protocol routing table.

Definition in file isf_ci_protocol.c.

## Function Documentation

isf_status_t ci_mbox_init | ( | uint8 | ,
|  | void * |
| ) |  |

Definition at line 528 of file ci_protocol_mbox.c.

References _fw_device_info_get(), qr_config_t::appId, qr_config_t::byte_id, ci_callback, CI_PROTOCOL_ID_INDEX, ci_update_first_data_mb(), ci_regs_t::ciCtrlReg, isf_ci_app_write(), ISF_ERR_LIB_INIT, ISF_SUCCESS, MAX_ISF_APPLICATIONS, MAX_NUM_MAILBOXES, ci_regs_t::qr_config, and ci_ctrl_reg_t::reg.

Here is the call graph for this function:

isf_status_t ci_protocol_CB_mbox | ( | uint32 | ,
|  | uint8 * | ,
|  | uint32 * | ,
|  | uint8 * |
| ) |  |

Definition at line 795 of file ci_protocol_mbox.c.

References ci_host_cmd_packet_t::appId, ci_host_cmd_packet_t::byte_cnt, ci_app_resp_packet_t::bytes_left, ci_app_resp_packet_t::bytes_xfer, ccitt_crc16_cal(), ci_callback, CI_CMD_DEBUG_LOOPBACK, CI_CMD_LAST, CI_CMD_READ_VERSION, CI_CMD_RESET_APP, CI_CMD_UPDATE_QUICKREAD, CI_CMD_WRITE_CONFIG, CI_CMD_WRITE_SREC_FLASH, CI_ERROR_CB_NOT_REGISTERED, CI_ERROR_COMMAND, CI_ERROR_INVALID_LENGTH, CI_ERROR_NONE, CI_ERROR_PARAM, ci_get_first_mailbox, ci_get_wr_appid, ci_get_wr_cmd, ci_get_wr_cmdId, ci_get_wr_cnt, ci_get_wr_offset, ci_insert_crc, CI_INVALID_COUNT, CI_PROTOCOL_DATA_OFFSET, CI_PROTOCOL_ID_SIZE, CI_RW_NULL, ci_send_packet(), ci_host_cmd_packet_t::cmd, CMD_PACKET_BITS, COCO_BIT_MASK, FIRST_DATA_MAILBOX_NUM, ISF_SUCCESS, MAX_NUM_MAILBOXES, MB_APP_RESP_SIZE, MB_HOST_CMD, MB_HOST_CMD_SIZE, MB_RESP_APP_ID, MB_RESP_BYTES_XFER, MB_RESP_COUNT, MB_RESP_STATUS_CC, MBOX_CRC_BYTE_SIZE, ci_host_cmd_packet_t::offset, and ci_app_resp_packet_t::rw.

Here is the call graph for this function:

isf_status_t ci_protocol_CB_stream | ( | uint32 | ,
|  | uint8 * | ,
|  | uint32 * | ,
|  | uint8 * |
| ) |  |

This is a CI stream protocol callback function pointer.

A callback that implements the CI stream protocol. This callback is invoked if a packet is received with a protocol ID matching the ID that was assigned to this protocol during initialization.

Parameters

  [in] | anumBytes | The number of bytes that the host has sent to the protocol. The data resides in the apSrc buffer.
  [in] | apSrc | Pointer to the received data from the host.
  [in,out] | apnumDestBytes | As an input, this parameter specifies maxinum size of the destination buffer apDest. As an output this parameter specifies the actual size of the number of bytes used in the buffer apDest.
  [out] | apDest | Pointer to the processed data.

Return values

  The | callback function returns the protocol ID value of the next protocol to be invoked. If no more protocols are to be called, the callback function returns a zero to notify the CI to sends the destination buffer to the host.

Constraints:
  The following constraints must be observed when using this function. If these constraints are not met, this API returns an error.
  - anumSrcBytes must be equal to or greater than the minimum number of bytes the specific protocol may require. This requirement is protocol dependent.

Reentrant: No

Link Libraries:
  libisf_core_m0p.a, libisf_core_m4f.a, libisf_core_m4.a

See also
  isf_status_t

Definition at line 1010 of file ci_protocol_stream.c.

References ci_stream_ctrl_reg1_t::Bits, ccitt_crc16_cal(), CI_ALLOC_MEM_ZERO, CI_CMD_STREAM_CREATE_STREAM, CI_CMD_STREAM_DELETE_STREAM, CI_CMD_STREAM_DISABLE_CRC, CI_CMD_STREAM_DISABLE_DATA_UPDATE, CI_CMD_STREAM_ENABLE_CRC, CI_CMD_STREAM_ENABLE_DATA_UPDATE, CI_CMD_STREAM_GETINFO_GET_FIRST_STREAMID, CI_CMD_STREAM_GETINFO_GET_NEXT_STREAMID, CI_CMD_STREAM_GETINFO_NUMBER_STREAMS, CI_CMD_STREAM_GETINFO_STREAM_CONFIG, CI_CMD_STREAM_GETINFO_TRIGGER_STATE, CI_CMD_STREAM_RESET, CI_CMD_STREAM_RESET_TRIGGER, CI_COPY_MEM, CI_FREE_MEM, ci_send_packet(), CI_STATUS_STREAM_ERR, CI_STATUS_STREAM_ERR_CRC, CI_STATUS_STREAM_ERR_INVALID_CMD, CI_STATUS_STREAM_ERR_INVALID_NUM_PARM, CI_STATUS_STREAM_ERR_INVALID_PARM, CI_STATUS_STREAM_ERR_OUT_OF_MEMORY, CI_STATUS_STREAM_ERR_STREAM_NOEXISTS, CI_STATUS_STREAM_ERR_STREAMID_NOEXISTS, CI_STATUS_STREAM_STREAM_END_OF_LIST, ci_stream_config_t, ci_stream_element_t, ci_stream_get_host_cmd, ci_stream_get_num_element_bytes(), ci_stream_get_num_trig_bytes(), CI_STREAM_NUMELEMENTS_BYTESIZE, CI_STREAM_OUTPUTPACKET_STREAMID_BYTESIZE, cmd_createstream_get_numelements, cmd_createstream_get_streamID, cmd_createstream_get_trigmask_ptr, ci_stream_ctrl_reg1_t::enable_crc, ci_stream_ctrl_reg1_t::enable_stream_data, FALSE, isf_ci_stream_create(), isf_ci_stream_delete(), isf_ci_stream_get_first(), isf_ci_stream_get_next(), isf_ci_stream_get_num_streams(), isf_ci_stream_reset_trigger(), isf_ci_stream_set_CRC(), ISF_SUCCESS, STREAM_COCO_BIT_MASK, STREAM_CRC_BYTESIZE, STREAM_CRC_DISABLED, STREAM_CRC_ENABLED, STREAM_PROTOCOL_CMD_BYTESIZE, STREAM_PROTOCOL_DATA_DISABLED, STREAM_PROTOCOL_DATA_ENABLED, STREAM_PROTOCOL_RECV_MIN_BYTESIZE, STREAM_PROTOCOL_RESP_DEFAULT_ARRAY_BYTESIZE, STREAM_PROTOCOL_RESP_INDEX_CMD_ECHO, STREAM_PROTOCOL_RESP_INDEX_COCO_STAT, STREAM_PROTOCOL_RESP_INDEX_DATASTART, STREAM_PROTOCOL_RESP_INDEX_NUMDATA_LSB, STREAM_PROTOCOL_RESP_INDEX_NUMDATA_MSB, STREAM_PROTOCOL_RESP_INDEX_PROTOCOLID, STREAM_PROTOCOL_RESP_MIN_BYTESIZE, STREAM_PROTOCOL_RESP_RESPDATALENGTH_BYTESIZE, ci_stream_regs_t::StreamCtrlReg1, and TRUE.

Here is the call graph for this function:

isf_status_t ci_stream_init | ( | uint8 | ,
|  | void * |
| ) |  |

This is a CI stream protocol intialization callback function pointer.

A callback that implements the initialization for the CI stream protocol.

Parameters

  [in] | aprotocolID | The protocol ID assigned to the protocol. The protocol initialization function is required to save the ID and include the ID in data packets sent back to the host.
  [in] | apInitData | Pointer to the user defined data.

Return values

  ISF_SUCCESS | The initialization callback completed successfully.
  ISF_ERR_LIB_INIT | The initialization callback failed to initialize.

Constraints:
  None

Reentrant: No

Link Libraries:
  libisf_core_m0p.a, libisf_core_m4f.a, libisf_core_m4.a

See also
  isf_status_t

Definition at line 85 of file ci_protocol_stream.c.

References ISF_ERR_LIB_INIT, and ISF_SUCCESS.

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:

## Variable Documentation

ci_protocol_initdata_ptr_t ci_protocol_initptr_table[]

Initial value:
=
{
(ci_protocol_initdata_ptr_t)NULL,
(ci_protocol_initdata_ptr_t)NULL
}
ci_protocol_initdata_ptr_t
void * ci_protocol_initdata_ptr_t
This is the pointer to the user defined data structure to be passed into the ci_protocol_init_funcp_t...
Definition: isf_ci_protocol.h:173

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[]

Initial value:
=
{
{
(ci_protocol_init_funcp_t*)ci_mbox_init,
(ci_protocol_callback_funcp_t*)ci_protocol_CB_mbox,
0,
CI_PROTOCOL_ID_MBOX
},
{
(ci_protocol_init_funcp_t*)ci_stream_init,
(ci_protocol_callback_funcp_t*)ci_protocol_CB_stream,
64,
CI_PROTOCOL_ID_Protocol1
},
{
NULL,
NULL,
0,
0,
}
}
ci_stream_init
isf_status_t ci_stream_init(uint8, void *)
This is a CI stream protocol intialization callback function pointer.
Definition: ci_protocol_stream.c:85
CI_PROTOCOL_ID_MBOX
Definition: isf_ci_protocol.h:31
ci_protocol_callback_funcp_t
isf_status_t(* ci_protocol_callback_funcp_t)(uint32 anumSrcBytes, uint8 *apSrc, uint32 *apnumDestBytes, uint8 *apDest)
This is a CI protocol callback function pointer.
Definition: isf_ci_protocol.h:116
ci_protocol_CB_mbox
isf_status_t ci_protocol_CB_mbox(uint32, uint8 *, uint32 *, uint8 *)
Definition: ci_protocol_mbox.c:795
ci_mbox_init
isf_status_t ci_mbox_init(uint8, void *)
Definition: ci_protocol_mbox.c:528
ci_protocol_init_funcp_t
isf_status_t(* ci_protocol_init_funcp_t)(uint8 aprotocolID, void *apInitData)
This is a CI protocol intialization callback function pointer.
Definition: isf_ci_protocol.h:147
ci_protocol_CB_stream
isf_status_t ci_protocol_CB_stream(uint32, uint8 *, uint32 *, uint8 *)
This is a CI stream protocol callback function pointer.
Definition: ci_protocol_stream.c:1010
CI_PROTOCOL_ID_Protocol1
Definition: isf_ci_protocol.h:33

CI protocol routing table.

Definition at line 53 of file isf_ci_protocol.c.

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