AnsweredAssumed Answered

Peripheral initialized or not?

Question asked by Raghu Rajappa on Feb 20, 2019
Latest reply on Feb 20, 2019 by Peter Vlna

I am working with the MPC5745R SDK (provided by NXP). While using drivers, for example GPIO, if I want to write a value on a pin, I would use the function 'WritePin'. But as an application developer, when I use this function, how can I be sure the specified pin has already been configured and initialised? 

The question applies to other peripherals too. I would like to know if a peripheral is initialised prior to using the peripheral. There exists workarounds like using flags to keep track of the status of a pin or transceiver. But that means I need to write and maintain a lot of code. I would like to know if there exists registers that already keep track of this data, for this microcontroller. 


I was looking through the manual but could not find anything in particular. Could you please point me to some registers that track the state of the peripheral (whether initialised, whether output/input) ? I am currently looking through GPIO and CAN. But I am sure the question would easily apply to ADC or SPI or UART too.