nrf52840: implement USB-CDC (#883)

* machine/nrf52840: usb-cdc implementation
This commit is contained in:
Scott Yoder
2020-02-17 09:14:24 -05:00
committed by GitHub
parent d11abb33fe
commit 630c498efa
10 changed files with 603 additions and 4 deletions
+3 -3
View File
@@ -66,8 +66,8 @@ type UART struct {
// UART
var (
// UART0 is the hardware serial port on the NRF.
UART0 = UART{Buffer: NewRingBuffer()}
// NRF_UART0 is the hardware UART on the NRF SoC.
NRF_UART0 = UART{Buffer: NewRingBuffer()}
)
// Configure the UART.
@@ -88,7 +88,7 @@ func (uart UART) Configure(config UARTConfig) {
nrf.UART0.INTENSET.Set(nrf.UART_INTENSET_RXDRDY_Msk)
// Enable RX IRQ.
intr := interrupt.New(nrf.IRQ_UART0, UART0.handleInterrupt)
intr := interrupt.New(nrf.IRQ_UART0, NRF_UART0.handleInterrupt)
intr.SetPriority(0xc0) // low priority
intr.Enable()
}