![]()  | 
  
    ISSDK
    1.8
    
   IoT Sensing Software Development Kit 
   | 
 
The host_io_uart.c file contains definitions for UART based streaming interface for sending and reseiving messages to and from Host using ISSDK Host Protocol. More...
#include <stdlib.h>#include "fsl_common.h"#include "host_io_uart.h"#include "register_io_i2c.h"#include "register_io_spi.h"#include "data_format_hdlc.h"#include "data_format_json.h"
Go to the source code of this file.
Functions | |
| void | HOST_SignalEvent_t (uint32_t event) | 
| Defines the HOST UART signal event handler.  More... | |
| uint8_t | getSlaveIndex (uint8_t slaveAddress) | 
| void | Host_IO_Add_ISO_Header (uint8_t streamID, uint8_t *pStreamingPacket, size_t sizePayload) | 
| uint8_t | Host_IO_Init (ARM_DRIVER_USART *pDrv, void *pBus, void *pDevInfo, void *spiSlaveParams, uint16_t slaveAddress) | 
| void | Host_IO_Send (uint8_t *pMsg, size_t size, uint8_t encoding) | 
| void | Host_IO_Receive (host_cmd_proc_fn_t process_host_command, uint8_t encoding) | 
Variables | |
| host_interface_handle_t | gHostHandle = {0} | 
| uint8_t | gUartRxBuff | 
| uint8_t | gHostRxBuff [HOST_RX_BUF_LEN] | 
| host_rx_packet_t | gHostRxPkt = {.pRxbuf = gHostRxBuff} | 
| host_channel_params_t | gHostChannelParams [MAX_HOST_STREAMS] | 
| volatile bool | bUartTxComplete | 
| volatile bool | bUartRxPendingMsg | 
| volatile bool | bUartErrorMsg | 
The host_io_uart.c file contains definitions for UART based streaming interface for sending and reseiving messages to and from Host using ISSDK Host Protocol.
Definition in file host_io_uart.c.
| uint8_t getSlaveIndex | ( | uint8_t | slaveAddress | ) | 
Definition at line 64 of file host_io_uart.c.
References MAX_HOST_STREAMS.
Referenced by Host_IO_Receive().

| void Host_IO_Add_ISO_Header | ( | uint8_t | streamID, | 
| uint8_t * | pStreamingPacket, | ||
| size_t | sizePayload | ||
| ) | 
Definition at line 86 of file host_io_uart.c.
References HOST_ISO_LEN_LSB_OFFSET, HOST_ISO_LEN_MSB_OFFSET, HOST_ISO_PAYLOAD_OFFSET, HOST_MSG_HDR_TAG_OFFSET, and HOST_PRO_INT_ISO_TAG.
Referenced by main().

| uint8_t Host_IO_Init | ( | ARM_DRIVER_USART * | pDrv, | 
| void * | pBus, | ||
| void * | pDevInfo, | ||
| void * | spiSlaveParams, | ||
| uint16_t | slaveAddress | ||
| ) | 
Definition at line 100 of file host_io_uart.c.
References bUartErrorMsg, bUartRxPendingMsg, bUartTxComplete, COMM_NONBLOCKING, COMM_UART, _host_interface_handle_::commHandle, host_channel_params_t::deviceInfo, gUartRxBuff, HOST_Initialize(), HOST_Receive(), HOST_SignalEvent_t(), MAX_HOST_STREAMS, _comm_handle_::pComm, host_channel_params_t::pCommDrv, _host_interface_handle_::pCommInterface, host_channel_params_t::pSPIparams, and host_channel_params_t::slaveAddress.
Referenced by main().


