aboutsummaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorUwe Hermann2010-03-05 23:52:22 +0100
committerUwe Hermann2010-03-05 23:52:22 +0100
commitdd0548ee2b2577089ec86c2eed64e1a022a84e7f (patch)
treeb6d04fafbdacdc8d13943bcf00f9839c89e385be /HACKING
parentb3618ffa3dfc555c67393cf2240ffdef4ed81dfc (diff)
Add some development guidelines and notes.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING30
1 files changed, 30 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index a553674..6a2a877 100644
--- a/HACKING
+++ b/HACKING
@@ -10,3 +10,33 @@ http://lxr.linux.no/linux/Documentation/CodingStyle for details.
Please use the same style for any code contributions, thanks!
+
+Development guidelines
+----------------------
+
+ - Every new file added must have the usual license header, see the
+ existing files for examples.
+
+ - In general, please try to keep the register and bit naming as close
+ as possible to the official ST datasheets. Among other reasons, this
+ makes it easier for users to find what they're looking for in the
+ datasheets, programming manuals, and application notes.
+
+ - All register definitions should follow the following naming conventions:
+
+ - The #define names should be all-caps, parts are separated by
+ an underscore.
+
+ - The name should be of the form SUBSYSTEM_REGISTER_BIT, e.g.
+ ADC_CR2_DMA, where ADC is the subsystem name, CR2 is the register NAME,
+ and DMA is the name of the bit in the register that is defined.
+
+ - All subsystem-specific function names should be prefixed with the
+ subsystem name. For example, gpio_set_mode() or rcc_osc_on().
+
+ - Please consistently use the short form types from <libopenstm32/common.h>,
+ e.g. u8, u16, u32, and so on.
+
+ - Variables that are used to store register values read from registers or
+ to be stored in a register should be named reg8, reg16, reg32 etc.
+