func (d *Driver) DisableRx() (rxbuf []byte) {
	d.p.SetIntConf(PTIME | TxReadyEn)
	for atomic.LoadUint32(&d.isr) == isrRx {
		runtime.Gosched()
	}
	rxbuf = d.rxbuf
	d.rxbuf = nil
	return
}
DisableRx disables the UART receiver. The receive buffer is returned and no
longer referenced by driver.
package uart
import (
	"runtime"
	"sync/atomic"
)
func (d *Driver) Len() int {
	n := int(atomic.LoadUint32(&d.nextw)) - int(d.nextr)
	if n < 0 {
		n += len(d.rxbuf)
	}
	return n
}
func (d *Driver) EnableRx(rxbuf []byte) {
	if d.rxbuf != nil {
		panic("uarths: enabled before")
	}
	if rxbuf == nil {
		rxbuf = make([]byte, 128)
	} else if len(rxbuf) < 2 {
		panic("uarths: rxbuf too short")
	}
	d.rxbuf = rxbuf
	d.nextr = 0
	d.nextw = 0
	d.p.SetRFT(RFT8)
	d.p.SetIntConf(PTIME | TxReadyEn | RxReadyEn)
}