flash

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 flash provides interface to FLASH Registers.

Peripheral: FLASH_Periph FLASH Registers. Instances:

FLASH  mmap.FLASH_R_BASE

Registers:

0x00 32  ACR      Access control register.
0x04 32  KEYR     Key register.
0x08 32  OPTKEYR  Option key register.
0x0C 32  SR       Status register.
0x10 32  CR       Control register.
0x14 32  OPTCR[2] Option control registers.

Import:

stm32/o/f746xx/mmap

Index

Constants

View Source
const (
	LATENCYn = 0
	PRFTENn  = 8
	ARTENn   = 9
	ARTRSTn  = 11
)
View Source
const (
	EOPn    = 0
	OPERRn  = 1
	WRPERRn = 4
	PGAERRn = 5
	PGPERRn = 6
	ERSERRn = 7
	BSYn    = 16
)
View Source
const (
	PGn    = 0
	SERn   = 1
	MERn   = 2
	SNBn   = 3
	PSIZEn = 8
	STRTn  = 16
	EOPIEn = 24
	ERRIEn = 25
	LOCKn  = 31
)
View Source
const (
	OPTLOCKn = 0
	OPTSTRTn = 1
	BOR_LEVn = 2
	WWDG_SWn = 4
	IWDG_SWn = 5

	RDPn = 8

	IWDG_STDBYn = 30
	IWDG_STOPn  = 31
)

Variables

Functions

This section is empty.

Types

type ACR

type ACR uint32
const (
	LATENCY      ACR = 0x0F << 0 //+
	LATENCY_0WS  ACR = 0x00 << 0
	LATENCY_1WS  ACR = 0x01 << 0
	LATENCY_2WS  ACR = 0x02 << 0
	LATENCY_3WS  ACR = 0x03 << 0
	LATENCY_4WS  ACR = 0x04 << 0
	LATENCY_5WS  ACR = 0x05 << 0
	LATENCY_6WS  ACR = 0x06 << 0
	LATENCY_7WS  ACR = 0x07 << 0
	LATENCY_8WS  ACR = 0x08 << 0
	LATENCY_9WS  ACR = 0x09 << 0
	LATENCY_10WS ACR = 0x0A << 0
	LATENCY_11WS ACR = 0x0B << 0
	LATENCY_12WS ACR = 0x0C << 0
	LATENCY_13WS ACR = 0x0D << 0
	LATENCY_14WS ACR = 0x0E << 0
	LATENCY_15WS ACR = 0x0F << 0
	PRFTEN       ACR = 0x01 << 8  //+
	ARTEN        ACR = 0x01 << 9  //+
	ARTRST       ACR = 0x01 << 11 //+
)

func (ACR) Field

func (b ACR) Field(mask ACR) int

func (ACR) J

func (mask ACR) J(v int) ACR

type CR

type CR uint32
const (
	PG      CR = 0x01 << 0 //+
	SER     CR = 0x01 << 1 //+
	MER     CR = 0x01 << 2 //+
	SNB     CR = 0x0F << 3 //+
	SNB_0   CR = 0x01 << 3
	SNB_1   CR = 0x02 << 3
	SNB_2   CR = 0x04 << 3
	SNB_3   CR = 0x08 << 3
	PSIZE   CR = 0x03 << 8 //+
	PSIZE_0 CR = 0x01 << 8
	PSIZE_1 CR = 0x02 << 8
	STRT    CR = 0x01 << 16 //+
	EOPIE   CR = 0x01 << 24 //+
	ERRIE   CR = 0x01 << 25 //+
	LOCK    CR = 0x01 << 31 //+
)

func (CR) Field

func (b CR) Field(mask CR) int

func (CR) J

func (mask CR) J(v int) CR

type FLASH_Periph

type FLASH_Periph struct {
	ACR     RACR
	KEYR    RKEYR
	OPTKEYR ROPTKEYR
	SR      RSR
	CR      RCR
	OPTCR   [2]ROPTCR
}

func (*FLASH_Periph) ARTEN

func (p *FLASH_Periph) ARTEN() RMACR

func (*FLASH_Periph) ARTRST

func (p *FLASH_Periph) ARTRST() RMACR

func (*FLASH_Periph) BOR_LEV

func (p *FLASH_Periph) BOR_LEV(n int) RMOPTCR

func (*FLASH_Periph) BSY

func (p *FLASH_Periph) BSY() RMSR

func (*FLASH_Periph) BaseAddr

func (p *FLASH_Periph) BaseAddr() uintptr

func (*FLASH_Periph) EOP

func (p *FLASH_Periph) EOP() RMSR

func (*FLASH_Periph) EOPIE

func (p *FLASH_Periph) EOPIE() RMCR

func (*FLASH_Periph) ERRIE

func (p *FLASH_Periph) ERRIE() RMCR

func (*FLASH_Periph) ERSERR

func (p *FLASH_Periph) ERSERR() RMSR

func (*FLASH_Periph) IWDG_STDBY

func (p *FLASH_Periph) IWDG_STDBY(n int) RMOPTCR

func (*FLASH_Periph) IWDG_STOP

func (p *FLASH_Periph) IWDG_STOP(n int) RMOPTCR

func (*FLASH_Periph) IWDG_SW

func (p *FLASH_Periph) IWDG_SW(n int) RMOPTCR

func (*FLASH_Periph) LATENCY

func (p *FLASH_Periph) LATENCY() RMACR

func (*FLASH_Periph) LOCK

func (p *FLASH_Periph) LOCK() RMCR

func (*FLASH_Periph) MER

func (p *FLASH_Periph) MER() RMCR

func (*FLASH_Periph) OPERR

func (p *FLASH_Periph) OPERR() RMSR

func (*FLASH_Periph) OPTLOCK

func (p *FLASH_Periph) OPTLOCK(n int) RMOPTCR

func (*FLASH_Periph) OPTSTRT

func (p *FLASH_Periph) OPTSTRT(n int) RMOPTCR

func (*FLASH_Periph) PG

func (p *FLASH_Periph) PG() RMCR

func (*FLASH_Periph) PGAERR

func (p *FLASH_Periph) PGAERR() RMSR

func (*FLASH_Periph) PGPERR

func (p *FLASH_Periph) PGPERR() RMSR

func (*FLASH_Periph) PRFTEN

func (p *FLASH_Periph) PRFTEN() RMACR

func (*FLASH_Periph) PSIZE

func (p *FLASH_Periph) PSIZE() RMCR

func (*FLASH_Periph) RDP

func (p *FLASH_Periph) RDP(n int) RMOPTCR

func (*FLASH_Periph) SER

func (p *FLASH_Periph) SER() RMCR

func (*FLASH_Periph) SNB

func (p *FLASH_Periph) SNB() RMCR

func (*FLASH_Periph) STRT

func (p *FLASH_Periph) STRT() RMCR

func (*FLASH_Periph) WRPERR

func (p *FLASH_Periph) WRPERR() RMSR

func (*FLASH_Periph) WWDG_SW

func (p *FLASH_Periph) WWDG_SW(n int) RMOPTCR

type KEYR

type KEYR uint32

func (KEYR) Field

func (b KEYR) Field(mask KEYR) int

func (KEYR) J

func (mask KEYR) J(v int) KEYR

type OPTCR

type OPTCR uint32
const (
	OPTLOCK   OPTCR = 0x01 << 0 //+
	OPTSTRT   OPTCR = 0x01 << 1 //+
	BOR_LEV   OPTCR = 0x03 << 2 //+
	BOR_LEV_0 OPTCR = 0x01 << 2
	BOR_LEV_1 OPTCR = 0x02 << 2
	WWDG_SW   OPTCR = 0x01 << 4 //+
	IWDG_SW   OPTCR = 0x01 << 5 //+

	RDP   OPTCR = 0xFF << 8 //+
	RDP_0 OPTCR = 0x01 << 8
	RDP_1 OPTCR = 0x02 << 8
	RDP_2 OPTCR = 0x04 << 8
	RDP_3 OPTCR = 0x08 << 8
	RDP_4 OPTCR = 0x10 << 8
	RDP_5 OPTCR = 0x20 << 8
	RDP_6 OPTCR = 0x40 << 8
	RDP_7 OPTCR = 0x80 << 8

	IWDG_STDBY OPTCR = 0x01 << 30 //+
	IWDG_STOP  OPTCR = 0x01 << 31 //+
)

