I am working on a microcontroller project in C. The main.c file includes a header defining all of the registers as structures and chars. Unfortunately they name the registers unmeaning-full names like PORTA. Is it possible to rename the structures and variable defined in the header file to something more meaningful in my main file?
So instead of PORTA I can call it OUT without modifying the header file where it was defined.
Promoting comment to answer:
The easiest way I can think of is to just use macros:
And these don’t need to be in the header.
EDIT :
If the original names are actually names of variables (rather than types), then this is the way to go since the typedef method will not work.