cores

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 21 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMonitorSettings

func GetMonitorSettings(protocol string, boardProperties *properties.Map) *properties.Map

GetMonitorSettings returns the settings for the pluggable monitor of the given protocol and set of board properties.

Types

type Board

type Board struct {
	BoardID         string
	Properties      *properties.Map  `json:"-"`
	PlatformRelease *PlatformRelease `json:"-"`
	// contains filtered or unexported fields
}

Board represents a board loaded from an installed platform

func (*Board) FQBN

func (b *Board) FQBN() string

FQBN return the Fully-Qualified-Board-Name for the default configuration of this board

func (*Board) GeneratePropertiesForConfiguration

func (b *Board) GeneratePropertiesForConfiguration(config string) (*properties.Map, error)

GeneratePropertiesForConfiguration returns the board properties for a particular configuration. The parameter is the latest part of the FQBN, for example if the full FQBN is "arduino:avr:mega:cpu=atmega2560" the config part must be "cpu=atmega2560". FIXME: deprecated, use GetBuildProperties instead

func (*Board) GetBuildProperties

func (b *Board) GetBuildProperties(fqbn *FQBN) (*properties.Map, error)

GetBuildProperties returns the build properties and the build platform for the Board with the configuration passed as parameter.

func (*Board) GetConfigOptionValues

func (b *Board) GetConfigOptionValues(option string) *properties.Map

GetConfigOptionValues returns an OrderedMap of possible values for a specific configuratio options for this board. The returned map will have key and value as option value and option value name, respectively.

func (*Board) GetConfigOptions

func (b *Board) GetConfigOptions() *properties.Map

GetConfigOptions returns an OrderedMap of configuration options for this board. The returned map will have key and value as option id and option name, respectively.

func (*Board) GetDefaultProgrammerID

func (b *Board) GetDefaultProgrammerID() string

GetDefaultProgrammerID returns the board's default programmer as defined in 'programmer.default' property of the board. If the board has no default programmer the empty string is returned.

func (*Board) GetIdentificationProperties

func (b *Board) GetIdentificationProperties() []*properties.Map

GetIdentificationProperties calculates and returns a list of properties sets containing the properties required to identify the board. The returned sets must not be changed by the caller.

func (*Board) HasUsbID

func (b *Board) HasUsbID(reqVid, reqPid string) bool

HasUsbID returns true if the board match the usb vid and pid parameters

func (*Board) IdentifyBoardConfiguration

func (b *Board) IdentifyBoardConfiguration(query *properties.Map) *properties.Map

IdentifyBoardConfiguration returns the configuration of the board that can be deduced from the given upload port identification properties

func (*Board) IsBoardMatchingIDProperties

func (b *Board) IsBoardMatchingIDProperties(query *properties.Map) bool

IsBoardMatchingIDProperties returns true if the board match the given upload port identification properties

func (*Board) IsHidden

func (b *Board) IsHidden() bool

IsHidden returns true if the board is marked as hidden in the platform

func (*Board) Name

func (b *Board) Name() string

Name returns the board name as defined in boards.txt properties

func (*Board) String

func (b *Board) String() string

type BoardManifest

type BoardManifest struct {
	Name string             `json:"-"`
	ID   []*BoardManifestID `json:"-"`
}

BoardManifest contains information about a board. These metadata are usually provided by the package_index.json

func (*BoardManifest) HasUsbID

func (bm *BoardManifest) HasUsbID(vid, pid string) bool

HasUsbID returns true if the BoardManifes contains the specified USB id as identification for this board. usbID should be in the format "0000:0000"

type BoardManifestID

type BoardManifestID struct {
	USB string `json:"-"`
}

BoardManifestID contains information on how to identify a board. These metadata are usually provided by the package_index.json

type DiscoveryDependencies

type DiscoveryDependencies []*DiscoveryDependency

DiscoveryDependencies is a list of DiscoveryDependency

func (DiscoveryDependencies) Sort

func (d DiscoveryDependencies) Sort()

Sort the DiscoveryDependencies by name.

type DiscoveryDependency

type DiscoveryDependency struct {
	Name     string
	Packager string
}

DiscoveryDependency identifies a specific discovery, version is omitted since the latest version will always be used

func (*DiscoveryDependency) String

func (d *DiscoveryDependency) String() string