func (OPTCR) Field

func (b OPTCR) Field(mask OPTCR) int

func (OPTCR) J

func (mask OPTCR) J(v int) OPTCR

type OPTKEYR

type OPTKEYR uint32

func (OPTKEYR) Field

func (b OPTKEYR) Field(mask OPTKEYR) int

func (OPTKEYR) J

func (mask OPTKEYR) J(v int) OPTKEYR

type RACR

type RACR struct{ mmio.U32 }

func (*RACR) AtomicClearBits

func (r *RACR) AtomicClearBits(mask ACR)

func (*RACR) AtomicSetBits

func (r *RACR) AtomicSetBits(mask ACR)

func (*RACR) AtomicStoreBits

func (r *RACR) AtomicStoreBits(mask, b ACR)

func (*RACR) Bits

func (r *RACR) Bits(mask ACR) ACR

func (*RACR) ClearBits

func (r *RACR) ClearBits(mask ACR)

func (*RACR) Load

func (r *RACR) Load() ACR

func (*RACR) SetBits

func (r *RACR) SetBits(mask ACR)

func (*RACR) Store

func (r *RACR) Store(b ACR)

func (*RACR) StoreBits

func (r *RACR) StoreBits(mask, b ACR)

type RCR

type RCR struct{ mmio.U32 }

func (*RCR) AtomicClearBits

func (r *RCR) AtomicClearBits(mask CR)

func (*RCR) AtomicSetBits

func (r *RCR) AtomicSetBits(mask CR)

func (*RCR) AtomicStoreBits

func (r *RCR) AtomicStoreBits(mask, b CR)

func (*RCR) Bits

func (r *RCR) Bits(mask CR) CR

func (*RCR) ClearBits

func (r *RCR) ClearBits(mask CR)

func (*RCR) Load

func (r *RCR) Load() CR

func (*RCR) SetBits

func (r *RCR) SetBits(mask CR)

func (*RCR) Store

func (r *RCR) Store(b CR)

func (*RCR) StoreBits

func (r *RCR) StoreBits(mask, b CR)

type RKEYR

type RKEYR struct{ mmio.U32 }

func (*RKEYR) AtomicClearBits

func (r *RKEYR) AtomicClearBits(mask KEYR)

func (*RKEYR) AtomicSetBits

func (r *RKEYR) AtomicSetBits(mask KEYR)

func (*RKEYR) AtomicStoreBits

func (r *RKEYR) AtomicStoreBits(mask, b KEYR)

func (*RKEYR) Bits

func (r *RKEYR) Bits(mask KEYR) KEYR

func (*RKEYR) ClearBits

func (r *RKEYR) ClearBits(mask KEYR)

func (*RKEYR) Load

func (r *RKEYR) Load() KEYR

func (*RKEYR) SetBits

func (r *RKEYR) SetBits(mask KEYR)

func (*RKEYR) Store

func (r *RKEYR) Store(b KEYR)

func (*RKEYR) StoreBits

func (r *RKEYR) StoreBits(mask, b KEYR)

type RMACR

type RMACR struct{ mmio.UM32 }

func (RMACR) Load

func (rm RMACR) Load() ACR

func (RMACR) Store

func (rm RMACR) Store(b ACR)

type RMCR

type RMCR struct{ mmio.UM32 }

func (RMCR) Load

func (rm RMCR) Load() CR

func (RMCR) Store

func (rm RMCR) Store(b CR)

type RMKEYR

type RMKEYR struct{ mmio.UM32 }

func (RMKEYR) Load

func (rm RMKEYR) Load() KEYR

func (RMKEYR) Store

func (rm RMKEYR) Store(b KEYR)

type RMOPTCR

type RMOPTCR struct{ mmio.UM32 }

func (RMOPTCR) Load

func (rm RMOPTCR) Load() OPTCR

func (RMOPTCR) Store

func (rm RMOPTCR) Store(b OPTCR)

