func (p *Periph) LoadCC(n int) uint32 {
	return p.cc[n].Load()
}
LoadCC returns value of n-th compare register.
package rtc
import (
	"embedded/mmio"
	"unsafe"
	"github.com/embeddedgo/nrf5/hal/te"
	"github.com/embeddedgo/nrf5/p/mmap"
)
type Periph struct {
	te.Regs
	_         [65]uint32
	counter   mmio.U32
	prescaler mmio.U32
	_         [13]uint32
	cc        [4]mmio.U32
}
func RTC(n int) *Periph {
	switch n {
	case 0:
		return (*Periph)(unsafe.Pointer(mmap.RTC0_BASE))
	case 1:
		return (*Periph)(unsafe.Pointer(mmap.RTC1_BASE))
	case 2:
		return (*Periph)(unsafe.Pointer(mmap.RTC2_BASE))
	default:
		return nil
	}
}
type Task uint8
const (
	START      Task = 0  
	STOP       Task = 1  
	CLEAR      Task = 2  
	TRIGOVRFLW Task = 3  
)
type Event uint8
const (
	TICK   Event = 0  
	OVRFLW Event = 1  
)
func COMPARE(n int) Event {
	return Event(16 + n)
}
func (p *Periph) Task(t Task) *te.Task    { return p.Regs.Task(int(t)) }
func (p *Periph) Event(e Event) *te.Event { return p.Regs.Event(int(e)) }
func (p *Periph) LoadCOUNTER() uint32 {
	return p.counter.Load()
}
func (p *Periph) LoadPRESCALER() uint32 {
	return p.prescaler.Load()
}
func (p *Periph) StorePRESCALER(pr int) {
	p.prescaler.Store(uint32(pr))
}