usart

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Idle       = Event(1 << 4) // IDLE line detected.
	RxNotEmpty = Event(1 << 5) // Read data register not empty.
	TxDone     = Event(1 << 6) // Transmission complete.
	TxEmpty    = Event(1 << 7) // Transmit data register empty.
	LINBreak   = Event(1 << 8) // LIN break detection flag.
	CTS        = Event(1 << 9) // Change on CTS status line

	EvAll = Idle | RxNotEmpty | TxDone | TxEmpty | LINBreak | CTS
)
View Source
const (
	ErrParity  = Error(1 << 0) // Parity error.
	ErrFraming = Error(1 << 1) // Framing error.
	ErrNoise   = Error(1 << 2) // Noise error flag.
	ErrOverrun = Error(1 << 3) // Overrun error.

	ErrAll = ErrParity | ErrFraming | ErrNoise | ErrOverrun
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error uint8

Error is bitmask that describes errors that can be detected by USART hardware when receiving data.

func (Error) Error

func (e Error) Error() string

type Event

type Event uint16

Event is bitmask that describes events in USART peripheral.

type Periph

type Periph struct {
	// contains filtered or unexported fields
}

Periph represents USART peripheral.

func (*Periph) Bus

func (p *Periph) Bus() bus.Bus

Bus returns a bus to which p is connected to.

func (*Periph) Clear

func (p *Periph) Clear(ev Event, err Error)

Clear clears events ev and errors err. For MCUs that have no USART_ICR register (older than L4, F7 series) only RxNotEmpty, TxDone, LINBreak and CTS events can be cleared this way. Other events can be cleared only by specific sequence of reading status register and read or write data register.

func (*Periph) DisableClock

func (p *Periph) DisableClock()

DisableClock disables clock for p.

func (*Periph) EnableClock

func (p *Periph) EnableClock(lp bool)

EnableClock enables clock for p. lp determines whether the clock remains on in low power (sleep) mode.

func (*Periph) Reset

func (p *Periph) Reset()

Reset resets p.

func (*Periph) Status

func (p *Periph) Status() (Event, Error)

Status return current status of p.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL