/* Copyright 2013 The MathWorks, Inc. */ /* * File: xilcomms_wrapper.h * * C-Wrapper APIs around RTIOStreamCS * */ #ifndef __RTIOSTREAMCS_WRAPPER_H__ #define __RTIOSTREAMCS_WRAPPER_H__ #include "rtwtypes.h" #include #ifndef EXTERN_C #ifdef __cplusplus /* support C++ call sites */ #define EXTERN_C extern "C" #else /* support C call sites */ #define EXTERN_C extern #endif #endif #ifdef CS_SUPPORTS_WORD_ADDRESSABLE_TARGETS #ifdef HOST_WORD_ADDRESSABLE_TESTING /* rtIOStream will handle data in single byte chunks * * uint8_T can be > 8-bits for certain portable word sizes * cases (e.g. C2000) so use native type instead */ typedef unsigned char IOUnit_T; #else /* HOST_WORD_ADDRESSABLE_TESTING */ /* rtIOStream will handle data in MemUnit_T size chunks */ typedef MemUnit_T IOUnit_T; #endif #else /* CS_SUPPORTS_WORD_ADDRESSABLE_TARGETS */ /* xil comms will handle data in uint8_T size chunks */ typedef uint8_T IOUnit_T; #endif /* application ids */ #define XIL_APPLICATION_ID 1 #define CODE_INSTR_APPLICATION_ID 2 /* Create xil comms */ EXTERN_C boolean_T xilCommsCreate( void** const ppRTIOStreamCS, const int argc, void * argv[]); /* Destroy xil comms */ EXTERN_C boolean_T xilCommsDestroy( void* const pRTIOStreamCS); /* Receive one buffer and dispatch to owning application */ EXTERN_C boolean_T xilCommsRun( void* const pRTIOStreamCS); /* send a buffer */ EXTERN_C boolean_T xilCommsEnqueue( void* const pRTIOStreamCS, void* const pBuf, const uint8_T appId, const uint16_T dataSize); /* Allocate buffer to be used by XIL service */ EXTERN_C boolean_T xilCommsAllocXILBuffer( void* const pRTIOStreamCS, void** ppBuf, const size_t dataSize); /* Allocate buffer to be used by code instrumentation service */ EXTERN_C boolean_T xilCommsAllocCodeInstrBuffer( void* const pRTIOStreamCS, void** ppBuf, const size_t dataSize); /* return pointer to XIL buffer data */ EXTERN_C IOUnit_T * xilCommsGetXILBufferDataPtr( void* const pBuf); /* return pointer to code instrumentation buffer data */ EXTERN_C IOUnit_T * xilCommsGetCodeInstrBufferDataPtr( void* const pBuf); #endif /* __RTIOSTREAMCS_WRAPPER_H__ */