Content originally posted in LPCWare by StephenHawkings on Sat Jul 16 05:01:29 MST 2011
From my point of view, it's important to get a readable code. And in fact,
"SSP0IMSC_RECEIVE_OVERRUN_INTERRUPT_ENABLED" is for me more readable than "RORIM".
Or another example:
//8 bits, no Parity, 1 Stop bit
LPC_UART->LCR = 0x83; compared with
//Define UART 8 Bits, No Parity, 2 Stop Bits
LPC_UART->LCR |= U0LCR_8BIT_CHARACTER_SELECT | U0LCR_2_STOP_BITS;
Which one is more readable; also for professionals?
My includes are written for the aspect, that someone does not write code every day, and doesn't want to read always the UM. So my includes contain the register descriptions as in the UM. To keep the UM always beside, is not necessary then. And if it's very rarely necessary to look up something in the UM, the search engine in PDF reader will find "U0LCR" quickly.
3 engineers, 4 different ideas. :-)
Best regards!
SH