sdm

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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorBase = 0x1000

Variables

This section is empty.

Functions

func DisableSoftdevice

func DisableSoftdevice() error

func EnableSoftdevice

func EnableSoftdevice(lfclkc *LFCLKC, faultHandler func(id, pc, info uint32)) error

func SetSoftdeviceVectorTableBase

func SetSoftdeviceVectorTableBase(addr unsafe.Pointer) error

func SoftdeviceEnabled

func SoftdeviceEnabled() (en bool, err error)

Types

type Error

type Error uint32
const (
	ErrLFCLKS Error = ErrorBase + 0 // unknown LFCLK source
	ErrIntCfg Error = ErrorBase + 1 // incorrect interrupt configuration
	ErrCLENR0 Error = ErrorBase + 2 // incorrect CLENR0
)

func (Error) Error

func (e Error) Error() string

type LFCLKA

type LFCLKA uint8

LFCLKA represents accuracy of external low-frequency clock source.

const (
	LFCLK250ppm LFCLKA = 0  // 250 ppm (default)
	LFCLK500ppm LFCLKA = 1  // 500 ppm
	LFCLK150ppm LFCLKA = 2  // 150 ppm
	LFCLK100ppm LFCLKA = 3  // 100 ppm
	LFCLK75ppm  LFCLKA = 4  // 75 ppm
	LFCLK50ppm  LFCLKA = 5  // 50 ppm
	LFCLK30ppm  LFCLKA = 6  // 30 ppm
	LFCLK20ppm  LFCLKA = 7  // 20 ppm
	LFCLK10ppm  LFCLKA = 8  // 10 ppm
	LFCLK5ppm   LFCLKA = 9  // 5 ppm
	LFCLK2ppm   LFCLKA = 10 // 2 ppm
	LFCLK1ppm   LFCLKA = 11 // 1 ppm
)

type LFCLKC

type LFCLKC struct {
	Source     LFCLKS // clock source
	CalInt     uint8  // RC oscilator calibration interval in 1/4 second units
	CalTempInt uint8  // how often calibrate RC oscilator if temp. has changed
	Accuracy   LFCLKA // external clock accuracy
}

LFCLKC represents configuration of low-frequency clock.

type LFCLKS

type LFCLKS uint8

LFCLKS represents possible low-frequency clock sources.

const (
	LFCLKRC    LFCLKS = 0 // RC oscillator.
	LFCLKXTAL  LFCLKS = 1 // crystal oscillator.
	LFCLKSYNTH LFCLKS = 2 // synthesized from HFCLK.
)

Jump to

Keyboard shortcuts

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