Trying to convert some old code to a library for release.
I am using 2 digital IO's to bit bash a particular interface so i need to instantiate a clss and pass the name of 2 pins in the class creator. something like
device xyz(p8,p9);
should pass pins p8 and p9 to the library and my library code should then assign p8 and p9 to two signals.
Internally all my old code uses CLOCK and DATA as the two lines and I need to do things like set CLOCK high, read DATA etc with the effect that where my code says set CLOCK high I am setting say p8 high and where I say read DATA i am reading p9.
i have looked at the example on building a library which conveniently uses a digital IO to toggel an LED but the preprocessor stuff has me confussed!
Would appreciate a pointer to a tutorial or documentation on the preprocessor or just a plain old hand in getting my library converted.
Trying to convert some old code to a library for release.
I am using 2 digital IO's to bit bash a particular interface so i need to instantiate a clss and pass the name of 2 pins in the class creator. something like
device xyz(p8,p9);
should pass pins p8 and p9 to the library and my library code should then assign p8 and p9 to two signals.
Internally all my old code uses CLOCK and DATA as the two lines and I need to do things like set CLOCK high, read DATA etc with the effect that where my code says set CLOCK high I am setting say p8 high and where I say read DATA i am reading p9.
i have looked at the example on building a library which conveniently uses a digital IO to toggel an LED but the preprocessor stuff has me confussed!
Would appreciate a pointer to a tutorial or documentation on the preprocessor or just a plain old hand in getting my library converted.