Documentation ¶
Overview ¶
Package timer represents the timer part of the RIOT (the T in RIOT).
Index ¶
- Variables
- type Interval
- type Timer
- func (tmr *Timer) Plumb(mem bus.ChipBus)
- func (tmr *Timer) Reset()
- func (tmr *Timer) SetInterval(interval string) bool
- func (tmr *Timer) SetTicks(ticks int)
- func (tmr *Timer) SetValue(value uint8)
- func (tmr *Timer) Snapshot() *Timer
- func (tmr *Timer) Step()
- func (tmr *Timer) String() string
- func (tmr *Timer) Update(data bus.ChipData) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var IntervalList = []string{"TIM1T", "TIM8T", "TIM64T", "T1024T"}
IntervalList is a list of all possible string representations of the Interval type.
Functions ¶
This section is empty.
Types ¶
type Interval ¶
type Interval int
Interval 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 Interval values.
type Timer ¶
type Timer struct { // the interval value most recently requested by the CPU Divider Interval // INTIMvalue is the current timer value and is a reflection of the INTIM // RIOT memory register. set with SetValue() function INTIMvalue uint8 // TicksRemaining is the number of CPU cycles remaining before the // value is decreased. the following rules apply: // * set to 0 when new timer is set // * causes value to decrease whenever it reaches -1 // * is reset to divider whenever value is decreased // // with regards to the last point, note that divider changes to 1 // once INTIMvalue reaches 0 TicksRemaining int // contains filtered or unexported fields }
Timer implements the timer part of the PIA 6532 (the T in RIOT).
func NewTimer ¶
func NewTimer(prefs *preferences.Preferences, mem bus.ChipBus) *Timer
NewTimer is the preferred method of initialisation of the Timer type.
func (*Timer) SetInterval ¶
SetInterval sets the timer interval based on timer register name.
Click to show internal directories.
Click to hide internal directories.