forked from dchote/talkiepi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
talkiepi.go
43 lines (34 loc) · 853 Bytes
/
talkiepi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package talkiepi
import (
"crypto/tls"
"github.com/dchote/gpio"
"github.com/dchote/gumble/gumble"
"github.com/dchote/gumble/gumbleopenal"
)
// Raspberry Pi GPIO pin assignments (CPU pin definitions)
const (
// no LEDs on this board, these GPIOs are free to use
// don't use GPIO18 with this board
OnlineLEDPin uint = 4
ParticipantsLEDPin uint = 5
TransmitLEDPin uint = 16
// This is the correct GPIO for the button
ButtonPin uint = 26
)
type Talkiepi struct {
Config *gumble.Config
Client *gumble.Client
Address string
TLSConfig tls.Config
ConnectAttempts uint
Stream *gumbleopenal.Stream
ChannelName string
IsConnected bool
IsTransmitting bool
GPIOEnabled bool
OnlineLED gpio.Pin
ParticipantsLED gpio.Pin
TransmitLED gpio.Pin
Button gpio.Pin
ButtonState uint
}