![]() |
ISF
2.1
Intelligent Sensing Framework for Kinetis with Processor Expert
|
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_target.h"
#include "isf.h"
#include "lwevent.h"
#include "lwsem.h"
#include "mutex.h"
#include "lwmem.h"
#include "isf_ci.h"
#include "task_ci.h"
#include "isf_ci_protocol.h"
#include "cortex.h"
#include "isf_devmsg.h"
#include "isf_ci_stream.h"
Go to the source code of this file.
Functions | |
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... | |
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... | |
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.
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.
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. |
Definition at line 584 of file task_ci.c.
References CI_ALLOC_MEM_ZERO, CI_MAX_PROTOCOL, ci_protocol_initptr_table, COMM_STATE_OK, 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().
isf_status_t ci_send_packet | ( | uint32 | anumBytes, |
uint8 * | apSrc | ||
) |
CI send packet - main function to send data to host.
anumBytes | - number of bytes to transmit. |
apSrc | - pointer to source of data to transmit. |
Definition at line 342 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().
uint32 get_ci_comm | ( | void | ) |
Definition at line 128 of file isf_sysconf_comms.c.
Referenced by ci_init().
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().
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.
(in) | c - character to process |
CI_PACKET_RECV_STATUS_NO | indicating no packet has been received. |
CI_PACKET_RECV_STATUS_YES | indicating a packet has been received. |
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().
void task_ci | ( | uint32 | initial_data | ) |
Command Interpreter Task - main task to handle communication
via mailboxes with the host.
initial_data | - value passed in when task is created, not used. |
Definition at line 499 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_CI_FAILURE, ISF_SUCCESS, ci_rx_packet_t::mbIndex, process_recv_byte(), and ci_rx_packet_t::pRxbuf.
Referenced by CI_task().
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 |
dm_DeviceDescriptor_t dm_dev_desc |
const uint8 packet_marker = CI_PACKET_MARKER |
Definition at line 40 of file task_ci.c.
Referenced by ci_send_packet().