type FQBN

type FQBN struct {
	Package      string
	PlatformArch string
	BoardID      string
	Configs      *properties.Map
}

FQBN represents a Board with a specific configuration

func MustParseFQBN

func MustParseFQBN(fqbnIn string) *FQBN

MustParseFQBN extract an FQBN object from the input string or panics if the input is not a valid FQBN.

func ParseFQBN

func ParseFQBN(fqbnIn string) (*FQBN, error)

ParseFQBN extract an FQBN object from the input string

func (*FQBN) Clone

func (fqbn *FQBN) Clone() *FQBN

Clone returns a copy of this FQBN.

func (*FQBN) Match

func (fqbn *FQBN) Match(target *FQBN) bool

Match check if the target FQBN corresponds to the receiver one. The core parts are checked for exact equality while board options are loosely matched: the set of boards options of the target must be fully contained within the one of the receiver and their values must be equal.

func (*FQBN) String

func (fqbn *FQBN) String() string

func (*FQBN) StringWithoutConfig

func (fqbn *FQBN) StringWithoutConfig() string

StringWithoutConfig returns the FQBN without the Config part

type Flavor

type Flavor struct {
	OS       string `json:"os"` // The OS Supported by this flavor.
	Resource *resources.DownloadResource
}

Flavor represents a flavor of a Tool version.

type MonitorDependencies

type MonitorDependencies []*MonitorDependency

MonitorDependencies is a list of MonitorDependency

func (MonitorDependencies) Sort

func (d MonitorDependencies) Sort()

Sort the DiscoveryDependencies by name.

type MonitorDependency

type MonitorDependency struct {
	Name     string
	Packager string
}

MonitorDependency identifies a specific monitor, version is omitted since the latest version will always be used

func (*MonitorDependency) String

func (d *MonitorDependency) String() string

type Package

type Package struct {
	Name       string               // Name of the package.
	Maintainer string               // Name of the maintainer.
	WebsiteURL string               // Website of maintainer.
	URL        string               // origin URL for package index json file.
	Email      string               // Email of maintainer.
	Platforms  map[string]*Platform // The platforms in the system.
	Tools      map[string]*Tool     // The tools in the system.
	Help       PackageHelp          `json:"-"`
	Packages   Packages             `json:"-"`
}

Package represents a package in the system.

func (*Package) GetOrCreatePlatform

func (targetPackage *Package) GetOrCreatePlatform(architecture string) *Platform

GetOrCreatePlatform returns the Platform object with the specified architecture or creates a new one if not found

func (*Package) GetOrCreateTool

func (targetPackage *Package) GetOrCreateTool(name string) *Tool

GetOrCreateTool returns the Tool object with the specified name or creates a new one if not found

func (*Package) String

func (targetPackage *Package) String() string

type PackageHelp

type PackageHelp struct {
	Online string `json:"online,omitempty"`
}

PackageHelp contains info on how to reach maintainers for help

type Packages

type Packages map[string]*Package // Maps packager name to Package

Packages represents a set of Packages

func NewPackages

func NewPackages() Packages

NewPackages creates a new Packages object

func (Packages) GetOrCreatePackage

func (packages Packages) GetOrCreatePackage(packager string) *Package

GetOrCreatePackage returns the specified Package or creates an empty one filling all the cross-references

func (Packages) GetPlatformReleaseDiscoveryDependencies

func (packages Packages) GetPlatformReleaseDiscoveryDependencies(release *PlatformRelease) ([]*ToolRelease, error)

GetPlatformReleaseDiscoveryDependencies returns the discovery releases needed by the specified PlatformRelease

func (Packages) GetPlatformReleaseMonitorDependencies

func (packages Packages) GetPlatformReleaseMonitorDependencies(release *PlatformRelease) ([]*ToolRelease, error)

GetPlatformReleaseMonitorDependencies returns the monitor releases needed by the specified PlatformRelease

func (Packages) GetPlatformReleaseToolDependencies

func (packages Packages) GetPlatformReleaseToolDependencies(release *PlatformRelease) ([]*ToolRelease, error)

GetPlatformReleaseToolDependencies returns the tool releases needed by the specified PlatformRelease

func (Packages) Names

func (packages Packages) Names() []string

Names returns the array containing the name of the packages.

