Documentation ¶
Index ¶
Constants ¶
const ( GPIO_INPUT = iota GPIO_OUTPUT )
const ( LED = LED1 LED1 = 0 LED2 = 0 LED3 = 0 LED4 = 0 )
Fake LED numbers, for testing.
const ( BUTTON = BUTTON1 BUTTON1 = 0 BUTTON2 = 0 BUTTON3 = 0 BUTTON4 = 0 )
Fake button numbers, for testing.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GPIO ¶
type GPIO struct {
Pin uint8
}
func (GPIO) Configure ¶
func (p GPIO) Configure(config GPIOConfig)
type GPIOConfig ¶
type GPIOConfig struct {
Mode GPIOMode
}
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
RingBuffer is ring buffer implementation inspired by post at https://www.embeddedrelated.com/showthread/comp.arch.embedded/77084-1.php
It has some limitations currently due to how "volatile" variables that are members of a struct are not compiled correctly by TinyGo. See https://github.com/tinygo-org/tinygo/issues/151 for details.
func (*RingBuffer) Get ¶
func (rb *RingBuffer) Get() (byte, bool)
Get returns a byte from the buffer. If the buffer is empty, the method will return a false as the second value.
func (*RingBuffer) Put ¶
func (rb *RingBuffer) Put(val byte) bool
Put stores a byte in the buffer. If the buffer is already full, the method will return false.
func (*RingBuffer) Used ¶
func (rb *RingBuffer) Used() uint8
Used returns how many bytes in buffer have been used.