Documentation
¶
Overview ¶
Package timer provides interface to manage nRF5 timers.
Index ¶
- type Bitmode
- type Event
- type Mode
- type Periph
- func (p *Periph) Event(e Event) *te.Event
- func (p *Periph) LoadBITMODE() Bitmode
- func (p *Periph) LoadCC(n int) uint32
- func (p *Periph) LoadMODE() Mode
- func (p *Periph) LoadPRESCALER() int
- func (p *Periph) LoadSHORTS() Shorts
- func (p *Periph) StoreBITMODE(m Bitmode)
- func (p *Periph) StoreCC(n int, cc uint32)
- func (p *Periph) StoreMODE(m Mode)
- func (p *Periph) StorePRESCALER(exp int)
- func (p *Periph) StoreSHORTS(s Shorts)
- func (p *Periph) Task(t Task) *te.Task
- type Shorts
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Periph ¶
Periph represents timer/counter peripheral.
func TIMER ¶
TIMER returns n-th instance of TIMER peripheral or nil if this instance is not implemented.
func (*Periph) LoadBITMODE ¶
func (*Periph) LoadCC ¶
LoadCC returns value of n-th Capture/Compare register. nRF51/nRF52 has 4/6 CC registers
func (*Periph) LoadPRESCALER ¶
func (*Periph) LoadSHORTS ¶
func (*Periph) StoreBITMODE ¶
func (*Periph) StoreCC ¶
StoreCC stores cc into n-th Capture/Compare register. nRF51/nRF52 has 4/6 CC registers
func (*Periph) StorePRESCALER ¶
StorePRESCALER sets prescaler to exp (freq = 16MHz/2^exp). Must only be used when the timer is stopped.
func (*Periph) StoreSHORTS ¶
type Shorts ¶
type Shorts uint32
const ( COMPARE0_CLEAR Shorts = 1 << 0 COMPARE1_CLEAR Shorts = 1 << 1 COMPARE2_CLEAR Shorts = 1 << 2 COMPARE3_CLEAR Shorts = 1 << 3 COMPARE4_CLEAR Shorts = 1 << 4 COMPARE5_CLEAR Shorts = 1 << 5 COMPARE0_STOP Shorts = 1 << 8 COMPARE1_STOP Shorts = 1 << 9 COMPARE2_STOP Shorts = 1 << 10 COMPARE3_STOP Shorts = 1 << 11 COMPARE4_STOP Shorts = 1 << 12 COMPARE5_STOP Shorts = 1 << 13 )
Click to show internal directories.
Click to hide internal directories.