rtc

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package rtc provides access to the registers of Real Time Counter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event uint8
const (
	TICK   Event = 0 // Event on COUNTER increment.
	OVRFLW Event = 1 // Event on COUNTER overflow.
)

func COMPARE

func COMPARE(n int) Event

COMPARE returns compare event on CC[n] match.

type Periph

type Periph struct {
	te.Regs
	// contains filtered or unexported fields
}

Periph represents Real Time Counter peripheral.

func RTC

func RTC(n int) *Periph

func (*Periph) Event

func (p *Periph) Event(e Event) *te.Event

func (*Periph) LoadCC

func (p *Periph) LoadCC(n int) uint32

LoadCC returns value of n-th compare register.

func (*Periph) LoadCOUNTER

func (p *Periph) LoadCOUNTER() uint32

LoadCOUNTER returns value of counter register.

func (*Periph) LoadPRESCALER

func (p *Periph) LoadPRESCALER() uint32

LoadPRESCALER returns value of prescaler register.

func (*Periph) StoreCC

func (p *Periph) StoreCC(n int, cc uint32)

StoreCC stores n-th compare register to cc.

func (*Periph) StorePRESCALER

func (p *Periph) StorePRESCALER(pr int)

StorePRESCALER stores prescaler to pr (freq = 32768Hz/(pr+1)). Can be used only when the timer is stopped.

func (*Periph) Task

func (p *Periph) Task(t Task) *te.Task

type Task

type Task uint8
const (
	START      Task = 0 // Start RTC COUNTER.
	STOP       Task = 1 // Stop RTC COUNTER.
	CLEAR      Task = 2 // Clear RTC COUNTER.
	TRIGOVRFLW Task = 3 // Store COUNTER to 0xFFFFF0.
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL