Documentation
¶
Overview ¶
Package qdec provides access to the registers of Quadrature Decoder (QDEC) peripheral.
Index ¶
- Variables
- type Event
- type Periph
- func (p *Periph) Event(e Event) *te.Event
- func (p *Periph) LoadACC() int
- func (p *Periph) LoadACCDBL() int
- func (p *Periph) LoadACCDBLREAD() int
- func (p *Periph) LoadACCREAD() int
- func (p *Periph) LoadDBFEN() bool
- func (p *Periph) LoadENABLE() bool
- func (p *Periph) LoadLEDPOL() int
- func (p *Periph) LoadLEDPRE() int
- func (p *Periph) LoadPSEL(s Signal) gpio.Pin
- func (p *Periph) LoadREPORTPER() ReportPeriod
- func (p *Periph) LoadSAMPLE() int
- func (p *Periph) LoadSAMPLEPER() SamplePeriod
- func (p *Periph) LoadSHORTS() Shorts
- func (p *Periph) StoreDBFEN(en bool)
- func (p *Periph) StoreENABLE(en bool)
- func (p *Periph) StoreLEDPOL(polarity int)
- func (p *Periph) StoreLEDPRE(us int)
- func (p *Periph) StorePSEL(s Signal, pin gpio.Pin)
- func (p *Periph) StoreREPORTPER(period ReportPeriod)
- func (p *Periph) StoreSAMPLEPER(period SamplePeriod)
- func (p *Periph) StoreSHORTS(s Shorts)
- func (p *Periph) Task(t Task) *te.Task
- type ReportPeriod
- type SamplePeriod
- type Shorts
- type Signal
- type Task
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Periph ¶
func (*Periph) LoadACCDBL ¶
LoadACCDBL returns the number of detected double transitions: [0..15].
func (*Periph) LoadACCDBLREAD ¶
LoadACCDBLREAD returns the snapshot of the ACCDBL register, updated by the READCLRACC or RDCLRACC task.
func (*Periph) LoadACCREAD ¶
LoadACCREAD returns the snapshot of the ACC register, updated by the READCLRACC or RDCLRACC task.
func (*Periph) LoadENABLE ¶
LoadENABLE reports whether the QDEC peripheral is enabled.
func (*Periph) LoadLEDPOL ¶
LoadLEDPOL returns LED output pin polarity: 0 - active low, 1 - active high.
func (*Periph) LoadLEDPRE ¶
LoadLEDPRE returns the time period the LED is switched on prior to sampling: [0..511] µs.
func (*Periph) LoadREPORTPER ¶
func (p *Periph) LoadREPORTPER() ReportPeriod
LoadREPORTPER returns the sample period.
func (*Periph) LoadSAMPLE ¶
LoadSAMPLE returns the last motion sample: -1, 1 or 2.
func (*Periph) LoadSAMPLEPER ¶
func (p *Periph) LoadSAMPLEPER() SamplePeriod
LoadSAMPLEPER returns the sample period.
func (*Periph) LoadSHORTS ¶
func (*Periph) StoreDBFEN ¶
StoreDBFEN enables or disables the input debounce filters.
func (*Periph) StoreENABLE ¶
StoreENABLE enables or disables QDEC peripheral.
func (*Periph) StoreLEDPOL ¶
StoreLEDPOL sets LED output pin polarity: 0 - active low, 1 - active high.
func (*Periph) StoreLEDPRE ¶
StoreLEDPRE sets the time period the LED is switched on prior to sampling: [0..511] µs.
func (*Periph) StoreREPORTPER ¶
func (p *Periph) StoreREPORTPER(period ReportPeriod)
StoreREPORTPER sets the sample period.
func (*Periph) StoreSAMPLEPER ¶
func (p *Periph) StoreSAMPLEPER(period SamplePeriod)
StoreSAMPLEPER sets the sample period.
func (*Periph) StoreSHORTS ¶
type ReportPeriod ¶
type ReportPeriod byte
const ( P10 ReportPeriod = 0 // 10 samples per report. P40 ReportPeriod = 1 // 40 samples per report. P80 ReportPeriod = 2 // 80 samples per report. P120 ReportPeriod = 3 // 120 samples per report. P160 ReportPeriod = 4 // 160 samples per report. P200 ReportPeriod = 5 // 200 samples per report. P240 ReportPeriod = 6 // 240 samples per report. P280 ReportPeriod = 7 // 280 samples per report. P1 ReportPeriod = 8 // 1 sample per report (nRF52). )
type SamplePeriod ¶
type SamplePeriod byte
const ( P128us SamplePeriod = 0 // 128 µs P256us SamplePeriod = 1 // 256 µs P512us SamplePeriod = 2 // 512 µs P1ms SamplePeriod = 3 // 1024 µs P2ms SamplePeriod = 4 // 2048 µs P4ms SamplePeriod = 5 // 4096 µs P8ms SamplePeriod = 6 // 8192 µs P16ms SamplePeriod = 7 // 16384 µs P33ms SamplePeriod = 8 // 32768 µs (nRF52) P66ms SamplePeriod = 9 // 65536 µs (nRF52) P131ms SamplePeriod = 10 // 131072 µs (nRF52) )