Hallo,
How can I read the contents of the "NETX_DPM_ARM_IO_DATA0" ?
For exampe:
1) Drv_HifPioGetInputs(NETX_DPM_ARM_IO_DATA0, &Data)
or:
2)
Data = PEEK(NETX_DPM_ARM_IO_DATA0)
best regards
Abslimo
what could be the cause of an error in the function "Drv_HifPioIdentifyHifPio(“HOSTIO”,0,&hHifPio)" ?
I have written this code:
Config_netX:
/* ************************************************************ * Definition of the Host-PIO Instances ************************************************************ */STATIC CONST FAR RX_HIFPIO_SET_T atrXHif[] = {
{
{"HOSTIO",RX_PERIPHERAL_TYPE_HIFPIO,0},
0x00000000, // Configure HIF-PIO 32 to 63 to be standard I/O
0x40000000, // Configure HIF-PIO 64 to 84 to be standard I/O
0xFFFFFFFF, // Configure HIF-PIO 32 to 63 Output-Driver to be outputs
0x001FFFFF, // Configure HIF-PIO 64 to 84 Output-Driver to be outputs
0x40000000, // Configure the I/O Mode
0x00000000, // Configure Arm specific configuration, no relevance
},
};/*
TLR_RESULT TaskResource_Pulsrate_InitRemote(PULSRATE_RSC_T FAR* ptRsc, TLR_VOID FAR* pvInit)
{
TLR_RESULT eRslt;
UINT ulVal, ulKey;
RX_HANDLE hHifPio;eRslt = TLR_S_OK;
// switch interface to pio
ulVal = PEEK(NETX_IO_CFG);
ulVal &= ~MSK_NETX_IO_CFG_if_select_n;
ulKey = PEEK(NETX_IO_CFG_ACCESS_KEY);
POKE(NETX_IO_CFG_ACCESS_KEY, ulKey);
POKE(NETX_IO_CFG, ulVal);// Get the Handle to a HIF PIO named ‘HOSTIO’
if((eRslt = Drv_HifPioIdentifyHifPio("HOSTIO",0,&hHifPio))!=TLR_S_OK)
{
goto leave;
}........
leave:
......
best regards
Abslimo
Hilscher Gesellschaft fuer Systemautomation mbH
Hi,
what about:
/* HIF PIO Handle */ RX_HANDLE hHostIo;/* Get memory */
erXRes = rX_MemAllocateMemory(&hHostIo,DRV_HIFPIO_SIZE);/* Create the GPIO Object now */
erXRes = Drv_HifPioCreateHifPio(hHostIo, &hHostIo[0]);
Hilscher Gesellschaft für Systemautomation mbH
Or alternatively enter the HifPio Driver into the PostCfg structure (config.c)
STATIC CONST FAR RX_DRIVER_PERIPHERAL_CONFIG_T atrXDrvCfgPost[] = {
{DrvHifPioInit, RX_PERIPHERAL_TYPE_HIFPIO, atrXHif, MAX_CNT(atrXHif)},
....
}
which implicitely calls Drv_HifPioCreate on all defined structures.
Regards
MT
Andreas Jacob
Hilscher Gesellschaft fuer Systemautomation mbH
Hi Abslimo,
you can do both ways. But please keep in your mind, that the DRV_xxx funct5ions needs a valid handle.
Your example code must look like this:
RX_RESULT erXRes; RX_HANDLE hHifPio; DRV_HIFPIO_DATA_T tData; /* Get the Handle to a HIF PIO named ‘HOSTIO’ */ erXRes = Drv_HifPioIdentifyHifPio(“HOSTIO”,0,&hHifPio); if (erXRes != RX_OK) { error handling }
/* Initialize the HIF PIO */
erXRes = Drv_HifPioInitializeHifPio(hHifPio)
if (erXRes != RX_OK)
{
error handling
}
/* Get the current input values */
erXRes = Drv_HifPioGetInputs(hHifPio, &tData);
if (erXRes != RX_OK)
{
error handling
}
Or you are doing this with your macro stuff peek and poke
Data = PEEK(Registeraddress)