I have some macro constants defined in a .c file and a .h file as follows:
#define LOCAL_L2_BASE_LV (0x00800000UL)
in .c file and
#define FPGA_PLI_FEEDBACK_OFFSET_LV_FREQUENCY (0x00007000UL)
in .h file
I would like to use these constants in a different header file. What is the best way to do so? My initial idea was to use extern in the header file I want to use the constants in, but is this valid?
Macros can not be made extern, they are not variables. They are simply textual replacements. To make macros available to other header, you need to include the header defining the macro.