github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/memio/ports.go (about)

     1  // Copyright 2012-2021 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package memio
     6  
     7  import (
     8  	"io"
     9  )
    10  
    11  // PortReader is the interface for IO port read access.
    12  type PortReader interface {
    13  	In(uint16, UintN) error
    14  }
    15  
    16  // PortWriter is the interface for IO port write access.
    17  type PortWriter interface {
    18  	Out(uint16, UintN) error
    19  }
    20  
    21  // PortReadWriter implements io.ReadWriter for IO ports.
    22  type PortReadWriter interface {
    23  	PortReader
    24  	PortWriter
    25  	io.Closer
    26  }