clock

package
v0.0.0-...-168ccc2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package clock provides interface to manage nRF51 clocks source/generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableIRQ

func DisableIRQ(mask te.EventMask)

func EnableIRQ

func EnableIRQ(mask te.EventMask)

func IRQEnabled

func IRQEnabled() te.EventMask

func LoadCTIV

func LoadCTIV() int

LoadCTIV returns calibration timer interval in milliseconds.

func LoadHFCLKRUN

func LoadHFCLKRUN() bool

LoadHFCLKRUN returns true if HFCLKSTART task was triggered.

func LoadLFCLKRUN

func LoadLFCLKRUN() bool

LoadLFCLKRUN returns true if LFCLKSTART task was triggered.

func LoadTRACECONFIG

func LoadTRACECONFIG() (TraceSpeed, TraceMux)

LoadTRACECONFIG returns current speed of Trace Port clock and pin multiplexing of trace signals. nRF52.

func NVIRQ

func NVIRQ() nvic.IRQ

func StoreCTIV

func StoreCTIV(ctiv int)

StoreCTIV sets calibration timer interval as number of milliseconds (range: 250 ms to 31750 ms).

func StoreLFCLKSRC

func StoreLFCLKSRC(src Source)

StoreLFCLKSRC sets clock source for LFCLK. It can only be modified when LFCLK is not running.

func StoreTRACECONFIG

func StoreTRACECONFIG(s TraceSpeed, m TraceMux)

StoreTRACECONFIG sets speed of Trace Port clock and pin multiplexing of trace signals. nRF52.

func StoreXTALFREQ

func StoreXTALFREQ(f XtalFreq)

StoreXTALFREQ selects frequency of external crystal for HFCLK. nRF51.

Types

type Event

type Event byte
const (
	HFCLKSTARTED Event = 0 // High frequency crystal oscilator started.
	LFCLKSTARTED Event = 1 // Low frequency source started.
	DONE         Event = 3 // Calibration of low freq. RC osc. complete.
	CTTO         Event = 4 // Calibration timer timeout.
)

func (Event) Event

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

type Source

type Source byte
const (
	RC    Source = 0
	XTAL  Source = 1
	SYNTH Source = 2
)

func LoadHFCLKSTAT

func LoadHFCLKSTAT() (src Source, running bool)

LoadHFCLKStat returns information about HFCLK status (running or not) and clock source.

func LoadLFCLKSRC

func LoadLFCLKSRC() Source

LoadLFCLKSRC returns clock source for LFCLK.

func LoadLFCLKSRCCOPY

func LoadLFCLKSRCCOPY() Source

LoadLFCLKSRCCOPY returns clock source for LFCLK from time when LFCLKSTART task has been triggered.

func LoadLFCLKSTAT

func LoadLFCLKSTAT() (src Source, running bool)

LoadLFCLKSTAT returns information about LFCLK status (running or not) and clock source.

type Task

type Task byte
const (
	HFCLKSTART Task = 0 // Start high frequency crystal oscilator.
	HFCLKSTOP  Task = 1 // Stop high frequency crystal oscilator.
	LFCLKSTART Task = 2 // Start low frequency source.
	LFCLKSTOP  Task = 3 // Stop low frequency source.
	CAL        Task = 4 // Start calibration of low freq. RC oscilator.
	CTSTART    Task = 5 // Start calibration timer.
	CTSTOP     Task = 6 // Stop calibration timer.
)

func (Task) Task

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

type TraceMux

type TraceMux byte

TraceMux represents trace pins multiplexing configuration.

const (
	GPIO     TraceMux = 0 // GPIOs multiplexed onto all trace pins.
	Serial   TraceMux = 1 // SWO onto P0.18, GPIO onto other trace pins.
	Parallel TraceMux = 2 // TRACECLK and TRACEDATA onto P0.20,18,16,15,14.
)

type TraceSpeed

type TraceSpeed byte

TraceSpeed represents speed of Trace Port clock.

const (
	T32MHz TraceSpeed = 0 // 32 MHz Trace Port clock (TRACECLK = 16 MHz).
	T16MHz TraceSpeed = 1 // 16 MHz Trace Port clock (TRACECLK = 8 MHz).
	T8MHz  TraceSpeed = 2 // 8 MHz Trace Port clock (TRACECLK = 4 MHz).
	T4MHz  TraceSpeed = 3 // 4 MHz Trace Port clock (TRACECLK = 2 MHz).
)

type XtalFreq

type XtalFreq byte
const (
	X16MHz XtalFreq = 0xff
	X32MHz XtalFreq = 0x00
)

func LoadXTALFREQ

func LoadXTALFREQ() XtalFreq

LoadXTALFREQ returns selected frequency of external crystal for HFCLK. nRF51.

Jump to

Keyboard shortcuts

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