Hi,
Is there a way to test under program control if I2CInitialize() has been issued?
There are enough problems dealing with I2C such as pullups, addresses, speed, hard or soft I2CInitialize
It would be good to know before starting any I2C commands if the software or hardware I2CInitialize has already been started. The program could then send out a error message if desired.
Thank you
Tim C
Detecting if I2C has been Initialized
Moderators: David Barker, Jerry Messina
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
The compiler won't be able to detect if it has been initialised or not, if that is what you mean.
If you are writing a module that uses I2C, you can call 'Initialize' from within the code section of the module to ensure it is called before the main program executes. However, you will probably need a few #options to enable the user to configure hardware I2C.
Personally, I think an explicit call to Initialize (or your modules Initialize) is probably a better idea in most cases.
If you are writing a module that uses I2C, you can call 'Initialize' from within the code section of the module to ensure it is called before the main program executes. However, you will probably need a few #options to enable the user to configure hardware I2C.
Personally, I think an explicit call to Initialize (or your modules Initialize) is probably a better idea in most cases.