View Source
const (
	GPIO_INPUT = iota
View Source
const (
	LED  = LED1
	LED1 = 0
	LED2 = 0
	LED3 = 0
	LED4 = 0

    Fake LED numbers, for testing.

    View Source
    const (
    	BUTTON1 = 0
    	BUTTON2 = 0
    	BUTTON3 = 0
    	BUTTON4 = 0

      Fake button numbers, for testing.


      This section is empty.


      This section is empty.


      type ADC

      type ADC struct {
      	Pin uint8

      type GPIO

      type GPIO struct {
      	Pin uint8

      func (GPIO) Configure

      func (p GPIO) Configure(config GPIOConfig)

      func (GPIO) Get

      func (p GPIO) Get() bool

      func (GPIO) High

      func (p GPIO) High()

      func (GPIO) Low

      func (p GPIO) Low()

      func (GPIO) Set

      func (p GPIO) Set(value bool)

      type GPIOConfig

      type GPIOConfig struct {
      	Mode GPIOMode

      type GPIOMode

      type GPIOMode uint8

      type PWM

      type PWM struct {
      	Pin uint8

      type RingBuffer

      type RingBuffer struct {
      	// contains filtered or unexported fields

        RingBuffer is ring buffer implementation inspired by post at

        It has some limitations currently due to how "volatile" variables that are members of a struct are not compiled correctly by TinyGo. See for details.

        func NewRingBuffer

        func NewRingBuffer() *RingBuffer

          NewRingBuffer returns a new ring buffer.

          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.