Browse Source

efm32: shortened doxygen names and grouped them per chip family

pull/47/head
chrysn 13 years ago
parent
commit
bc1bff477b
  1. 14
      include/libopencm3/efm32/tinygecko/README.dox
  2. 54
      include/libopencm3/efm32/tinygecko/cmu.h
  3. 2
      include/libopencm3/efm32/tinygecko/cmu.yaml
  4. 2
      include/libopencm3/efm32/tinygecko/emu.convenienceheaders
  5. 15
      include/libopencm3/efm32/tinygecko/emu.h
  6. 2
      include/libopencm3/efm32/tinygecko/emu.yaml
  7. 17
      include/libopencm3/efm32/tinygecko/generate.py
  8. 33
      include/libopencm3/efm32/tinygecko/gpio.h

14
include/libopencm3/efm32/tinygecko/README.dox

@ -0,0 +1,14 @@
/**
@brief EFM32 Tiny Gecko headers
This directory contains all headers specific to the Tiny Gecko family of the
Energy Micro EFM32 series.
The individual peripherials described here all include hints at where the
information was taken from, but usually it stems from
d0034_efm32tg_reference_manual.pdf.
@defgroup EFM32TG EFM32 Tiny Gecko
*/

54
include/libopencm3/efm32/tinygecko/cmu.h

