Hi,
We are using MPC5777C. S32DS v1.2.
We want to make ETPUA4 pin 118 as an input.
We are using etpu GPIO code generated from etpu function selector as a reference.
We have managed to make ETPUA4 in output mode & able to make it high & low.
But when we confugure it in input mode. We are not able to read the pin status.
fs_etpu_init( my_etpu_config, (uint32_t *)etpu_code, sizeof(etpu_code), \
(uint32_t *)etpu_globals, sizeof(etpu_globals));
my_system_etpu_start();
SIU.PCR[118].B.IBE = 1; // ETPUA4 as an input pin
SIU.PCR[118].B.PA = 1; // primary function as ETPUA4
fs_etpu_gpio_init(4,FS_ETPU_PRIORITY_HIGH);
fs_etpu_gpio_input_immed(4);
if(eTPU->CHAN[4].SCR.B.IPS==1) // read status register
{
SIU.GPDO[154].B.PDOn = 1; // USER LED OFF
}
else
{
SIU.GPDO[154].B.PDOn = 0; // USER led ON
}
Above is the code that we are using to read the pin status.
Please suggest if anything is missing.
Thanks.
Rahul.