Documentation ¶
Index ¶
- Constants
- type Channel
- type Controller
- func (c Controller) BulkFade(m *Mask, from, to float64, dur time.Duration) error
- func (c Controller) BulkOn(m *Mask) error
- func (c Controller) BulkSetBrightness(m *Mask, val float64) error
- func (c Controller) BulkSetBrightnessAbs(m *Mask, val byte) error
- func (c Controller) BulkSetEffect(m *Mask, effect Effect) error
- func (c Controller) Fade(ch Channel, from, to float64, dur time.Duration) error
- func (c Controller) FadeWithEffect(ch Channel, from, to float64, dur time.Duration, effect Effect) error
- func (c Controller) On(ch Channel) error
- func (c *Controller) OpenPort(conf *serial.Config) error
- func (c Controller) SetBrightness(ch Channel, val float64) error
- func (c Controller) SetBrightnessAbs(ch Channel, val byte) error
- func (c Controller) SetEffect(ch Channel, effect Effect) error
- func (c Controller) WriteHeartbeat() error
- type Effect
- type Mask
Constants ¶
const DefaultHeartbeatRate = time.Millisecond * 500
DefaultHeartbeatRate represents the timing rate at which LOR vendor software sends a heartbeat to the hardware. This has been determined by monitoring the serial port connection.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel byte
Channel represents a unique, addressable channel belonging to a given Controller's namespace.
type Controller ¶
type Controller struct { ID byte // contains filtered or unexported fields }
Controller represents a LOR unit. ID is the unit's network ID as externally configured.
func (Controller) BulkFade ¶
BulkFade writes a multi command payload to fade all masked channels brightness from and to the specified values within the specified duration.
func (Controller) BulkOn ¶
func (c Controller) BulkOn(m *Mask) error
BulkOn writes a multi command payload to set all masked channels to 100% brightness. This saves 1 byte over a BulkSetBrightness call.
func (Controller) BulkSetBrightness ¶
func (c Controller) BulkSetBrightness(m *Mask, val float64) error
BulkSetBrightness writes a multi command payload to set all masked channels brightness to the specified value.
func (Controller) BulkSetBrightnessAbs ¶ added in v0.0.2
func (c Controller) BulkSetBrightnessAbs(m *Mask, val byte) error
BulkSetBrightnessAbs writes a multi command payload to set all masked channels brightness to the specified absolute value.
func (Controller) BulkSetEffect ¶
func (c Controller) BulkSetEffect(m *Mask, effect Effect) error
BulkSetEffect writes a multi command payload to set all masked channels active effect.
func (Controller) Fade ¶
Fade writes a command payload to fade a channel's brightness from and to the specified values within the specified duration.
func (Controller) FadeWithEffect ¶
func (c Controller) FadeWithEffect(ch Channel, from, to float64, dur time.Duration, effect Effect) error
FadeWithEffect writes a command payload to fade a channel's brightness from and to the specified values within the specified duration. The effect will be applied alongside the fade effect.
func (Controller) On ¶
func (c Controller) On(ch Channel) error
On writes a command payload to set the channel to 100% brightness. This saves 1 byte over a SetBrightness call.
func (*Controller) OpenPort ¶
func (c *Controller) OpenPort(conf *serial.Config) error
OpenPort opens a serial port with the given serial.Config object. Once opened, OpenPort will send an initial heartbeat (using #SendHeartbeat) to test the connection.
func (Controller) SetBrightness ¶
func (c Controller) SetBrightness(ch Channel, val float64) error
SetBrightness writes a command payload to set the channel's brightness to the specified value.
func (Controller) SetBrightnessAbs ¶ added in v0.0.2
func (c Controller) SetBrightnessAbs(ch Channel, val byte) error
SetBrightnessAbs writes a command payload to set the channel's brightness to the specified absolute value.
func (Controller) SetEffect ¶
func (c Controller) SetEffect(ch Channel, effect Effect) error
SetEffect writes a command payload to set a channel's active effect. This will reset the channel's brightness.
func (Controller) WriteHeartbeat ¶
func (c Controller) WriteHeartbeat() error
WriteHeartbeat writes a heartbeat payload to the currently open serial port.