ohcya

package module
v0.0.0-...-98aa507 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 8 Imported by: 0

README

ohcya

Oh, cya! A library for parsing Cypress cyacd and cyacd2 files.

Required Supplement

This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. However, because the project utilizes code licensed from contributors and other third parties, it therefore is licensed under the MIT License. See LICENSE file for more information.

Documentation

Index

Constants

View Source
const (
	FileTypeUnknown CyaFileType = iota
	FileTypeCyacd   CyaFileType = iota
	FileTypeCyacd2  CyaFileType = iota

	// These are all readable lines, we shouldn't see over a typical MCU page
	// size or things are wacky. Padded for flexibility.
	MaxRecordDataSz = (16 * 1024)

	// Current Cyacd2 File Version
	FileVersionCyacd2 = 1

	// Metadata Tags
	MetaTagAppInfo = "@appinfo"
	MetaTagEIV     = "@eiv"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInfo

type AppInfo struct {
	// contains filtered or unexported fields
}

type Cya

type Cya struct {
	Ops
	L *log.Logger
	// contains filtered or unexported fields
}

func New

func New(L *log.Logger) *Cya

func (*Cya) GetData

func (c *Cya) GetData() []byte

func (*Cya) Open

func (c *Cya) Open(p string) bool

type CyaFileType

type CyaFileType int

type Cyacd

type Cyacd struct {
	L *log.Logger
	// contains filtered or unexported fields
}

func (*Cyacd) FileType

func (c *Cyacd) FileType() CyaFileType

func (*Cyacd) GetData

func (c *Cyacd) GetData() []byte

func (*Cyacd) Header

func (c *Cyacd) Header() Header

func (*Cyacd) Metadata

func (c *Cyacd) Metadata() *Metadata

func (*Cyacd) Parse

func (c *Cyacd) Parse(x *Cya) bool

func (*Cyacd) Records

func (c *Cyacd) Records() *Records

type Cyacd2

type Cyacd2 struct {
	L *log.Logger
	// contains filtered or unexported fields
}

func (*Cyacd2) FileType

func (c *Cyacd2) FileType() CyaFileType

func (*Cyacd2) GetData

func (c *Cyacd2) GetData() []byte

func (*Cyacd2) Header

func (c *Cyacd2) Header() Header

func (*Cyacd2) Metadata

func (c *Cyacd2) Metadata() *Metadata

func (*Cyacd2) Parse

func (c *Cyacd2) Parse(x *Cya) bool

func (*Cyacd2) Records

func (c *Cyacd2) Records() *Records
type Header struct {
	// contains filtered or unexported fields
}

This combines both v1 and v2 file headers.

type Metadata

type Metadata struct {
	AppInfo
	EIV []byte
}

type Ops

type Ops interface {
	Parse(*Cya) bool
	FileType() CyaFileType
	Header() Header
	Metadata() *Metadata
	Records() *Records
	GetData() []byte
}

type Record1

type Record1 struct {
	Array_id   uint8
	Row_number uint16
	Data_len   uint16
	Data       []byte
	Checksum   uint8
}

type Record2

type Record2 struct {
	Address   uint32
	Data      []byte
	Signature []byte
}

type Records

type Records struct {
	CyaFileType
	Records interface{}
}

Jump to

Keyboard shortcuts

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