Documentation ¶
Overview ¶
SPDX-License-Identifier: MIT Copyright (c) 2021 Brian Starkey <stark3y@gmail.com>
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OpcodeSync [4]byte = [4]byte{'S', 'Y', 'N', 'C'} OpcodeRead [4]byte = [4]byte{'R', 'E', 'A', 'D'} OpcodeCsum [4]byte = [4]byte{'C', 'S', 'U', 'M'} OpcodeCRC [4]byte = [4]byte{'C', 'R', 'C', 'C'} OpcodeErase [4]byte = [4]byte{'E', 'R', 'A', 'S'} OpcodeWrite [4]byte = [4]byte{'W', 'R', 'I', 'T'} OpcodeSeal [4]byte = [4]byte{'S', 'E', 'A', 'L'} OpcodeGo [4]byte = [4]byte{'G', 'O', 'G', 'O'} OpcodeInfo [4]byte = [4]byte{'I', 'N', 'F', 'O'} ResponseSync [4]byte = [4]byte{'P', 'I', 'C', 'O'} ResponseSyncWota [4]byte = [4]byte{'W', 'O', 'T', 'A'} ResponseOK [4]byte = [4]byte{'O', 'K', 'O', 'K'} ResponseErr [4]byte = [4]byte{'E', 'R', 'R', '!'} )
View Source
var ErrNotSynced error = errors.New("not synced")
Functions ¶
This section is empty.
Types ¶
type CRCCommand ¶
func (*CRCCommand) Execute ¶
func (c *CRCCommand) Execute(rw io.ReadWriter) error
type CsumCommand ¶
func (*CsumCommand) Execute ¶
func (c *CsumCommand) Execute(rw io.ReadWriter) error
type EraseCommand ¶
func (*EraseCommand) Execute ¶
func (c *EraseCommand) Execute(rw io.ReadWriter) error
type InfoCommand ¶
type InfoCommand struct { FlashAddr uint32 FlashSize uint32 EraseSize uint32 WriteSize uint32 MaxDataLen uint32 }
func (*InfoCommand) Execute ¶
func (c *InfoCommand) Execute(rw io.ReadWriter) error
type ReadCommand ¶
func (*ReadCommand) Execute ¶
func (c *ReadCommand) Execute(rw io.ReadWriter) error
type SealCommand ¶
func NewSealCommand ¶
func NewSealCommand(addr uint32, data []byte) *SealCommand
func (*SealCommand) Execute ¶
func (c *SealCommand) Execute(rw io.ReadWriter) error
type SyncCommand ¶
type SyncCommand struct { }
func (*SyncCommand) Execute ¶
func (c *SyncCommand) Execute(rw io.ReadWriter) error
type WriteCommand ¶
func (*WriteCommand) Execute ¶
func (c *WriteCommand) Execute(rw io.ReadWriter) error
Click to show internal directories.
Click to hide internal directories.