diff --git a/include/libopencm3/efm32/tinygecko/cmu.h b/include/libopencm3/efm32/tinygecko/cmu.h index db0cbde7..80c959ff 100644 --- a/include/libopencm3/efm32/tinygecko/cmu.h +++ b/include/libopencm3/efm32/tinygecko/cmu.h @@ -53,10 +53,10 @@ #define CMU_HFCORECLKDIV MMIO32(CMU_BASE + 0x004) /**< @see EFM32TG_CMU_HFCORECLKDIV_values */ #define CMU_HFPERCLKDIV MMIO32(CMU_BASE + 0x008) /**< @see EFM32TG_CMU_HFPERCLKDIV_bits */ #define CMU_HFRCOCTRL MMIO32(CMU_BASE + 0x00c) /**< @see EFM32TG_CMU_HFRCOCTRL_bits */ -#define CMU_LFRCOCTRL MMIO32(CMU_BASE + 0x010) /**< @see EFM32TG_CMU_LFRCOCTRL_bits */ +#define CMU_LFRCOCTRL MMIO32(CMU_BASE + 0x010) #define CMU_AUXHFRCOCTRL MMIO32(CMU_BASE + 0x014) /**< @see EFM32TG_CMU_AUXHFRCOCTRL_bits */ #define CMU_CALCTRL MMIO32(CMU_BASE + 0x018) /**< @see EFM32TG_CMU_CALCTRL_bits */ -#define CMU_CALCNT MMIO32(CMU_BASE + 0x01c) /**< @see EFM32TG_CMU_CALCNT_bits */ +#define CMU_CALCNT MMIO32(CMU_BASE + 0x01c) #define CMU_OSCENCMD MMIO32(CMU_BASE + 0x020) /**< @see EFM32TG_CMU_OSCENCMD_bits */ #define CMU_CMD MMIO32(CMU_BASE + 0x024) /**< @see EFM32TG_CMU_CMD_bits */ #define CMU_LFCLKSEL MMIO32(CMU_BASE + 0x028) /**< @see EFM32TG_CMU_LFCLKSEL_bits */ @@ -128,7 +128,6 @@ #define CMU_CTRL_HFXOTIMEOUT_16KCYCLES (3<<9) #define CMU_CTRL_HFXOTIMEOUT_MASK (0x3<<9) #define CMU_CTRL_HFXOGLITCHDETEN (1<<7) -/* No values defined for the field HFXOBUFCUR */ #define CMU_CTRL_HFXOBUFCUR_MASK (0x3<<5) #define CMU_CTRL_HFXOBOOST_50PCENT (0<<2) #define CMU_CTRL_HFXOBOOST_70PCENT (1<<2) @@ -194,7 +193,6 @@ * @{ */ -/* No values defined for the field SUDELAY */ #define CMU_HFRCOCTRL_SUDELAY_MASK (0x1f<<12) #define CMU_HFRCOCTRL_BAND_1MHZ (0<<8) #define CMU_HFRCOCTRL_BAND_7MHZ (1<<8) @@ -203,7 +201,6 @@ #define CMU_HFRCOCTRL_BAND_21MHZ (4<<8) #define CMU_HFRCOCTRL_BAND_28MHZ (5<<8) #define CMU_HFRCOCTRL_BAND_MASK (0x7<<8) -/* No values defined for the field TUNING */ #define CMU_HFRCOCTRL_TUNING_MASK (0xff<<0) /** @} */ @@ -223,7 +220,6 @@ #define CMU_AUXHFRCOCTRL_BAND_28MHZ (6<<8) #define CMU_AUXHFRCOCTRL_BAND_21MHZ (7<<8) #define CMU_AUXHFRCOCTRL_BAND_MASK (0x7<<8) -/* No values defined for the field TUNING */ #define CMU_AUXHFRCOCTRL_TUNING_MASK (0xff<<0) /** @} */ @@ -542,7 +538,6 @@ #define CMU_LCDCTRL_VBFDIV_DIV128 (7<<4) #define CMU_LCDCTRL_VBFDIV_MASK (0x7<<4) #define CMU_LCDCTRL_VBOOSTEN (1<<3) -/* No values defined for the field FDIV */ #define CMU_LCDCTRL_FDIV_MASK (0x7<<0) /** @} */ diff --git a/include/libopencm3/efm32/tinygecko/cmu.yaml b/include/libopencm3/efm32/tinygecko/cmu.yaml index 6153c47f..7b83b7fb 100644 --- a/include/libopencm3/efm32/tinygecko/cmu.yaml +++ b/include/libopencm3/efm32/tinygecko/cmu.yaml @@ -153,6 +153,7 @@ registers: offset: 0x010 definition_baserefext: ".5.5" length: 7 + type: uint - name: AUXHFRCOCTRL offset: 0x014 definition_baserefext: ".5.6" @@ -200,6 +201,7 @@ registers: offset: 0x01c definition_baserefext: ".5.8" length: 19 + type: uint - name: OSCENCMD offset: 0x020 definition_baserefext: ".5.9" diff --git a/include/libopencm3/efm32/tinygecko/generate.py b/include/libopencm3/efm32/tinygecko/generate.py index 035b4d97..7f426a4d 100644 --- a/include/libopencm3/efm32/tinygecko/generate.py +++ b/include/libopencm3/efm32/tinygecko/generate.py @@ -75,16 +75,19 @@ def yaml2h(filenamebase): nl() for regdata in regs: - if 'is_template' in regdata: + has_bits = "fields" in regdata + has_values = "values" in regdata + is_template = "is_template" in regdata + if is_template: # this isn't a real register, just a template continue secondcomponent_name = regdata['name'] - if ('fields' in regdata and isinstance(regdata['fields'], str)) or ('values' in regdata and isinstance(regdata['values'], str)): + if (has_bits and isinstance(regdata['fields'], str)) or (has_values and isinstance(regdata['values'], str)): # uses a template - secondcomponent_name = regdata['fields'] if 'fields' in regdata else regdata['values'] + secondcomponent_name = regdata['fields'] if has_bits else regdata['values'] regs_dict[secondcomponent_name]['is_template'].append(regdata['name']) - define("%s_%s"%(data['shortname'], regdata['name']), "MMIO32(%s_BASE + %#.003x)"%(data['shortname'], regdata['offset']), "@see %s_%s_%s"%(data['shortdocname'], secondcomponent_name, 'values' if 'values' in regdata else 'bits')) + define("%s_%s"%(data['shortname'], regdata['name']), "MMIO32(%s_BASE + %#.003x)"%(data['shortname'], regdata['offset']), "@see %s_%s_%s"%(data['shortdocname'], secondcomponent_name, 'values' if 'values' in regdata else 'bits') if has_bits or has_values else None) nl() wc_close() # close register definitions nl() @@ -104,15 +107,18 @@ def yaml2h(filenamebase): if is_template: commentlines.append("%s for the {shortname} \"{name}\" group of registers (%s)"%("Bit states" if has_bits else "Values", ", ".join(regdata['is_template']))) assert len(regdata['is_template']) > 0, "What should I talk about when nobody uses this template?" - commentlines.append("These registers use this:") - commentlines.append("