mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-09 07:02:20 -04:00
Update README with info about the timer API
Signed-off-by: Joachim Strömbergson <joachim@assured.se>
This commit is contained in:
parent
4c54b4b60b
commit
e6eaad87dc
1 changed files with 21 additions and 0 deletions
|
@ -7,8 +7,29 @@ allows measurement of time durations rather than cycles. If for
|
||||||
example setting the prescaler to the clock frequency in Hertz, the
|
example setting the prescaler to the clock frequency in Hertz, the
|
||||||
timer will count seconds.
|
timer will count seconds.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
The following addresses define the API for the timer:
|
||||||
|
|
||||||
|
```
|
||||||
|
ADDR_CTRL: 0x08
|
||||||
|
CTRL_START_BIT: 0
|
||||||
|
CTRL_STOP_BIT: 1
|
||||||
|
|
||||||
|
ADDR_STATUS: 0x09
|
||||||
|
STATUS_RUNNING_BIT: 0
|
||||||
|
|
||||||
|
ADDR_PRESCALER: 0x0a
|
||||||
|
ADDR_TIMER: 0x0b
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
The core consists of the timer_core module (in timer_core.v) and a top
|
||||||
|
level wrapper, timer (in timer.v). The top level wrapper implements
|
||||||
|
the API, while the timer_core implements the actual timer
|
||||||
|
functionality.
|
||||||
|
|
||||||
The timer counter and the prescaler counter are both 32 bits.
|
The timer counter and the prescaler counter are both 32 bits.
|
||||||
When enabled the counter counts down one integer value per cycle.
|
When enabled the counter counts down one integer value per cycle.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue