Documentation
¶
Overview ¶
Package uarte provides access to the registers of UARTE peripheral. It also provides the driver that implements io.ReadWriter interface.
Index ¶
- type Baudrate
- type Config
- type Driver
- func (d *Driver) Disable()
- func (d *Driver) Enable()
- func (d *Driver) IRQ() rtos.IRQ
- func (d *Driver) ISR()
- func (d *Driver) Periph() *Periph
- func (d *Driver) SetBaudrate(br Baudrate)
- func (d *Driver) SetConfig(cfg Config)
- func (d *Driver) UsePin(pin gpio.Pin, s Signal)
- func (d *Driver) Write(s []byte) (n int, err error)
- func (d *Driver) WriteByte(b byte) (err error)
- type DriverError
- type ErrorBits
- type Event
- type Periph
- func (p *Periph) ClearERRORSRC(e ErrorBits)
- func (p *Periph) Event(e Event) *te.Event
- func (p *Periph) LoadBAUDRATE() Baudrate
- func (p *Periph) LoadCONFIG() Config
- func (p *Periph) LoadENABLE() bool
- func (p *Periph) LoadERRORSRC() ErrorBits
- func (p *Periph) LoadPSEL(s Signal) (psel gpio.PSEL, en bool)
- func (p *Periph) LoadRXDAMOUNT() int
- func (p *Periph) LoadRXDMAXCNT() int
- func (p *Periph) LoadRXDPTR() uintptr
- func (p *Periph) LoadSHORTS() Shorts
- func (p *Periph) LoadTXDAMOUNT() int
- func (p *Periph) LoadTXDMAXCNT() int
- func (p *Periph) LoadTXDPTR() uintptr
- func (p *Periph) StoreBAUDRATE(br Baudrate)
- func (p *Periph) StoreCONFIG(cfg Config)
- func (p *Periph) StoreENABLE(en bool)
- func (p *Periph) StorePSEL(s Signal, psel gpio.PSEL, en bool)
- func (p *Periph) StoreRXDMAXCNT(n int)
- func (p *Periph) StoreRXDPTR(ptr unsafe.Pointer)
- func (p *Periph) StoreSHORTS(s Shorts)
- func (p *Periph) StoreTXDMAXCNT(n int)
- func (p *Periph) StoreTXDPTR(ptr unsafe.Pointer)
- func (p *Periph) Task(t Task) *te.Task
- type Shorts
- type Signal
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Baudrate ¶
type Baudrate uint32
const ( Baud1200 Baudrate = 0x0004F000 // Actual rate: 1205 baud. Baud2400 Baudrate = 0x0009D000 // Actual rate: 2396 baud. Baud4800 Baudrate = 0x0013B000 // Actual rate: 4808 baud. Baud9600 Baudrate = 0x00275000 // Actual rate: 9598 baud. Baud14400 Baudrate = 0x003AF000 // Actual rate: 14401 baud. Baud19200 Baudrate = 0x004EA000 // Actual rate: 19208 baud. Baud28800 Baudrate = 0x0075C000 // Actual rate: 28777 baud. Baud31250 Baudrate = 0x00800000 Baud38400 Baudrate = 0x009D0000 // Actual rate: 38369 baud. Baud56000 Baudrate = 0x00E50000 // Actual rate: 55944 baud. Baud57600 Baudrate = 0x00EB0000 // Actual rate: 57554 baud. Baud76800 Baudrate = 0x013A9000 // Actual rate: 76923 baud. Baud115200 Baudrate = 0x01D60000 // Actual rate: 115108 baud. Baud230400 Baudrate = 0x03B00000 // Actual rate: 231884 baud. Baud250000 Baudrate = 0x04000000 Baud460800 Baudrate = 0x07400000 // Actual rate: 457143 baud. Baud921600 Baudrate = 0x0F000000 // Actual rate: 941176 baud. Baud1M Baudrate = 0x10000000 )
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) SetBaudrate ¶
SetBaudrate sets Tx and Rx baudrate.
func (*Driver) SetConfig ¶
SetConfig allows to configure UART peripheral to use hardware flow controll, add and check parity bit, and use two stop bits instead default one.
type DriverError ¶
type DriverError uint8
const ( // ErrBufOverflow is returned if one or more received bytes has been dropped // because of the lack of free space in the driver's receive buffer. ErrBufOverflow DriverError = iota + 1 // ErrTimeout is returned if timeout occured. It means that the read/write // operation has been interrupted. In case of write you can not determine // the exact number of bytes sent to the remote party. ErrTimeout )
type Event ¶
type Event uint8
const ( CTS Event = 0 // CTS is activated (set low). NCTS Event = 1 // CTS is deactivated (set high). RXDRDY Event = 2 // Data received in RXD. ENDRX Event = 4 // Receive buffer is filled up. TXDRDY Event = 7 // Data sent from TXD. ENDTX Event = 8 // Last TX byte transmitted. ERROR Event = 9 // Error detected. RXTO Event = 17 // Receiver timeout. RXSTARTED Event = 19 // UART receiver has started. TXSTARTED Event = 20 // UART transmitter has started. TXSTOPPED Event = 22 // Transmitter stopped. )
type Periph ¶
func (*Periph) ClearERRORSRC ¶
ClearERRORSRC clears specfied error flags.
func (*Periph) LoadBAUDRATE ¶
LoadBAUDRATE returns configured baudrate.
func (*Periph) LoadCONFIG ¶
LoadCONFIG returns configuration. nRF52.
func (*Periph) LoadENABLE ¶
LoadENABLE reports whether the UART peripheral is enabled.
func (*Periph) LoadERRORSRC ¶
LoadERRORSRC returns error flags.
func (*Periph) LoadRXDAMOUNT ¶
LoadRXDAMOUNT returns the Number of bytes transferred in the last transaction
func (*Periph) LoadRXDMAXCNT ¶
LoadRXDMAXCNT returns the maximum number of bytes in receive buffer.
func (*Periph) LoadRXDPTR ¶
LoadRXDPTR returns the Rx data pointer.
func (*Periph) LoadSHORTS ¶
func (*Periph) LoadTXDAMOUNT ¶
LoadTXDAMOUNT returns the number of bytes transferred in the last transaction
func (*Periph) LoadTXDMAXCNT ¶
LoadTXDMAXCNT returns the maximum number of bytes in transmit buffer.
func (*Periph) LoadTXDPTR ¶
LoadTXDPTR returns the Tx data pointer.
func (*Periph) StoreBAUDRATE ¶
StoreBAUDRATE stores baudrate.
func (*Periph) StoreCONFIG ¶
StoreCONFIG stores baudrate. nRF52.
func (*Periph) StoreENABLE ¶
StoreENABLE enables or disables UART peripheral.
func (*Periph) StoreRXDMAXCNT ¶
StoreRXDMAXCNT sets the maximum number of bytes in receive buffer.
func (*Periph) StoreRXDPTR ¶
StoreRXDPTR sets the Rx data pointer.
func (*Periph) StoreSHORTS ¶
func (*Periph) StoreTXDMAXCNT ¶
StoreTXDMAXCNT sets the maximum number of bytes in receive buffer.
func (*Periph) StoreTXDPTR ¶
StoreTXDPTR sets the Tx data pointer.