| void Host_IO_Receive | ( | host_cmd_proc_fn_t | process_host_command, | 
| uint8_t | encoding | ||
| ) | 
Definition at line 207 of file host_io_uart.c.
References bUartErrorMsg, bUartRxPendingMsg, _comm_control_::control, getSlaveIndex(), gHostRxBuff, gUartRxBuff, HDLC_Process_Rx_Byte(), HOST_CMD_RSP_LEN, HOST_Configure(), HOST_DEV_HDR_VER_OFFSET, HOST_DEV_LEN_STR_OFFSET, HOST_DEV_RSP_LEN, HOST_FORMAT_HDLC, HOST_FORMAT_JSON, HOST_INTERFACE_VERSION, Host_IO_Send(), HOST_ISO_LEN_LSB_OFFSET, HOST_ISO_LEN_MSB_OFFSET, HOST_ISO_PAYLOAD_OFFSET, HOST_MSG_CMD_LENGTH_OFFSET, HOST_MSG_CMD_OPC_OFFSET, HOST_MSG_CMD_REGIS_ADDR_OFFSET, HOST_MSG_CMD_SLAVE_ADDR_OFFSET, HOST_MSG_CMD_VALUE_OFFSET, HOST_MSG_HDR_SEQ_OFFSET, HOST_MSG_HDR_TAG_OFFSET, HOST_MSG_LEN_LSB_OFFSET, HOST_MSG_LEN_MSB_OFFSET, HOST_PRO_CMD_R_REG_TAG, HOST_PRO_CMD_W_REG_TAG, HOST_PRO_CMD_WR_ACK_TAG, HOST_PRO_CMD_WR_NAK_TAG, HOST_PRO_INT_CMD_TAG, HOST_PRO_INT_DEV_TAG, HOST_PRO_INT_ISO_TAG, HOST_Receive(), HOST_RSP_HDR_LEN, int32_t(), JSON_Process_Rx_Byte(), host_rx_packet_t::mIndex, process_host_command(), Register_I2C_BlockWrite(), Register_I2C_Read(), Register_SPI_BlockWrite(), Register_SPI_Read(), and status.
Referenced by main().


| void Host_IO_Send | ( | uint8_t * | pMsg, | 
| size_t | size, | ||
| uint8_t | encoding | ||
| ) | 
Definition at line 136 of file host_io_uart.c.
References bUartTxComplete, HDLC_Process_Tx_Msg(), HOST_FORMAT_HDLC, HOST_FORMAT_JSON, HOST_FORMAT_PLAIN, HOST_Send(), and JSON_Process_Tx_Msg().
Referenced by Host_IO_Receive(), main(), and process_host_command().


| void HOST_SignalEvent_t | ( | uint32_t | event | ) | 
Defines the HOST UART signal event handler.
The Signal Event Handler function required by host_io_uart.c.
| [in] | event | The UART event that occured. | 
Definition at line 47 of file host_io_uart.c.
References bUartErrorMsg, bUartRxPendingMsg, and bUartTxComplete.
Referenced by Host_IO_Init().

| volatile bool bUartErrorMsg | 
Definition at line 41 of file host_io_uart.c.
Referenced by Host_IO_Init(), Host_IO_Receive(), and HOST_SignalEvent_t().
| volatile bool bUartRxPendingMsg | 
Definition at line 41 of file host_io_uart.c.
Referenced by Host_IO_Init(), Host_IO_Receive(), and HOST_SignalEvent_t().
| volatile bool bUartTxComplete | 
Definition at line 41 of file host_io_uart.c.
Referenced by Host_IO_Init(), Host_IO_Send(), and HOST_SignalEvent_t().
| host_channel_params_t gHostChannelParams[MAX_HOST_STREAMS] | 
Definition at line 40 of file host_io_uart.c.
| host_interface_handle_t gHostHandle = {0} | 
Definition at line 37 of file host_io_uart.c.
| uint8_t gHostRxBuff[HOST_RX_BUF_LEN] | 
Definition at line 38 of file host_io_uart.c.
Referenced by Host_IO_Receive().
| host_rx_packet_t gHostRxPkt = {.pRxbuf = gHostRxBuff} | 
Definition at line 39 of file host_io_uart.c.
| uint8_t gUartRxBuff | 
Definition at line 38 of file host_io_uart.c.
Referenced by Host_IO_Init(), and Host_IO_Receive().