ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
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_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]anumBytesThe number of bytes that the host has sent to the protocol. The data resides in the apSrc buffer.
[in]apSrcPointer to the received data from the host.
[in,out]apnumDestBytesAs 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]apDestPointer to the processed data.
Return values
Thecallback 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]aprotocolIDThe 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]apInitDataPointer to the user defined data.
Return values
ISF_SUCCESSThe initialization callback completed successfully.
ISF_ERR_LIB_INITThe 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:
=
{
}
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...

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:
=
{
{
0,
},
{
64,
},
{
NULL,
NULL,
0,
0,
}
}
isf_status_t ci_stream_init(uint8, void *)
This is a CI stream protocol intialization callback function pointer.
isf_status_t(* ci_protocol_callback_funcp_t)(uint32 anumSrcBytes, uint8 *apSrc, uint32 *apnumDestBytes, uint8 *apDest)
This is a CI protocol callback function pointer.
isf_status_t ci_protocol_CB_mbox(uint32, uint8 *, uint32 *, uint8 *)
isf_status_t ci_mbox_init(uint8, void *)
isf_status_t(* ci_protocol_init_funcp_t)(uint8 aprotocolID, void *apInitData)
This is a CI protocol intialization callback function pointer.
isf_status_t ci_protocol_CB_stream(uint32, uint8 *, uint32 *, uint8 *)
This is a CI stream protocol callback function pointer.

CI protocol routing table.

Definition at line 53 of file isf_ci_protocol.c.