![]() |
ISF
2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
|
Command Interpreter (CI) Protocol header file. More...
#include "isf.h"
Go to the source code of this file.
Data Structures | |
struct | ci_protocol_t |
This structure binds a protocol ID to a set of related functions and data. When a packet is received from the host, the CI task will invoke the callback that is associated with the protocol ID that is part of the CI packet header. More... | |
Macros | |
#define | CI_PROTOCOL_ID_SIZE (1) |
Define the number of bytes for the protocol ID. Do not modify. More... | |
#define | CI_PROTOCOL_DATA_OFFSET (1) |
Define offset to where protocol data begins of the send/receive buffer that skips pass the protocol id. Do not modify. More... | |
#define | CI_PROTOCOL_ID_INDEX (0) |
Define the index of the send/receive buffer of where the protocol ID resides. Do not modify. More... | |
#define | CI_MIN_RX_BYTES (CI_PROTOCOL_ID_SIZE) |
Define the minimum number of bytes for the CI wrapper that encapsulates the protocol data. More... | |
#define | CI_MAX_PROTOCOL (CI_PROTOCOL_ID_MAX) |
Define the maximum allowable CI protocols. More... | |
Typedefs | |
typedef isf_status_t(* | ci_protocol_callback_funcp_t) (uint32 anumSrcBytes, uint8 *apSrc, uint32 *apnumDestBytes, uint8 *apDest) |
This is a CI protocol callback function pointer. More... | |
typedef isf_status_t(* | ci_protocol_init_funcp_t) (uint8 aprotocolID, void *apInitData) |
This is a CI protocol intialization callback function pointer. More... | |
typedef 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 function during protocol initialization. More... | |
Enumerations | |
enum | ci_protocol_id_internal_enum { CI_PROTOCOL_ID_NULL = 0, CI_PROTOCOL_ID_MBOX = 1, CI_PROTOCOL_ID_Protocol1 = 2, CI_PROTOCOL_ID_MAX = 255 } |
These are the CI protocol IDs. More... | |
Command Interpreter (CI) Protocol header file.
Definition in file isf_ci_protocol.h.
#define CI_MAX_PROTOCOL (CI_PROTOCOL_ID_MAX) |
Define the maximum allowable CI protocols.
Definition at line 71 of file isf_ci_protocol.h.
Referenced by ci_init().
#define CI_MIN_RX_BYTES (CI_PROTOCOL_ID_SIZE) |
Define the minimum number of bytes for the CI wrapper that encapsulates the protocol data.
Definition at line 65 of file isf_ci_protocol.h.
Referenced by process_recv_byte().
#define CI_PROTOCOL_DATA_OFFSET (1) |
Define offset to where protocol data begins of the send/receive buffer that skips pass the protocol id. Do not modify.
Definition at line 53 of file isf_ci_protocol.h.
Referenced by ci_protocol_CB_mbox(), isf_ci_qr_update(), and task_ci().
#define CI_PROTOCOL_ID_INDEX (0) |
Define the index of the send/receive buffer of where the protocol ID resides. Do not modify.
Definition at line 59 of file isf_ci_protocol.h.
Referenced by ci_mbox_init().
#define CI_PROTOCOL_ID_SIZE (1) |
Define the number of bytes for the protocol ID. Do not modify.
Definition at line 47 of file isf_ci_protocol.h.
Referenced by ci_protocol_CB_mbox(), isf_ci_qr_update(), and task_ci().
typedef isf_status_t(* ci_protocol_callback_funcp_t) (uint32 anumSrcBytes, uint8 *apSrc, uint32 *apnumDestBytes, uint8 *apDest) |
This is a CI protocol callback function pointer.
A callback that implements a user defined CI 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.
[in] | anumSrcBytes | 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. |
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. |
Definition at line 116 of file isf_ci_protocol.h.
typedef isf_status_t(* ci_protocol_init_funcp_t) (uint8 aprotocolID, void *apInitData) |
This is a CI protocol intialization callback function pointer.
A callback that implements the initialization for a user defined CI protocol.
[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. |
ISF_SUCCESS | The initialization callback completed successfully. |
ISF_ERR_LIB_INIT | The initialization callback failed to initialize. |
Definition at line 147 of file isf_ci_protocol.h.
This is the pointer to the user defined data structure to be passed into the ci_protocol_init_funcp_t function during protocol initialization.
Definition at line 173 of file isf_ci_protocol.h.
These are the CI protocol IDs.
CI protocol ID defined here should not be used by user applications. The user can add custom protocol ID values that
Definition at line 24 of file isf_ci_protocol.h.