~ruther/avr-device

ref: aae9508c0ea13ccee41fb2738e9b5f77dac8deb8 avr-device/patch/common/wdt.yaml -rw-r--r-- 1.1 KiB
aae9508c — Rahix common: Add some comments to the patch files 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Patches for the Watchdog Timer
#
# The control register has a different name between ATmega and
# ATtiny (WDTCSR vs WDTCR).
#
# - Make the control register read-write
# - Remove the overlapping WDP (Prescaler) field and replace
#   it with two separate fields.
# - TODO: See if svd2rust would support some kind of mask?
WDT:
  _modify:
    WDTCSR,WDTCR:
      access: read-write
  WDTCSR,WDTCR:
    _delete:
      - WDP
    _add:
      WDPL:
        description: "Watchdog Timer Prescaler - Low Bits"
        bitRange: "[2:0]"
      WDPH:
        description: "Watchdog Timer Prescaler - High Bit"
        bitRange: "[5:5]"
    WDPL:
      CYCLES_2K:     [0, "- 2048 cycles, ~16ms/512K (524288) cycles, ~4s if WDPH is set"]
      CYCLES_4K:     [1, "- 4096 cycles, ~32ms/1024K (1048576) cycles, ~8s if WDPH is set"]
      CYCLES_8K:     [2, "- 8192 cycles, ~64ms"]
      CYCLES_16K:    [3, "- 16K (16384) cycles, ~0.125s"]
      CYCLES_32K:    [4, "- 32K (32768) cycles, ~0.25s"]
      CYCLES_64K:    [5, "- 64K (65536) cycles, ~0.5s"]
      CYCLES_128K:   [6, "- 128K (131072) cycles, ~1s"]
      CYCLES_256K:   [7, "- 256K (262144) cycles, ~2s"]
Do not follow this link