type Platform

type Platform struct {
	Architecture      string // The name of the architecture of this package.
	Name              string
	Category          string
	Releases          map[semver.NormalizedString]*PlatformRelease // The Releases of this platform, labeled by version.
	Package           *Package                                     `json:"-"`
	ManuallyInstalled bool                                         // true if the Platform has been installed without the CLI
	Deprecated        bool                                         // true if the Platform has been deprecated
	Indexed           bool                                         // true if the Platform has been indexed from additional-urls
}

Platform represents a platform package.

func (*Platform) FindReleaseWithVersion

func (platform *Platform) FindReleaseWithVersion(version *semver.Version) *PlatformRelease

FindReleaseWithVersion returns the specified release corresponding the provided version, or nil if not found.

func (*Platform) GetAllInstalled

func (platform *Platform) GetAllInstalled() []*PlatformRelease

GetAllInstalled returns all installed PlatformRelease

func (*Platform) GetAllReleases

func (platform *Platform) GetAllReleases() []*PlatformRelease

GetAllReleases returns all the releases of this platform, or an empty slice if no releases are available

func (*Platform) GetAllReleasesVersions

func (platform *Platform) GetAllReleasesVersions() []*semver.Version

GetAllReleasesVersions returns all the version numbers in this Platform Package.

func (*Platform) GetLatestRelease

func (platform *Platform) GetLatestRelease() *PlatformRelease

GetLatestRelease returns the latest release of this platform, or nil if no releases are available

func (*Platform) GetOrCreateRelease

func (platform *Platform) GetOrCreateRelease(version *semver.Version) *PlatformRelease

GetOrCreateRelease returns the specified release corresponding the provided version, or creates a new one if not found.

func (*Platform) String

func (platform *Platform) String() string

type PlatformRelease

type PlatformRelease struct {
	Resource              *resources.DownloadResource
	Version               *semver.Version
	BoardsManifest        []*BoardManifest
	ToolDependencies      ToolDependencies
	DiscoveryDependencies DiscoveryDependencies
	MonitorDependencies   MonitorDependencies
	Help                  PlatformReleaseHelp `json:"-"`
	Platform              *Platform           `json:"-"`
	Properties            *properties.Map     `json:"-"`
	Boards                map[string]*Board   `json:"-"`

	Programmers             map[string]*Programmer        `json:"-"`
	Menus                   *properties.Map               `json:"-"`
	InstallDir              *paths.Path                   `json:"-"`
	IsIDEBundled            bool                          `json:"-"`
	IsTrusted               bool                          `json:"-"`
	PluggableDiscoveryAware bool                          `json:"-"` // true if the Platform supports pluggable discovery (no compatibility layer required)
	Monitors                map[string]*MonitorDependency `json:"-"`
	MonitorsDevRecipes      map[string]string             `json:"-"`
	// contains filtered or unexported fields
}

PlatformRelease represents a release of a plaform package.

func (*PlatformRelease) GetBoards

func (release *PlatformRelease) GetBoards() []*Board

GetBoards returns the boards in this platforms in the order they are defined in the platform.txt file.

func (*PlatformRelease) GetLibrariesDir

func (release *PlatformRelease) GetLibrariesDir() *paths.Path

GetLibrariesDir returns the path to the core libraries or nil if not present

func (*PlatformRelease) GetOrCreateBoard

func (release *PlatformRelease) GetOrCreateBoard(boardID string) *Board

GetOrCreateBoard returns the Board object with the specified boardID or creates a new one if not found

func (*PlatformRelease) HasMetadata

func (release *PlatformRelease) HasMetadata() bool

HasMetadata returns true if the PlatformRelease installation dir contains the installed.json file

func (*PlatformRelease) IsInstalled

func (release *PlatformRelease) IsInstalled() bool

IsInstalled returns true if the PlatformRelease is installed

func (*PlatformRelease) MarshalJSON

func (release *PlatformRelease) MarshalJSON() ([]byte, error)

MarshalJSON provides a more user friendly serialization for PlatformRelease objects.

func (*PlatformRelease) RequiresToolRelease

func (release *PlatformRelease) RequiresToolRelease(toolRelease *ToolRelease) bool

RequiresToolRelease returns true if the PlatformRelease requires the toolReleased passed as parameter

