Documentation ¶
Overview ¶
Package flash provides higher-level functions such as reading, erasing, writing and programming the flash chip.
Index ¶
- type Flash
- func (f *Flash) EraseAt(n int64, off int64) (int64, error)
- func (f *Flash) ProgramAt(p []byte, off int64) (int, error)
- func (f *Flash) ReadAt(p []byte, off int64) (int, error)
- func (f *Flash) ReadJEDECID() (uint32, error)
- func (f *Flash) SFDP() *sfdp.SFDP
- func (f *Flash) SFDPReader() *SFDPReader
- func (f *Flash) Size() int64
- func (f *Flash) WriteAt(p []byte, off int64) (int, error)
- type SFDPReader
- type SPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flash ¶
type Flash struct {
// contains filtered or unexported fields
}
Flash provides operations for SPI flash chips.
func (*Flash) EraseAt ¶
EraseAt erases n bytes from offset off. Both parameters must be aligned to sectorSize.
func (*Flash) ReadJEDECID ¶
ReadJEDECID reads the flash chip's JEDEC ID.
func (*Flash) SFDPReader ¶
func (f *Flash) SFDPReader() *SFDPReader
SFDPReader is used to read from the SFDP address space.
type SFDPReader ¶
type SFDPReader Flash
SFDPReader is a wrapper around Flash where the ReadAt function reads from the SFDP address space.
Directories ¶
Path | Synopsis |
---|---|
Package op contains available SPI opcodes.
|
Package op contains available SPI opcodes. |
Package sfdp reads the SFDP (Serial Flash Discoverable Parameters) from a flash chip where supported.
|
Package sfdp reads the SFDP (Serial Flash Discoverable Parameters) from a flash chip where supported. |
Package spimock provides a fake SPI flash part for unit testing.
|
Package spimock provides a fake SPI flash part for unit testing. |
Click to show internal directories.
Click to hide internal directories.