comp

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

Documentation

Overview

Package comp provides interface to Comparator.

Peripheral: COMP_Periph Comparator. Instances:

COMP  mmap.COMP_BASE

Registers:

0x00 32  CSR Comparator control and status register.

Import:

stm32/o/l1xx_md/mmap

Index

Constants

View Source
const (
	V10KPUn    = 0
	V400KPUn   = 1
	V10KPDn    = 2
	V400KPDn   = 3
	CMP1ENn    = 4
	SW1n       = 5
	CMP1OUTn   = 7
	SPEEDn     = 12
	CMP2OUTn   = 13
	VREFOUTENn = 16
	WNDWEn     = 17
	INSELn     = 18
	OUTSELn    = 21
	FCH3n      = 26
	FCH8n      = 27
	RCH13n     = 28
	CAIEn      = 29
	CAIFn      = 30
	TSUSPn     = 31
)

Variables

Functions

This section is empty.

Types

type COMP_Periph

type COMP_Periph struct {
	CSR RCSR
}

func (*COMP_Periph) BaseAddr

func (p *COMP_Periph) BaseAddr() uintptr

func (*COMP_Periph) CAIE

func (p *COMP_Periph) CAIE() RMCSR

func (*COMP_Periph) CAIF

func (p *COMP_Periph) CAIF() RMCSR

func (*COMP_Periph) CMP1EN

func (p *COMP_Periph) CMP1EN() RMCSR

func (*COMP_Periph) CMP1OUT

func (p *COMP_Periph) CMP1OUT() RMCSR

func (*COMP_Periph) CMP2OUT

func (p *COMP_Periph) CMP2OUT() RMCSR

func (*COMP_Periph) FCH3

func (p *COMP_Periph) FCH3() RMCSR

func (*COMP_Periph) FCH8

func (p *COMP_Periph) FCH8() RMCSR

func (*COMP_Periph) INSEL

func (p *COMP_Periph) INSEL() RMCSR

func (*COMP_Periph) OUTSEL

func (p *COMP_Periph) OUTSEL() RMCSR

func (*COMP_Periph) RCH13

func (p *COMP_Periph) RCH13() RMCSR

func (*COMP_Periph) SPEED

func (p *COMP_Periph) SPEED() RMCSR

func (*COMP_Periph) SW1

func (p *COMP_Periph) SW1() RMCSR

func (*COMP_Periph) TSUSP

func (p *COMP_Periph) TSUSP() RMCSR

func (*COMP_Periph) V10KPD

func (p *COMP_Periph) V10KPD() RMCSR

func (*COMP_Periph) V10KPU

func (p *COMP_Periph) V10KPU() RMCSR

func (*COMP_Periph) V400KPD

func (p *COMP_Periph) V400KPD() RMCSR

func (*COMP_Periph) V400KPU

func (p *COMP_Periph) V400KPU() RMCSR

func (*COMP_Periph) VREFOUTEN

func (p *COMP_Periph) VREFOUTEN() RMCSR

func (*COMP_Periph) WNDWE

func (p *COMP_Periph) WNDWE() RMCSR

type CSR

type CSR uint32
const (
	V10KPU    CSR = 0x01 << 0  //+ 10K pull-up resistor.
	V400KPU   CSR = 0x01 << 1  //+ 400K pull-up resistor.
	V10KPD    CSR = 0x01 << 2  //+ 10K pull-down resistor.
	V400KPD   CSR = 0x01 << 3  //+ 400K pull-down resistor.
	CMP1EN    CSR = 0x01 << 4  //+ Comparator 1 enable.
	SW1       CSR = 0x01 << 5  //+ SW1 analog switch enable.
	CMP1OUT   CSR = 0x01 << 7  //+ Comparator 1 output.
	SPEED     CSR = 0x01 << 12 //+ Comparator 2 speed.
	CMP2OUT   CSR = 0x01 << 13 //+ Comparator 2 ouput.
	VREFOUTEN CSR = 0x01 << 16 //+ Comparator Vref Enable.
	WNDWE     CSR = 0x01 << 17 //+ Window mode enable.
	INSEL     CSR = 0x07 << 18 //+ INSEL[2:0] Inversion input Selection.
	INSEL_0   CSR = 0x01 << 18 //  Bit 0.
	INSEL_1   CSR = 0x02 << 18 //  Bit 1.
	INSEL_2   CSR = 0x04 << 18 //  Bit 2.
	OUTSEL    CSR = 0x07 << 21 //+ OUTSEL[2:0] comparator 2 output redirection.
	OUTSEL_0  CSR = 0x01 << 21 //  Bit 0.
	OUTSEL_1  CSR = 0x02 << 21 //  Bit 1.
	OUTSEL_2  CSR = 0x04 << 21 //  Bit 2.
	FCH3      CSR = 0x01 << 26 //+ Bit 26.
	FCH8      CSR = 0x01 << 27 //+ Bit 27.
	RCH13     CSR = 0x01 << 28 //+ Bit 28.
	CAIE      CSR = 0x01 << 29 //+ Bit 29.
	CAIF      CSR = 0x01 << 30 //+ Bit 30.
	TSUSP     CSR = 0x01 << 31 //+ Bit 31.
)

func (CSR) Field

func (b CSR) Field(mask CSR) int

func (CSR) J

func (mask CSR) J(v int) CSR

type RCSR

type RCSR struct{ mmio.U32 }

func (*RCSR) AtomicClearBits

func (r *RCSR) AtomicClearBits(mask CSR)

func (*RCSR) AtomicSetBits

func (r *RCSR) AtomicSetBits(mask CSR)

func (*RCSR) AtomicStoreBits

func (r *RCSR) AtomicStoreBits(mask, b CSR)

func (*RCSR) Bits

func (r *RCSR) Bits(mask CSR) CSR

func (*RCSR) ClearBits

func (r *RCSR) ClearBits(mask CSR)

func (*RCSR) Load

func (r *RCSR) Load() CSR

func (*RCSR) SetBits

func (r *RCSR) SetBits(mask CSR)

func (*RCSR) Store

func (r *RCSR) Store(b CSR)

func (*RCSR) StoreBits

func (r *RCSR) StoreBits(mask, b CSR)

type RMCSR

type RMCSR struct{ mmio.UM32 }

func (RMCSR) Load

func (rm RMCSR) Load() CSR

func (RMCSR) Store

func (rm RMCSR) Store(b CSR)

Jump to

Keyboard shortcuts

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