machine/rp2040: implement UART0/UART1, can be used on all rp2040 boards

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2021-06-09 19:11:42 +02:00
committed by Ron Evans
parent b406b81416
commit 87e48c1057
6 changed files with 192 additions and 8 deletions
+18 -1
View File
@@ -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