I am new to Embedded Programming, taking courses on it. And working with ATSTK600.
I am looking for some help on "how to write header files for Devices". Well, to be specific, what are the standard to be followed while writing header files like naming a register, etc (how to create .h & include, that I know).
Recently, I got an assignment to create a header file which I did, was on right track with some mistakes to be corrected before re-submission. While defining USART (made a mistake as this is very new to me)
#define USART_RX $0032
[which professor said is wrong because of $ sign #define will not work]. So is the following definition correct?
#define USART0_RX 32
#define USART0_UDRE 34
#define USART0_TX 36
Another thing is I defined ports as following, is this correct naming convention?
#define I_PINS_PORTA 0x20
#define DD_PORTA 0x21
#define DATA_PORTA 0x22
Well, somewhere I read the proper naming convention is #define BASE_ADDR_PORTA 0x20
but then what should be used for DD_PORTA
& I_PINS_PORTA
?
I was looking for some help on this over the web & came across this forum.
P.S. AM using C as a programming language.