mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 21:13:39 +00:00
machine/rp2040: implement UART0/UART1, can be used on all rp2040 boards
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
+18
-1
@@ -1,4 +1,4 @@
|
||||
// +build atmega esp nrf sam sifive stm32 k210 nxp
|
||||
// +build atmega esp nrf sam sifive stm32 k210 nxp rp2040
|
||||
|
||||
package machine
|
||||
|
||||
@@ -6,6 +6,23 @@ import "errors"
|
||||
|
||||
var errUARTBufferEmpty = errors.New("UART buffer empty")
|
||||
|
||||
// UARTParity is the parity setting to be used for UART communication.
|
||||
type UARTParity int
|
||||
|
||||
const (
|
||||
// ParityNone means to not use any parity checking. This is
|
||||
// the most common setting.
|
||||
ParityNone UARTParity = 0
|
||||
|
||||
// ParityEven means to expect that the total number of 1 bits sent
|
||||
// should be an even number.
|
||||
ParityEven UARTParity = 1
|
||||
|
||||
// ParityOdd means to expect that the total number of 1 bits sent
|
||||
// should be an odd number.
|
||||
ParityOdd UARTParity = 2
|
||||
)
|
||||
|
||||
type UARTConfig struct {
|
||||
BaudRate uint32
|
||||
TX Pin
|
||||
|
||||
Reference in New Issue
Block a user