Hi,

i'm currently working on lpc13xx support. I have started writing
some code years ago but never really tried to commit it back to the
official repo. But some days ago, i started a project based on an old
lpc1343 based board and decided to update my old code so it fits into
the current state of libopencm3. My question is about naming register
defines. The HACKING file sugests that names should be following
the convention SUBSYSTEM_REGISTER_BIT. At the moment i'm reworking my
old defines of what the datasheet calls 'system control block
registers'.
Following the convention, i would e.g. end up with something like 
SYSCTRL_WDTOSCCTRL_FREQSEL which looks a bit cluttered to me. By
looking at the stm32-defines it seems like they are not exactly
following this convention. E.g. TIM1_CCER is just the plain register
name without a prepended subsystem(something like TIMER_). One could
argue, that TIM1 in TIM1_CCER already is the subsystem-name. So i guess
i only have to prepend the 'subsystem'-name in case it is not already
included in the register-name? Or are the defines of the stm32 just not
following the convention? Is there a good definition of what a
'subsystem'-name is? For example SYSCTRL is never realy mentioned in
the datasheet. In general the section in the datasheet is called 'System
configuration' but the mentioned register are listet as 'system control
block' under the 'system configuration'-section. There are more
registers under the section 'system configuration', should i prefix
them with something like SYSCFG_ ?

I apologize for all those questions, but i thought it would be a good
idea to ask before choosing wrong names, as it is not that much fun
refactoring them afterwards.

Greting,

Ingo

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
libopencm3-devel mailing list
libopencm3-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel

Reply via email to