opamp

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 opamp provides interface to Operational Amplifier (OPAMP).

Peripheral: OPAMP_Periph Operational Amplifier (OPAMP). Instances:

OPAMP1  mmap.OPAMP1_BASE
OPAMP   mmap.OPAMP_BASE
OPAMP2  mmap.OPAMP2_BASE
OPAMP3  mmap.OPAMP3_BASE
OPAMP4  mmap.OPAMP4_BASE

Registers:

0x00 32  CSR Control and status register.

Import:

stm32/o/f303xe/mmap

Index

Constants

View Source
const (
	OPAMPxENn    = 0
	FORCEVPn     = 1
	VPSELn       = 2
	VMSELn       = 5
	TCMENn       = 7
	VMSSELn      = 8
	VPSSELn      = 9
	CALONn       = 11
	CALSELn      = 12
	PGGAINn      = 14
	USERTRIMn    = 18
	TRIMOFFSETPn = 19
	TRIMOFFSETNn = 24
	TSTREFn      = 29
	OUTCALn      = 30
	LOCKn        = 31
)

Variables

Functions

This section is empty.

Types

type CSR

type CSR uint32
const (
	OPAMPxEN    CSR = 0x01 << 0  //+ OPAMP enable.
	FORCEVP     CSR = 0x01 << 1  //+ Connect the internal references to the plus input of the OPAMPX.
	VPSEL       CSR = 0x03 << 2  //+ Non inverting input selection.
	VMSEL       CSR = 0x03 << 5  //+ Inverting input selection.
	TCMEN       CSR = 0x01 << 7  //+ Timer-Controlled Mux mode enable.
	VMSSEL      CSR = 0x01 << 8  //+ Inverting input secondary selection.
	VPSSEL      CSR = 0x03 << 9  //+ Non inverting input secondary selection.
	CALON       CSR = 0x01 << 11 //+ Calibration mode enable.
	CALSEL      CSR = 0x03 << 12 //+ Calibration selection.
	PGGAIN      CSR = 0x0F << 14 //+ Gain in PGA mode.
	USERTRIM    CSR = 0x01 << 18 //+ User trimming enable.
	TRIMOFFSETP CSR = 0x1F << 19 //+ Offset trimming value (PMOS).
	TRIMOFFSETN CSR = 0x1F << 24 //+ Offset trimming value (NMOS).
	TSTREF      CSR = 0x01 << 29 //+ It enables the switch to put out the internal reference.
	OUTCAL      CSR = 0x01 << 30 //+ OPAMP ouput status flag.
	LOCK        CSR = 0x01 << 31 //+ OPAMP lock.
)

func (CSR) Field

func (b CSR) Field(mask CSR) int

func (CSR) J

func (mask CSR) J(v int) CSR

type OPAMP_Periph

type OPAMP_Periph struct {
	CSR RCSR
}

func (*OPAMP_Periph) BaseAddr

func (p *OPAMP_Periph) BaseAddr() uintptr

func (*OPAMP_Periph) CALON

func (p *OPAMP_Periph) CALON() RMCSR

func (*OPAMP_Periph) CALSEL

func (p *OPAMP_Periph) CALSEL() RMCSR

func (*OPAMP_Periph) FORCEVP

func (p *OPAMP_Periph) FORCEVP() RMCSR

func (*OPAMP_Periph) LOCK

func (p *OPAMP_Periph) LOCK() RMCSR

func (*OPAMP_Periph) OPAMPxEN

func (p *OPAMP_Periph) OPAMPxEN() RMCSR

func (*OPAMP_Periph) OUTCAL

func (p *OPAMP_Periph) OUTCAL() RMCSR

func (*OPAMP_Periph) PGGAIN

func (p *OPAMP_Periph) PGGAIN() RMCSR

func (*OPAMP_Periph) TCMEN

func (p *OPAMP_Periph) TCMEN() RMCSR

func (*OPAMP_Periph) TRIMOFFSETN

func (p *OPAMP_Periph) TRIMOFFSETN() RMCSR

func (*OPAMP_Periph) TRIMOFFSETP

func (p *OPAMP_Periph) TRIMOFFSETP() RMCSR

func (*OPAMP_Periph) TSTREF

func (p *OPAMP_Periph) TSTREF() RMCSR

func (*OPAMP_Periph) USERTRIM

func (p *OPAMP_Periph) USERTRIM() RMCSR

func (*OPAMP_Periph) VMSEL

func (p *OPAMP_Periph) VMSEL() RMCSR

func (*OPAMP_Periph) VMSSEL

func (p *OPAMP_Periph) VMSSEL() RMCSR

func (*OPAMP_Periph) VPSEL

func (p *OPAMP_Periph) VPSEL() RMCSR

func (*OPAMP_Periph) VPSSEL

func (p *OPAMP_Periph) VPSSEL() RMCSR

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