Porting of the host application
Copyright IXXAT Automation GmbH
45
IEM Manual, 1.5
cation. If special memory access routines are necessary for your target, the
proper macros have to be adapted.
The following code snippet is showing a platform independent request / re-
sponse implementation.
COM_e_ERROR e_ret = COM_k_OK;
COM_t_CMD_REQUEST s_cmd;
COM_t_CMD_RESPONSE s_response;
COM_t_CREATE….. s_createCmd;
UINT8 i;
/* create request, please pay attention to the byte orer and use memory
access macros */
SETUINT32(&s_cmd.dw_command,0, COM_k_CREATE);
/* fill in body, please pay attention to the byte order and use memory
access macros */
SETUINT16(&s_createCmd.w_type,0,APP_as_MapTable[i].w_type);
SETUINT16(&s_createCmd.w_size,0,APP_as_MapTable[i].w_size);
SETUINT32(&s_createCmd.dw_offset,0,APP_as_MapTable[i].dw_offset);
SETUINT32(&s_createCmd.dw_attributes,0,APP_as_MapTable[i].dw_attributes);
…
/* further initialization */
…
MEMCPY((PVOID)&s_cmd.ab_comData[0],(PVOID)&s_createCmd,sizeof(COM_t_CREATE));
e_ret = EMI_cmdChannelConfigure(APP_td_BrdRef,&s_cmd,TRUE,&s_response);
if (e_ret != COM_k_OK)
{
return e_ret;
}
3.2.2 Config.h
All following configuration defines can be set by defining either with
CFG_k_FEAT_ENABLE or CFG_k_FEAT_DISABLE
/** IEM_cfg_EMI_DEBUG:
activate this define to enable debug messages in the EMI functions.
Allowed values: CFG_k_FEAT_ENABLE, CFG_k_FEAT_DISABLE
*/
#define IEM_cfg_EMI_DEBUG CFG_k_FEAT_ENABLE
/** IEM_cfg_SHM_DIRECT_ACCESS:
This define has to be activated (CFG_k_FEAT_ENABLE) in order to use the
direct access to shared memory (a host CPU is physically connected to
the shared memory). If setting the define to CFG_k_FEAT_DISABLE the serial
peripheral interface (SPI) is used instead to access the shared memory.
Allowed values: CFG_k_FEAT_ENABLE, CFG_k_FEAT_DISABLE