Getting started
Copyright IXXAT Automation GmbH
34
IEM Manual, 1.5
2.3.11.1 Preparation and setup
2.3.11.1.1 Selection of the module access
The access mode to the IEM needs to be selected before accessing the IEM.
To define the proper access mode (see 7.2 Hardware interface) the settings
defined in the
/src/src/target/<cpu name>/config.h
file and shall be re-
vised (see 3.2.2 Config.h).
Note:
The access mode to the IEM is defined at reset time and can only
be changed by executing a further reset of the IEM. Please refer
7.1.1.2.8.1 GPIO2NIOS1 - parallel interface/SPI access mode
2.3.11.1.2 Startup
From the
DemoStartup()
-function, you firstly have to initialize the module by
. To fetch information from the IEM (e.g. which Ether-
net protocol is available) the function
COM_e_ERROR DemoStartup(UINT8 b_resetMode)
{
COM_e_ERROR e_ret;
EMI_t_API_CONFIG s_config;
COM_t_BOARDINFO s_boardInfo;
UINT8 i,j;
COM_t_NETWORKINFO s_networkInfo;
DBG_PRINTF(("EMI initialization\n"));
/* initialize service queues (Indication/Confirmation, Request/Response) */
APP_IndConfInitialize();
APP_ReqRespInitialize();
// initialize IEM via BCC
s_config.o_manual_segmentation = FALSE;
s_config.w_watchdog_period = APP_cfg_WATCHDOG;
APP_d_BrdRef = EMI_cmdBrdInit(0, &s_config);
if (APP_d_BrdRef == -1)
{
return COM_k_ERROR;
}
e_ret = EMI_cmdBrdInfoReq(APP_d_BrdRef, &s_boardInfo);
if (e_ret != COM_k_OK)
{
return e_ret;
}
/* Decode the type of the IEM protocol (see coding of the field "dw_protocol"