| ISF 2.1 Intelligent Sensing Framework for Kinetis with Processor Expert

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Data Structures | Macros | Typedefs | Enumerations
isf_ci_protocol.h File Reference

Command Interpreter (CI) Protocol header file. More...

`#include "isf.h"`
Include dependency graph for isf_ci_protocol.h:
This graph shows which files directly or indirectly include this file:

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

## Detailed Description

Command Interpreter (CI) Protocol header file.

Definition in file isf_ci_protocol.h.

## Macro Definition Documentation

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

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.

Parameters

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

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:
  isf_ci.lib

See also
  isf_status_t

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.

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:
  isf_ci.lib

See also
  isf_status_t

Definition at line 147 of file isf_ci_protocol.h.

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.

Definition at line 173 of file isf_ci_protocol.h.

## Enumeration Type Documentation

enum ci_protocol_id_internal_enum

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

Enumerator
CI_PROTOCOL_ID_NULL | This protocol ID is reserved and must not be used.
CI_PROTOCOL_ID_MBOX | This protocol ID is for the legacy mailbox interface. This protocol ID is reserved and must not be used.
CI_PROTOCOL_ID_Protocol1 |
CI_PROTOCOL_ID_MAX | This protocol ID is the maximum that the user can defined for custom protocol.

Definition at line 24 of file isf_ci_protocol.h.

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