Esempio n. 1
0
File: adc.go Progetto: go-lsst/ncs
func NewADC(name, serial string, tx int) *ADC {
	return &ADC{
		Base:   ncs.NewBase(name),
		serial: serial,
		tx:     tx,
	}
}
Esempio n. 2
0
File: led.go Progetto: go-lsst/ncs
func NewLED(name string, bus string) *LED {
	busdev := ncs.System.Device(bus)
	led := &LED{
		Base: ncs.NewBase(name),
		bus:  busdev.(Bus),
		cid:  0x1,
	}
	return led
}
Esempio n. 3
0
func New(name string, bus string) *Device {
	busdev := ncs.System.Device(bus)
	dev := &Device{
		Base: ncs.NewBase(name),
		bus:  busdev.(canbus.Bus),
	}
	dev.offsets.H = 0.0
	dev.offsets.P = 600.0
	dev.offsets.T = -20.0

	dev.chans.H = 0x3
	dev.chans.P = 0x2
	dev.chans.T = 0x4
	return dev
}
Esempio n. 4
0
func New(name string, port int, adc *ADC, dac *DAC, devices ...ncs.Device) ncs.Module {
	devs := append([]ncs.Device{adc, dac}, devices...)
	bus := &busImpl{
		Base:    ncs.NewBase(name),
		conn:    newCwrapperImpl(port),
		quit:    make(chan struct{}),
		nodes:   make([]int, 0, 2),
		adc:     adc,
		dac:     dac,
		devices: devs,
		queue:   make(chan *Message),
	}
	ncs.System.Register(bus)
	for _, dev := range bus.devices {
		ncs.System.Register(dev)
	}

	return bus
}
Esempio n. 5
0
File: dac.go Progetto: go-lsst/ncs
func NewDAC(name, serial string) *DAC {
	return &DAC{
		Base:   ncs.NewBase(name),
		serial: serial,
	}
}
Esempio n. 6
0
File: bus.go Progetto: go-lsst/ncs
func New(name, addr string) ncs.Module {
	return &sysbus{
		Base: ncs.NewBase(name),
		addr: addr,
	}
}