op

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: BSD-3-Clause Imports: 2 Imported by: 2

Documentation

Overview

Package op contains available SPI opcodes. The opcode is typically sent at the beginning of a SPI transaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpCode added in v0.13.0

type OpCode byte
const (
	// PageProgram programs a page on the flash chip.
	PageProgram OpCode = 0x02
	// Read reads from the flash chip.
	Read OpCode = 0x03
	// WriteDisable disables writing.
	WriteDisable OpCode = 0x04
	// ReadStatus reads the status register.
	ReadStatus OpCode = 0x05
	// WriteEnable enables writing.
	WriteEnable OpCode = 0x06
	// SectorErase erases a sector to the value 0xff.
	SectorErase OpCode = 0x20
	// ReadSFDP reads from the SFDP.
	ReadSFDP OpCode = 0x5a
	// ReadID reads the JEDEC ID.
	ReadJEDECID OpCode = 0x9f
	// PRD/RES
	PRDRES OpCode = 0xab
	// AAI is auto address increment
	AAI OpCode = 0xad
	// Enter4BA enters 4-OpCode addressing mode.
	Enter4BA OpCode = 0xb7
	// BlockErase erases a block to the value 0xff.
	BlockErase OpCode = 0xd8
	// Exit4BA exits 4-OpCode addressing mode.
	Exit4BA OpCode = 0xe9
)

func (OpCode) Bytes added in v0.13.0

func (o OpCode) Bytes() []byte

func (OpCode) String added in v0.13.0

func (o OpCode) String() string

type Status added in v0.13.0

type Status byte
const (
	WriteBusy Status = 1 << iota
	WriteEnabled
	ByteProtect0
	ByteProtect1
	ByteProtect2
	ByteProtectP3
	AutoAddressIncrement
	ByteProtectLocked
)

Status is not universally defined, but a few bits are common.

func (Status) Busy added in v0.13.0

func (status Status) Busy() bool

func (Status) String added in v0.13.0

func (status Status) String() string

Jump to

Keyboard shortcuts

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