[fpc-pascal] Assigning absolute record to variable
fpascal at brouwerij.homelinux.net
Tue May 8 22:41:19 CEST 2012
I hope I can make myself clear.
I'm making a driver to control an LCD with an STM32 microcontroller,
I want to make my driver re-usable, i.e. I want to be able to pass the
needed RST- and CS-pins only one time, so I don't need to modify the
code in multiple places if the needed pins change.
Since a pin-port is defined this way :
PortA: TPortRegisters absolute (APB2Base+$0800);
I thought of defining a record :
RSTPin : record
GPIO_Port : ^TPortRegisters;
GPIO_Pin : word;
and assigned like this :
This does not work, the pins are not initialised when used with the
initialising function :
does not work while
What am I missing ? I'm out of ideas at the moment.
Thanks for any help you can give,
More information about the fpc-pascal