cores: timer: fix documentation formatting

The ReStructured Text used was not properly formatted, resulting in
confusing and broken output.  This corrects the output and lets it
format correctly when using sphinx.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-01-02 15:36:35 +08:00
parent db7a48c05d
commit a251d71211
1 changed files with 18 additions and 15 deletions

View File

@ -18,31 +18,34 @@ class Timer(Module, AutoCSR, ModuleDoc):
Provides a generic Timer core. Provides a generic Timer core.
The Timer is implemented as a countdown timer that can be used in various modes: The Timer is implemented as a countdown timer that can be used in various modes:
- Polling : Returns current countdown value to software.
- One-Shot: Loads itself and stops when value reaches 0.
- Periodic: (Re-)Loads itself when value reaches 0.
`en` register allows the user to enable/disable the Timer. When the Timer is enabled, it is - Polling : Returns current countdown value to software
- One-Shot: Loads itself and stops when value reaches ``0``
- Periodic: (Re-)Loads itself when value reaches ``0``
``en`` register allows the user to enable/disable the Timer. When the Timer is enabled, it is
automatically loaded with the value of `load` register. automatically loaded with the value of `load` register.
When the Timer reaches 0, it is automatically reloaded with value of `reload` register. When the Timer reaches ``0``, it is automatically reloaded with value of `reload` register.
The user can latch the current countdown value by writing to `update_value` register, it will The user can latch the current countdown value by writing to ``update_value`` register, it will
update `value` register with current countdown value. update ``value`` register with current countdown value.
To use the Timer in One-Shot mode, the user needs to: To use the Timer in One-Shot mode, the user needs to:
- Disable the timer.
- Set the `load` register to the expected duration. - Disable the timer
- (Re-)Enable the Timer. - Set the ``load`` register to the expected duration
- (Re-)Enable the Timer
To use the Timer in Periodic mode, the user needs to: To use the Timer in Periodic mode, the user needs to:
- Disable the Timer.
- Set the `load` register to 0. - Disable the Timer
- Set the `reload` register to the expected period. - Set the ``load`` register to 0
- Enable the Timer. - Set the ``reload`` register to the expected period
- Enable the Timer
For both modes, the CPU can be advertised by an IRQ that the duration/period has elapsed. (The For both modes, the CPU can be advertised by an IRQ that the duration/period has elapsed. (The
CPU can also do software polling with `update_value` and `value` to know the elapsed duration) CPU can also do software polling with ``update_value`` and ``value`` to know the elapsed duration)
""" """
def __init__(self, width=32): def __init__(self, width=32):
self._load = CSRStorage(width, description="""Load value when Timer is (re-)enabled.""" + self._load = CSRStorage(width, description="""Load value when Timer is (re-)enabled.""" +