Documentation ¶
Overview ¶
Package timer represents the timer part of the RIOT (the T in RIOT).
Index ¶
- Constants
- type Divider
- type Timer
- func (tmr *Timer) PeekField(fld string) any
- func (tmr *Timer) Plumb(mem chipbus.Memory)
- func (tmr *Timer) PokeField(fld string, v any)
- func (tmr *Timer) Reset()
- func (tmr *Timer) Snapshot() *Timer
- func (tmr *Timer) Step()
- func (tmr *Timer) String() string
- func (tmr *Timer) Update(data chipbus.ChangedRegister) bool
Constants ¶
const MaskTIMINT = 0b11000000
MaskTIMINT defines the bits of TIMINT that are actually used
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Divider ¶ added in v0.16.0
type Divider int
Divider indicates how often (in CPU cycles) the timer value decreases the following rules apply:
- set to 1, 8, 64 or 1024 depending on which address has been written to by the CPU
- is used to reset the cyclesRemaining
- is changed to 1 once value reaches 0
- is reset to its initial value of 1, 8, 64, or 1024 whenever INTIM is read by the CPU
List of valid Divider values
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer implements the timer part of the PIA 6532 (the T in RIOT)
func NewTimer ¶
func NewTimer(env *environment.Environment, mem chipbus.Memory) *Timer
NewTimer is the preferred method of initialisation of the Timer type
func (*Timer) PeekField ¶ added in v0.16.0
PeekINTIM pokes a new value into the INTIM register. Same as peeking the INTIM register on the cpubus - provided here for convenience
Supported fields:
intim (uint8) timint (uint8) ticksRemainging (int) divider (timer.Divider)
func (*Timer) PokeField ¶ added in v0.16.0
PokeINTIM pokes a new value into the INTIM register. Same as poking the INTIM register on the cpubus - provided here for convenience
Fields as described for PeekField()