controllers

package
v0.0.0-...-947ae56 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NO_BUS_RESET = false
	BUS_RESET    = true
)
View Source
const (
	NODE_OP_NONE = iota
	NODE_OP_UPLOAD_FLASH
	NODE_OP_DOWNLOAD_FLASH
)
View Source
const (
	FLASH_ORIGIN     uint32 = 0
	FLASH_LENGTH     uint32 = 0x40000
	FLASH_APP_ORIGIN uint32 = FLASH_ORIGIN + 0x2000 // 8K bootloader
	FLASH_APP_LENGTH uint32 = FLASH_LENGTH - 0x2000
	FLASH_PAGE_SIZE  uint32 = 64
)

* Currently there is only one model for nodes, so we can use consts. * In the future we will need a 'per-device' approach.

View Source
const DEFAULT_EXPECT_TIMEOUT = 3 * time.Second

Variables

View Source
var EventServer *socket.Server
View Source
var FLASH_DEVICE_SIGNATURE = [4]byte{0x10, 0x01, 0x00, 0x05}
View Source
var PingerEnabled = false
View Source
var SystemProperties *properties.Properties = properties.New()

Functions

func MilliAmpEstimation

func MilliAmpEstimation(c uint16) uint

Types

type NocanNetworkController

type NocanNetworkController struct {
	DeviceInfo *device.Information
	// contains filtered or unexported fields
}

func NewNocanNetworkController

func NewNocanNetworkController() *NocanNetworkController

func (*NocanNetworkController) AutoPowerOffOnTermination

func (nc *NocanNetworkController) AutoPowerOffOnTermination(set bool)

func (*NocanNetworkController) ExpectSystemMessage

func (nc *NocanNetworkController) ExpectSystemMessage(node *models.Node, fn nocan.MessageType) (*nocan.Message, error)

func (*NocanNetworkController) Initialize

func (nc *NocanNetworkController) Initialize(with_reset bool, spi_speed uint) error

func (*NocanNetworkController) Publish

func (nc *NocanNetworkController) Publish(node nocan.NodeId, channel nocan.ChannelId, data []byte) error

func (*NocanNetworkController) ReceiveMessage

func (nc *NocanNetworkController) ReceiveMessage(nodeId nocan.NodeId) (*nocan.Message, error)

func (*NocanNetworkController) RequestPowerStatusUpdate

func (nc *NocanNetworkController) RequestPowerStatusUpdate()

func (*NocanNetworkController) RunPinger

func (nc *NocanNetworkController) RunPinger(interval time.Duration)

func (*NocanNetworkController) RunPowerMonitor

func (nc *NocanNetworkController) RunPowerMonitor(interval time.Duration)

func (*NocanNetworkController) SendMessage

func (nc *NocanNetworkController) SendMessage(msg *nocan.Message) error

func (*NocanNetworkController) SendSystemMessage

func (nc *NocanNetworkController) SendSystemMessage(nodeId nocan.NodeId, fn nocan.MessageType, pm uint8, data []byte) error

func (*NocanNetworkController) Serve

func (nc *NocanNetworkController) Serve() error

func (*NocanNetworkController) SetCurrentLimit

func (nci *NocanNetworkController) SetCurrentLimit(limit uint16)

func (*NocanNetworkController) SetPower

func (nc *NocanNetworkController) SetPower(power_on bool)

func (*NocanNetworkController) SetTerminationResistor

func (nci *NocanNetworkController) SetTerminationResistor(set bool)

type NodeContext

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

type NodeFirmwareOperation

type NodeFirmwareOperation struct {
	Client    *socket.ClientDescriptor
	Operation int // NODE_OP_...
	Progress  *socket.NodeFirmwareProgressEvent
	Firmware  *socket.NodeFirmwareEvent
}

Jump to

Keyboard shortcuts

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