Skip to content

Commit

Permalink
add documentation on line values
Browse files Browse the repository at this point in the history
  • Loading branch information
warthog618 committed Jul 22, 2024
1 parent 8fbd821 commit 0681576
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gpiocdev.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,8 @@ func (l *Line) Info() (info LineInfo, err error) {
}

// Value returns the current value (active state) of the line.
//
// Values are 0 for inactive and 1 for active.
func (l *Line) Value() (int, error) {
l.mu.Lock()
defer l.mu.Unlock()
Expand All @@ -947,6 +949,8 @@ func (l *Line) Value() (int, error) {
// SetValue sets the current value (active state) of the line.
//
// Only valid for output lines.
//
// Values are 0 for inactive and 1 for active.
func (l *Line) SetValue(value int) error {
l.mu.Lock()
defer l.mu.Unlock()
Expand Down Expand Up @@ -1015,6 +1019,8 @@ func (l *Lines) Info() ([]*LineInfo, error) {

// Values returns the current values (active state) of the collection of lines.
//
// Values are 0 for inactive and 1 for active.
//
// Gets as many values from the set, in order, as can be fit in values, up to
// the full set.
func (l *Lines) Values(values []int) error {
Expand Down Expand Up @@ -1053,6 +1059,8 @@ func (l *Lines) Values(values []int) error {
//
// Only valid for output lines.
//
// Values are 0 for inactive and 1 for active.
//
// All lines in the set are set at once. If insufficient values are provided
// then the remaining lines are set to inactive. If too many values are provided
// then the surplus values are ignored.
Expand Down

0 comments on commit 0681576

Please sign in to comment.