@ -26,7 +26,8 @@
* This corresponds to the description in d0034_efm32tg_reference_manual.pdf
* section 11.
*
* @defgroup EFM32TG_CMU EFM32 Tiny Gecko CMU
* @ingroup EFM32TG
* @defgroup EFM32TG_CMU CMU (Clock Management Unit)
* @{
*/
@ -38,13 +39,13 @@
/** Register definitions and register value definitions for the CMU subsystem
*
* @defgroup EFM32TG_CMU_regsandvals EFM32 Tiny Gecko CMU registers and values
* @defgroup EFM32TG_CMU_regsandvals CMU registers and values
* @{
*/
/** These definitions reflect d0034_efm32tg_reference_manual.pdf section 11.4
*
* @defgroup EFM32TG_CMU_registers EFM32 Tiny Gecko CMU registers
* @defgroup EFM32TG_CMU_registers CMU registers
* @{
*/
@ -83,7 +84,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.1 for definitions.
*
* @defgroup EFM32TG_CMU_CTRL_bits EFM32 Tiny Gecko CMU CTRL bits
* @defgroup EFM32TG_CMU_CTRL_bits CMU CTRL bits
* @{
*/
@ -135,8 +136,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.2 for definitions.
*
* @defgroup EFM32TG_CMU_HFCORECLKDIV_values EFM32 Tiny Gecko CMU HFCORECLKDIV
* values
* @defgroup EFM32TG_CMU_HFCORECLKDIV_values CMU HFCORECLKDIV values
* @{
*/
@ -157,7 +157,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.3 for definitions.
*
* @defgroup EFM32TG_CMU_HFPERCLKDIV_bits EFM32 Tiny Gecko CMU HFPERCLKDIV bits
* @defgroup EFM32TG_CMU_HFPERCLKDIV_bits CMU HFPERCLKDIV bits
* @{
*/
@ -179,7 +179,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.4 for definitions.
*
* @defgroup EFM32TG_CMU_HFRCOCTRL_bits EFM32 Tiny Gecko CMU HFRCOCTRL bits
* @defgroup EFM32TG_CMU_HFRCOCTRL_bits CMU HFRCOCTRL bits
* @{
*/
@ -198,8 +198,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.6 for definitions.
*
* @defgroup EFM32TG_CMU_AUXHFRCOCTRL_bits EFM32 Tiny Gecko CMU AUXHFRCOCTRL
* bits
* @defgroup EFM32TG_CMU_AUXHFRCOCTRL_bits CMU AUXHFRCOCTRL bits
* @{
*/
@ -217,7 +216,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.6.7 for definitions.
*
* @defgroup EFM32TG_CMU_CALCTRL_bits EFM32 Tiny Gecko CMU CALCTRL bits
* @defgroup EFM32TG_CMU_CALCTRL_bits CMU CALCTRL bits
* @{
*/
@ -240,7 +239,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.9 for definitions.
*
* @defgroup EFM32TG_CMU_OSCENCMD_bits EFM32 Tiny Gecko CMU OSCENCMD bits
* @defgroup EFM32TG_CMU_OSCENCMD_bits CMU OSCENCMD bits
* @{
*/
@ -261,7 +260,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.10 for definitions.
*
* @defgroup EFM32TG_CMU_CMD_bits EFM32 Tiny Gecko CMU CMD bits
* @defgroup EFM32TG_CMU_CMD_bits CMU CMD bits
* @{
*/
@ -278,7 +277,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.11 for definitions.
*
* @defgroup EFM32TG_CMU_LFCLKSEL_bits EFM32 Tiny Gecko CMU LFCLKSEL bits
* @defgroup EFM32TG_CMU_LFCLKSEL_bits CMU LFCLKSEL bits
* @{
*/
@ -301,7 +300,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.12 for definitions.
*
* @defgroup EFM32TG_CMU_STATUS_bits EFM32 Tiny Gecko CMU STATUS bits
* @defgroup EFM32TG_CMU_STATUS_bits CMU STATUS bits
* @{
*/
@ -327,8 +326,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.17 for definitions.
*
* @defgroup EFM32TG_CMU_HFCORECLKEN0_bits EFM32 Tiny Gecko CMU HFCORECLKEN0
* bits
* @defgroup EFM32TG_CMU_HFCORECLKEN0_bits CMU HFCORECLKEN0 bits
* @{
*/
@ -342,7 +340,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.18 for definitions.
*
* @defgroup EFM32TG_CMU_HFPERCLKEN0_bits EFM32 Tiny Gecko CMU HFPERCLKEN0 bits
* @defgroup EFM32TG_CMU_HFPERCLKEN0_bits CMU HFPERCLKEN0 bits
* @{
*/
@ -365,7 +363,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.19 for definitions.
*
* @defgroup EFM32TG_CMU_SYNCBUSY_bits EFM32 Tiny Gecko CMU SYNCBUSY bits
* @defgroup EFM32TG_CMU_SYNCBUSY_bits CMU SYNCBUSY bits
* @{
*/
@ -380,7 +378,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.20 for definitions.
*
* @defgroup EFM32TG_CMU_FREEZE_bits EFM32 Tiny Gecko CMU FREEZE bits
* @defgroup EFM32TG_CMU_FREEZE_bits CMU FREEZE bits
* @{
*/
@ -393,7 +391,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.21 for definitions.
*
* @defgroup EFM32TG_CMU_LFACLKEN0_bits EFM32 Tiny Gecko CMU LFACLKEN0 bits
* @defgroup EFM32TG_CMU_LFACLKEN0_bits CMU LFACLKEN0 bits
* @{
*/
@ -408,7 +406,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.22 for definitions.
*
* @defgroup EFM32TG_CMU_LFBCLKEN0_bits EFM32 Tiny Gecko CMU LFBCLKEN0 bits
* @defgroup EFM32TG_CMU_LFBCLKEN0_bits CMU LFBCLKEN0 bits
* @{
*/
@ -420,7 +418,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.23 for definitions.
*
* @defgroup EFM32TG_CMU_LFAPRESC0_bits EFM32 Tiny Gecko CMU LFAPRESC0 bits
* @defgroup EFM32TG_CMU_LFAPRESC0_bits CMU LFAPRESC0 bits
* @{
*/
@ -471,7 +469,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.24 for definitions.
*
* @defgroup EFM32TG_CMU_LFBPRESC0_bits EFM32 Tiny Gecko CMU LFBPRESC0 bits
* @defgroup EFM32TG_CMU_LFBPRESC0_bits CMU LFBPRESC0 bits
* @{
*/
@ -486,7 +484,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.25 for definitions.
*
* @defgroup EFM32TG_CMU_PCNTCTRL_bits EFM32 Tiny Gecko CMU PCNTCTRL bits
* @defgroup EFM32TG_CMU_PCNTCTRL_bits CMU PCNTCTRL bits
* @{
*/
@ -500,7 +498,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.26 for definitions.
*
* @defgroup EFM32TG_CMU_LCDCTRL_bits EFM32 Tiny Gecko CMU LCDCTRL bits
* @defgroup EFM32TG_CMU_LCDCTRL_bits CMU LCDCTRL bits
* @{
*/
@ -521,7 +519,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.27 for definitions.
*
* @defgroup EFM32TG_CMU_ROUTE_bits EFM32 Tiny Gecko CMU ROUTE bits
* @defgroup EFM32TG_CMU_ROUTE_bits CMU ROUTE bits
* @{
*/
@ -536,7 +534,7 @@
*
* See d0034_efm32tg_reference_manual.pdf section 11.5.28 for definitions.
*
* @defgroup EFM32TG_CMU_LOCK_values EFM32 Tiny Gecko CMU LOCK values
* @defgroup EFM32TG_CMU_LOCK_values CMU LOCK values
* @{
*/

2
include/libopencm3/efm32/tinygecko/cmu.yaml

@ -1,7 +1,7 @@
copyright: "2012 chrysn <chrysn@fsfe.org>"
license: lgpl-3+
ingroup: EFM32TG
shortdocname: EFM32TG_CMU
longdocname: EFM32 Tiny Gecko CMU
shortname: CMU
longname: Clock Management Unit
baseref: d0034_efm32tg_reference_manual.pdf section 11

2
include/libopencm3/efm32/tinygecko/emu.convenienceheaders

@ -4,7 +4,7 @@
*
* @todo Implement other sleep modes than EM1. Implement WFI vs WFE waits.
*
* @defgroup EFM32TG_EMU_convenience EFM32 Tiny Gecko EMU convenience functions
* @defgroup EFM32TG_EMU_convenience EMU convenience functions
* @{
*/

15
include/libopencm3/efm32/tinygecko/emu.h

@ -26,7 +26,8 @@
* This corresponds to the description in d0034_efm32tg_reference_manual.pdf
* section 10.
*
* @defgroup EFM32TG_EMU EFM32 Tiny Gecko EMU
* @ingroup EFM32TG
* @defgroup EFM32TG_EMU EMU (Energy Management Unit)
* @{
*/
@ -38,13 +39,13 @@
/** Register definitions and register value definitions for the EMU subsystem
*
* @defgroup EFM32TG_EMU_regsandvals EFM32 Tiny Gecko EMU registers and values
* @defgroup EFM32TG_EMU_regsandvals EMU registers and values
* @{
*/
/** These definitions reflect d0034_efm32tg_reference_manual.pdf section 10.4
*
* @defgroup EFM32TG_EMU_registers EFM32 Tiny Gecko EMU registers
* @defgroup EFM32TG_EMU_registers EMU registers
* @{
*/
@ -59,7 +60,7 @@
* See d0034_efm32tg_reference_manual.pdf section 10.5.1 for definitions, and
* 10.3.2 for details (especially on why EM4CTRL_TWO and _THREE are defined).
*
* @defgroup EFM32TG_EMU_CTRL_bits EFM32 Tiny Gecko EMU CTRL bits
* @defgroup EFM32TG_EMU_CTRL_bits EMU CTRL bits
* @{
*/
@ -75,7 +76,7 @@
* See d0034_efm32tg_reference_manual.pdf section 10.5.2 for definitions. There
* seems not to be another mention of it.
*
* @defgroup EFM32TG_EMU_LOCK_values EFM32 Tiny Gecko EMU LOCK values
* @defgroup EFM32TG_EMU_LOCK_values EMU LOCK values
* @{
*/
@ -91,7 +92,7 @@
* See d0034_efm32tg_reference_manual.pdf section 10.5.3 for definitions, and
* 9.5.3 for details.
*
* @defgroup EFM32TG_EMU_AUXCTRL_bits EFM32 Tiny Gecko EMU AUXCTRL bits
* @defgroup EFM32TG_EMU_AUXCTRL_bits EMU AUXCTRL bits
* @{
*/
@ -107,7 +108,7 @@
*
* @todo Implement other sleep modes than EM1. Implement WFI vs WFE waits.
*
* @defgroup EFM32TG_EMU_convenience EFM32 Tiny Gecko EMU convenience functions
* @defgroup EFM32TG_EMU_convenience EMU convenience functions
* @{
*/

2
include/libopencm3/efm32/tinygecko/emu.yaml

@ -1,7 +1,7 @@
copyright: "2012 chrysn <chrysn@fsfe.org>"
license: lgpl-3+
ingroup: EFM32TG
shortdocname: EFM32TG_EMU
longdocname: EFM32 Tiny Gecko EMU
shortname: EMU
longname: Energy Management Unit
baseref: d0034_efm32tg_reference_manual.pdf section 10

17
include/libopencm3/efm32/tinygecko/generate.py

@ -6,13 +6,18 @@ import textwrap
def commentblock(*textblocks, **formatargs):
ret = []
nowrapcommands = set("@defgroup")
ret.extend(textwrap.wrap(textblocks[0].format(**formatargs), 80, initial_indent="/** ", subsequent_indent=" * "))
last_block_was_at = textblocks[0].startswith('@')
for b in textblocks[1:]:
formatted = b.format(**formatargs)
if not (last_block_was_at and b.startswith('@')):
ret.append(" *")
# FIXME: some blocks don't like being wrapped, eg @defgroup
ret.extend(textwrap.wrap(b.format(**formatargs), 80, initial_indent=" * ", subsequent_indent=" * "))
if any(b.startswith(c) for c in nowrapcommands):
ret.append(" * " + formatted)
else:
ret.extend(textwrap.wrap(formatted, 80, initial_indent=" * ", subsequent_indent=" * "))
last_block_was_at = b.startswith('@')
return "\n".join(ret) + "\n */\n"
@ -49,17 +54,17 @@ def yaml2h(filenamebase):
nl()
wc("@file", "@see {shortdocname}")
nl()
wc("Definitions for the {shortname} subsystem ({longname}).", "This corresponds to the description in {baseref}.", "@defgroup {shortdocname} {longdocname}", "@{{")
wc("Definitions for the {shortname} subsystem ({longname}).", "This corresponds to the description in {baseref}.", "@ingroup {ingroup}", "@defgroup {shortdocname} {shortname} ({longname})", "@{{")
nl()
outfile.write("#ifndef {includeguard}\n#define {includeguard}\n".format(**data))
nl()
outfile.write("#include <libopencm3/cm3/common.h>\n#include <libopencm3/efm32/memorymap.h>\n")
nl()
wc("Register definitions and register value definitions for the {shortname} subsystem", "@defgroup {shortdocname}_regsandvals {longdocname} registers and values", "@{{")
wc("Register definitions and register value definitions for the {shortname} subsystem", "@defgroup {shortdocname}_regsandvals {shortname} registers and values", "@{{")
nl()
regs = data['registers']
wc("These definitions reflect {baseref}{registers_baserefext}", "@defgroup {shortdocname}_registers {longdocname} registers", "@{{")
wc("These definitions reflect {baseref}{registers_baserefext}", "@defgroup {shortdocname}_registers {shortname} registers", "@{{")
nl()
for regdata in regs:
define("%s_%s"%(data['shortname'], regdata['name']), "MMIO32(%s_BASE + %#.003x)"%(data['shortname'], regdata['offset']), "@see %s_%s_%s"%(data['shortdocname'], regdata['name'], 'values' if 'values' in regdata else 'bits'))
@ -72,7 +77,7 @@ def yaml2h(filenamebase):
if not has_bits and not has_values:
continue
wc("%s for the {shortname}_{name} register"%("Bit states" if has_bits else "Values"), "See {baseref}{definition_baserefext} for definitions"+regdata.get("details", "."), '@defgroup {shortdocname}_{name}_%s {longdocname} {name} %s'%(('bits' if has_bits else 'values',)*2), '@{{', **regdata)
wc("%s for the {shortname}_{name} register"%("Bit states" if has_bits else "Values"), "See {baseref}{definition_baserefext} for definitions"+regdata.get("details", "."), '@defgroup {shortdocname}_{name}_%s {shortname} {name} %s'%(('bits' if has_bits else 'values',)*2), '@{{', **regdata)
nl()
if has_bits:

33
include/libopencm3/efm32/tinygecko/gpio.h

@ -26,7 +26,8 @@
* This corresponds to the description in d0034_efm32tg_reference_manual.pdf
* section 28.
*
* @defgroup EFM32TG_GPIO EFM32 Tiny Gecko GPIO
* @ingroup EFM32TG
* @defgroup EFM32TG_GPIO GPIO (General Purpose Input Output)
* @{
*/
@ -38,7 +39,7 @@
/** Register definitions and register value definitions for the GPIO subsystem
*
* @defgroup EFM32TG_GPIO_regsandvals EFM32 Tiny Gecko GPIO registers and values
* @defgroup EFM32TG_GPIO_regsandvals GPIO registers and values
* @{
*/
@ -49,7 +50,7 @@
*
* @todo This section could profit from bit-banding.
*
* @defgroup EFM32TG_GPIO_registers EFM32 Tiny Gecko GPIO registers
* @defgroup EFM32TG_GPIO_registers GPIO registers
* @{
*/
#define GPIO_Px_CTRL(port) MMIO32(port + 0x000) /**< @see EFM32TG_GPIO_Px_CTRL_bits */
@ -154,7 +155,7 @@
* GPIO_Px_PINLOCKN, GPIO_Px_EXTIRISE, GPIO_Px_EXTIFALL, GPIO_IEN, GPIO_IF,
* GPIO_IFS, and GPIO_IFC registers.
*
* @defgroup EFM32TG_GPIO_pinnumberbits EFM32 Tiny Gecko GPIO pin number bits
* @defgroup EFM32TG_GPIO_pinnumberbits GPIO pin number bits
* @{
*/
@ -183,7 +184,7 @@
* They are named as in d0034_efm32tg_reference_manual.pdf's section
* 28.5.1.
*
* @defgroup EFM32TG_GPIO_Px_CTRL_bits EFM32 Tiny Gecko GPIO Px CTRL bits
* @defgroup EFM32TG_GPIO_Px_CTRL_bits GPIO Px CTRL bits
* @{
*/
@ -212,7 +213,7 @@
* 28.5.2/28.5.3. For explanations of what they really do, rather see section
* 28.3.1.
*
* @defgroup EFM32TG_GPIO_MODE_values EFM32 Tiny Gecko GPIO MODE values
* @defgroup EFM32TG_GPIO_MODE_values GPIO MODE values
* @{
*/
@ -248,7 +249,7 @@
* 28.5.10/28.5.11. For explanations of what they do, rather see section
* 28.3.5.
*
* @defgroup EFM32TG_GPIO_EXTIP_values EFM32 Tiny Gecko GPIO EXTIPSEL values
* @defgroup EFM32TG_GPIO_EXTIP_values GPIO EXTIPSEL values
* @{
*/
@ -266,7 +267,7 @@
* See d0034_efm32tg_reference_manual.pdf section 28.5.18 for definitions, and
* 28.3.4.1 for explanations.
*
* @defgroup EFM32TG_GPIO_ROUTE_bits EFM32 Tiny Gecko GPIO ROUTE bits
* @defgroup EFM32TG_GPIO_ROUTE_bits GPIO ROUTE bits
* @{
*/
@ -287,7 +288,7 @@
* See d0034_efm32tg_reference_manual.pdf section 28.5.19 for definitions, and
* 28.3.7 for details.
*
* @defgroup EFM32TG_GPIO_INSENSE_bits EFM32 Tiny Gecko GPIO INSENSE bits
* @defgroup EFM32TG_GPIO_INSENSE_bits GPIO INSENSE bits
* @{
*/
@ -301,7 +302,7 @@
* See d0034_efm32tg_reference_manual.pdf section 28.5.20 for definitions, and
* 28.3.1.1 for explanations.
*
* @defgroup EFM32TG_GPIO_LOCK_values EFM32 Tiny Gecko GPIO LOCK bits
* @defgroup EFM32TG_GPIO_LOCK_values GPIO LOCK bits
* @{
*/
@ -317,7 +318,7 @@
* See d0034_efm32tg_reference_manual.pdf section 28.5.21 for definitions, and
* 28.3.4 for explanations.
*
* @defgroup EFM32TG_GPIO_CTRL_bits EFM32 Tiny Gecko GPIO CTRL bits
* @defgroup EFM32TG_GPIO_CTRL_bits GPIO CTRL bits
* @{
*/
@ -331,7 +332,7 @@
* figure 28.5 in case you wonder if that register is mentioned anywhere else
* at all.
*
* @defgroup EFM32TG_GPIO_CMD_bits EFM32 Tiny Gecko GPIO CMD bits
* @defgroup EFM32TG_GPIO_CMD_bits GPIO CMD bits
* @{
*/
@ -344,7 +345,7 @@
* See d0034_efm32tg_reference_manual.pdf section 28.5.23 for definitions, and
* 28.3.2 for explanations.
*
* @defgroup EFM32TG_GPIO_EM4WUEN_bits EFM32 Tiny Gecko GPIO EM4WUEN bits
* @defgroup EFM32TG_GPIO_EM4WUEN_bits GPIO EM4WUEN bits
* @{
*/
@ -362,7 +363,7 @@
* See d0034_efm32tg_reference_manual.pdf section 28.5.24 for definitions, and
* 28.3.2 for explanations.
*
* @defgroup EFM32TG_GPIO_EM4WUPOL_bits EFM32 Tiny Gecko GPIO EM4WUPOL bits
* @defgroup EFM32TG_GPIO_EM4WUPOL_bits GPIO EM4WUPOL bits
* @{
*/
@ -380,7 +381,7 @@
* See d0034_efm32tg_reference_manual.pdf section 28.5.25 for definitions, and
* 28.3.2 for explanations.
*
* @defgroup EFM32TG_GPIO_EM4WUCAUSE_bits EFM32 Tiny Gecko GPIO EM4WUCAUSE bits
* @defgroup EFM32TG_GPIO_EM4WUCAUSE_bits GPIO EM4WUCAUSE bits
* @{
*/
@ -408,7 +409,7 @@
*
* @todo Implement all the non-trivial but useful convenience functions.
*
* @defgroup EFM32TG_GPIO_convenience EFM32 Tiny Gecko GPIO convenience functions
* @defgroup EFM32TG_GPIO_convenience GPIO convenience functions
* @{
*/

Loading…
Cancel
Save