type RMOPTKEYR

type RMOPTKEYR struct{ mmio.UM32 }

func (RMOPTKEYR) Load

func (rm RMOPTKEYR) Load() OPTKEYR

func (RMOPTKEYR) Store

func (rm RMOPTKEYR) Store(b OPTKEYR)

type RMSR

type RMSR struct{ mmio.UM32 }

func (RMSR) Load

func (rm RMSR) Load() SR

func (RMSR) Store

func (rm RMSR) Store(b SR)

type ROPTCR

type ROPTCR struct{ mmio.U32 }

func (*ROPTCR) AtomicClearBits

func (r *ROPTCR) AtomicClearBits(mask OPTCR)

func (*ROPTCR) AtomicSetBits

func (r *ROPTCR) AtomicSetBits(mask OPTCR)

func (*ROPTCR) AtomicStoreBits

func (r *ROPTCR) AtomicStoreBits(mask, b OPTCR)

func (*ROPTCR) Bits

func (r *ROPTCR) Bits(mask OPTCR) OPTCR

func (*ROPTCR) ClearBits

func (r *ROPTCR) ClearBits(mask OPTCR)

func (*ROPTCR) Load

func (r *ROPTCR) Load() OPTCR

func (*ROPTCR) SetBits

func (r *ROPTCR) SetBits(mask OPTCR)

func (*ROPTCR) Store

func (r *ROPTCR) Store(b OPTCR)

func (*ROPTCR) StoreBits

func (r *ROPTCR) StoreBits(mask, b OPTCR)

type ROPTKEYR

type ROPTKEYR struct{ mmio.U32 }

func (*ROPTKEYR) AtomicClearBits

func (r *ROPTKEYR) AtomicClearBits(mask OPTKEYR)

func (*ROPTKEYR) AtomicSetBits

func (r *ROPTKEYR) AtomicSetBits(mask OPTKEYR)

func (*ROPTKEYR) AtomicStoreBits

func (r *ROPTKEYR) AtomicStoreBits(mask, b OPTKEYR)

func (*ROPTKEYR) Bits

func (r *ROPTKEYR) Bits(mask OPTKEYR) OPTKEYR

func (*ROPTKEYR) ClearBits

func (r *ROPTKEYR) ClearBits(mask OPTKEYR)

func (*ROPTKEYR) Load

func (r *ROPTKEYR) Load() OPTKEYR

func (*ROPTKEYR) SetBits

func (r *ROPTKEYR) SetBits(mask OPTKEYR)

func (*ROPTKEYR) Store

func (r *ROPTKEYR) Store(b OPTKEYR)

func (*ROPTKEYR) StoreBits

func (r *ROPTKEYR) StoreBits(mask, b OPTKEYR)

type RSR

type RSR struct{ mmio.U32 }

func (*RSR) AtomicClearBits

func (r *RSR) AtomicClearBits(mask SR)

func (*RSR) AtomicSetBits

func (r *RSR) AtomicSetBits(mask SR)

func (*RSR) AtomicStoreBits

func (r *RSR) AtomicStoreBits(mask, b SR)

func (*RSR) Bits

func (r *RSR) Bits(mask SR) SR

func (*RSR) ClearBits

func (r *RSR) ClearBits(mask SR)

func (*RSR) Load

func (r *RSR) Load() SR

func (*RSR) SetBits

func (r *RSR) SetBits(mask SR)

func (*RSR) Store

func (r *RSR) Store(b SR)

func (*RSR) StoreBits

func (r *RSR) StoreBits(mask, b SR)

type SR

type SR uint32
const (
	EOP    SR = 0x01 << 0  //+
	OPERR  SR = 0x01 << 1  //+
	WRPERR SR = 0x01 << 4  //+
	PGAERR SR = 0x01 << 5  //+
	PGPERR SR = 0x01 << 6  //+
	ERSERR SR = 0x01 << 7  //+
	BSY    SR = 0x01 << 16 //+
)

func (SR) Field

func (b SR) Field(mask SR) int

func (SR) J

func (mask SR) J(v int) SR

Jump to

Keyboard shortcuts

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