func (*PlatformRelease) RuntimeProperties

func (release *PlatformRelease) RuntimeProperties() *properties.Map

RuntimeProperties returns the runtime properties for this PlatformRelease

func (*PlatformRelease) String

func (release *PlatformRelease) String() string

func (*PlatformRelease) ToRPCPlatformReference

func (release *PlatformRelease) ToRPCPlatformReference() *rpc.InstalledPlatformReference

ToRPCPlatformReference creates a gRPC PlatformReference message out of this PlatformRelease

type PlatformReleaseHelp

type PlatformReleaseHelp struct {
	Online string `json:"-"`
}

PlatformReleaseHelp represents the help URL for this Platform release

type Programmer

type Programmer struct {
	Name            string
	Properties      *properties.Map
	PlatformRelease *PlatformRelease
}

Programmer represents an external programmer

type Tool

type Tool struct {
	Name     string                                   `json:"name"`     // The Name of the Tool.
	Releases map[semver.NormalizedString]*ToolRelease `json:"releases"` // Maps Version to Release.
	Package  *Package                                 `json:"-"`
}

Tool represents a single Tool, part of a Package.

func (*Tool) FindReleaseWithRelaxedVersion

func (tool *Tool) FindReleaseWithRelaxedVersion(version *semver.RelaxedVersion) *ToolRelease

FindReleaseWithRelaxedVersion returns the specified release corresponding the provided version, or nil if not found.

func (*Tool) GetAllReleasesVersions

func (tool *Tool) GetAllReleasesVersions() []*semver.RelaxedVersion

GetAllReleasesVersions returns all the version numbers in this Core Package.

func (*Tool) GetLatestInstalled

func (tool *Tool) GetLatestInstalled() *ToolRelease

GetLatestInstalled returns the latest installed ToolRelease for the Tool, or nil if no releases are installed.

func (*Tool) GetOrCreateRelease

func (tool *Tool) GetOrCreateRelease(version *semver.RelaxedVersion) *ToolRelease

GetOrCreateRelease returns the ToolRelease object with the specified version or creates a new one if not found

func (*Tool) LatestRelease

func (tool *Tool) LatestRelease() *ToolRelease

LatestRelease obtains latest version of a core package.

func (*Tool) String

func (tool *Tool) String() string

type ToolDependencies

type ToolDependencies []*ToolDependency

ToolDependencies is a set of tool dependency

func (ToolDependencies) Sort

func (deps ToolDependencies) Sort()

Sort sorts the ToolDependencies by name and (if multiple instance of the same tool is required) by version.

type ToolDependency

type ToolDependency struct {
	ToolName     string
	ToolVersion  *semver.RelaxedVersion
	ToolPackager string
}

ToolDependency is a tuple that uniquely identifies a specific version of a Tool

func (*ToolDependency) InternalUniqueIdentifier

func (dep *ToolDependency) InternalUniqueIdentifier(platformIndexURL *url.URL) string

InternalUniqueIdentifier returns the unique identifier for this object

func (*ToolDependency) String

func (dep *ToolDependency) String() string

type ToolRelease

type ToolRelease struct {
	Version    *semver.RelaxedVersion `json:"version"` // The version number of this Release.
	Flavors    []*Flavor              `json:"systems"` // Maps OS to Flavor
	Tool       *Tool                  `json:"-"`
	InstallDir *paths.Path            `json:"-"`
}

ToolRelease represents a single release of a tool

func (*ToolRelease) GetCompatibleFlavour

func (tr *ToolRelease) GetCompatibleFlavour() *resources.DownloadResource

GetCompatibleFlavour returns the downloadable resource compatible with the running O.S.

func (*ToolRelease) GetFlavourCompatibleWith

func (tr *ToolRelease) GetFlavourCompatibleWith(osName, osArch string) *resources.DownloadResource

GetFlavourCompatibleWith returns the downloadable resource compatible with the specified O.S.

func (*ToolRelease) IsInstalled

func (tr *ToolRelease) IsInstalled() bool

IsInstalled returns true if the ToolRelease is installed

func (*ToolRelease) RuntimeProperties

func (tr *ToolRelease) RuntimeProperties() *properties.Map

RuntimeProperties returns the runtime properties for this tool

func (*ToolRelease) String

func (tr *ToolRelease) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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