11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

31mkhdr - C/C++ header file generatorThe command line program mkhdr can generate a C/C++ header file from acrossworks memory map file.For each register definition in the memory map file a corresponding #define isgenerated in the header file. The #define is named the same as the register name andis defined as a volatile pointer to the address. The type of the pointer is derived fromthe size of the register. A 4 byte register will generate an unsigned long pointer. A 2byte register will generate an unsigned short pointer. A 1 byte register will generatean unsigned char pointer.If a register definition in the memory map file has bitfields then #defines aregenerated <strong>for</strong> each bitfield. Each bitfield will have two #defines generated, onerepresenting the mask and one defining the start bit position. The bitfield #definenames are <strong>for</strong>med by prepending the register name to the bitfield name. The maskdefinition has _MASK appended to it and the start definition has _BIT appended toit.For example given the following definitions in the the file memorymap.xml....The command linemkhdr memorymap.xml memorymap.hWill generate the following definitions in the file memorymap.h.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!