29 #include "fsl_i2c_master_driver.h"
40 #define SENSOR_DATA_READY_EVENT ((uint32)(1 << 10))
41 #define RLI_COMM_BUFFER_SIZE (255)
42 #define RLI_CMD_BUFFER_SIZE (24)
53 #define SET_FIELD(name,val) (((val)<<name##_SHIFT)&(name##_MASK))
54 #define GET_FIELD(name,val) ((val&name##_MASK)>>name##_SHIFT)
118 #define RLI_APP_DATA "RLI App"
155 .version_info = 0x0100,
164 static const uint8 i2cChannels[] =
170 static const uint8 spiChannels[] =
217 switch(pHostPacket->
cmd)
256 if (pHostPacket->
byte_cnt > size ) {
319 if (pDeviceCmd->
nWrite > 0) {
368 uint8 triggerMask = 1;
376 readCfg.
period = (cmdBuf[0]<<24)|(cmdBuf[1]<<16)|(cmdBuf[2]<<8)|(cmdBuf[3]);
382 element1.datasetID = rliAppState.
streamId;
392 callbackRet = rliAppState.
token;
447 uint8 channelType, channelID;
468 i2c_device_t i2cDevice = {0};
479 i2cDevice.baudRate_kbps = ((
i2c_Master_BusConfig_t*)gSys_ConfiguredChannelList[i2cChannels[channelID]].pConfig)->defaultSpeed;
isf_i2c_master_types.h defines the i2c master protocol adapter structure and types.
ISF board support header files.
This file defines the system configuration for the communication channel.
#define RLI_COMM_BUFFER_SIZE
isf_status_t isf_rli_close(RLI_DEV_HANDLE *apRLIDeviceHandle)
This function closes the RLI connection.
uint16 version_info
ISF Embedded Application version information.
ISF Command Interpreter (CI) stream protocol header file.
ISF Application Type for RLI Application.
uint8 appType
ISF Embedded Application type.
int32 close_channel(rliAppState_t *appState)
API definitions, types, and macros for the Intelligent Sensing Framework (ISF) Bus Manager (BM)...
uint8_t periodicStartAddress
const sys_channelDescriptor_t gSys_ConfiguredChannelList[]
This data structure/variable holds the complete state of the rli magnetometer sensor embedded applica...
void rli_PeriodicCallback(rliAppState_t *rliAppState)
RLI_CHANNEL_HANDLE * isf_rli_init(uint32 aChannelId)
This function initializes a register level interface.
uint8_t rcvBuffer_t[RLI_COMM_BUFFER_SIZE]
rli overall application state buffer format.
uint32 bm_callback_token_t
This type defines the Bus Manager token. Each callback registered with the Bus Manager receives a uni...
isf_status_t bm_unregister_callback(bm_callback_token_t aToken)
This API unregisters one or more callbacks.
uint8 numBytes
ISF Embedded Application registered additional information/data size.
isf_pm.h describes the API definitions, types, and macros for the Intelligent Sensing Framework (ISF)...
The isf_types.h file contains the ISF data type definitions and some of the globally used macros...
int32 device_disconnect(rliAppState_t *appState)
uint8_t cmdBuffer_t[RLI_CMD_BUFFER_SIZE]
RLI_CHANNEL_HANDLE * pChannelDescriptor
isf_status_t isf_ci_stream_delete(uint8 aStreamID)
This API deletes the given stream ID.
isf_status_t isf_ci_stream_create(uint8 aStreamID, uint8 aNumElements, uint8 *apTriggerMask, ci_stream_element_t *apElementList)
This API creates a stream.
bm_callback_token_t bm_register_periodic_callback(isf_duration_t aPeriod, bm_callback_t *pCallback, void *pCbData)
This API schedules a callback at the specified period.
int32 device_connect(rliAppState_t *appState)
uint32 isf_ci_app_read(uint8 aAppId, uint32 anumBytes, uint8 *apDst)
This API reads data from the host via the mailboxes.
uint32 isf_ci_app_write(uint8 aAppId, uint32 anumBytes, uint8 *apSrc)
This API writes data to the host via the mailboxes.
isf_status_t isf_rli_write(RLI_DEV_HANDLE *apRLIDeviceHandle, int32 startAddress, uint32 aNbyteWrite, uint8 *apWriteBuffer)
This function writes to the device registers.
isf_status_t isf_rli_deint(RLI_CHANNEL_HANDLE *apRLIChannelHandle)
This function de-initialize the RLI channel.
isf_status_t bm_stop(bm_callback_token_t aTokens)
This API stops one or more callback(s) by setting them to the inactive state.
isf_status_t bm_start(boolean aSync, bm_callback_token_t aTokens)
This API sets one or more callback(s) to the active state.
This structure defines the channel descriptor.
bm_callback_token_t token
uint32 isf_duration_t
ISF time duration in microseconds.
spi_master_CommSpecificInfo_t rli_spi_get_config(uint16 spiAddress)
Main ISF header file. Contains code common to all ISF components.
void( bm_callback_t)(void *)
Type for the prototype for a Bus Manager periodic callback function.
unsigned short int uint16
int32 open_channel(rliAppState_t *appState)
rli application configuration buffer format.
API definitions, types, and macros for the Intelligent Sensing Framework (ISF) Command Interpreter (C...
rliConfigRegister_t CfgBuffer
Application configuration information.
The isf_init.h file contains the task initialization attributes required for initialization of the fo...
#define BM_ERROR
This value specifies a general Bus Manager error. If an error occurs in registering a callback...
This structure enables an application to read from or write to the host.
rcvBuffer_t periodicRcvBuffer
int32 isf_status_t
ISF return status type.
isf_spi_master_types.h defines the spi protocol adapter structure and types.
#define RLI_CMD_BUFFER_SIZE
This structure contains host command information.
isf_status_t isf_rli_read(RLI_DEV_HANDLE *apRLIDeviceHandle, int32 startAddress, uint32 aNbyteRead, uint8 *apReadBuffer)
This function reads from the device registers.
isf_devmsg.h defines the API definitions and types for the Intelligent Sensing (ISF) Device Messaging...
ci_response_enum
These are the CI errors provided to the host.
This file defines the configuration types and structures for the system communication channel...
isf_status_t isf_ci_stream_update_data(uint8 aDataSetID, uint16 aLength, uint16 aOffset, uint8 *apSrc)
This API updates the data of a dataset.
RLI_DEV_HANDLE * isf_rli_open(RLI_CHANNEL_HANDLE *apRLIChannelHandle, void *apSlaveInfo)
This function creates a RLI connection handle at a specified device address.
comm_Id_t dm_ChannelId_t
This typedef is a numeric channel identifier index into an array of channels in the system...
ci_response_t rli_ci_app_callback(ci_host_cmd_packet_t *pHostPacket, ci_app_resp_packet_t *pAppPacket)