Skip to content

Commit 5aebded

Browse files
aykevldeadprogram
authored andcommitted
docs/reference: update to v0.24.0
1 parent aa5a8ae commit 5aebded

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1671
-14924
lines changed

content/docs/reference/microcontrollers/machine/arduino-mega1280.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,16 @@ Always use UART0 as the serial output.
289289
var (
290290
// UART0 is the hardware serial port on the AVR.
291291
UART0 = &_UART0
292-
_UART0 = UART{Buffer: NewRingBuffer()}
292+
_UART0 = UART{
293+
Buffer: NewRingBuffer(),
294+
295+
dataReg: avr.UDR0,
296+
baudRegH: avr.UBRR0H,
297+
baudRegL: avr.UBRR0L,
298+
statusRegA: avr.UCSR0A,
299+
statusRegB: avr.UCSR0B,
300+
statusRegC: avr.UCSR0C,
301+
}
293302
)
294303
```
295304

@@ -978,7 +987,15 @@ SPIConfig is used to store config info for SPI.
978987

979988
```go
980989
type UART struct {
981-
Buffer *RingBuffer
990+
Buffer *RingBuffer
991+
992+
dataReg *volatile.Register8
993+
baudRegH *volatile.Register8
994+
baudRegL *volatile.Register8
995+
996+
statusRegA *volatile.Register8
997+
statusRegB *volatile.Register8
998+
statusRegC *volatile.Register8
982999
}
9831000
```
9841001

content/docs/reference/microcontrollers/machine/arduino-mega2560.md

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ const (
6161
D11 Pin = PB5
6262
D12 Pin = PB6
6363
D13 Pin = PB7
64-
D14 Pin = PJ1
65-
D15 Pin = PJ0
66-
D16 Pin = PH1
67-
D17 Pin = PH0
68-
D18 Pin = PD3
69-
D19 Pin = PD2
64+
D14 Pin = PJ1 // TX3
65+
D15 Pin = PJ0 // RX3
66+
D16 Pin = PH1 // TX2
67+
D17 Pin = PH0 // RX2
68+
D18 Pin = PD3 // TX1
69+
D19 Pin = PD2 // RX1
7070
D20 Pin = PD1
7171
D21 Pin = PD0
7272
D22 Pin = PA0
@@ -106,6 +106,24 @@ const (
106106

107107

108108

109+
```go
110+
const (
111+
UART_TX_PIN Pin = UART0_TX_PIN
112+
UART_RX_PIN Pin = UART0_RX_PIN
113+
UART0_TX_PIN Pin = D1
114+
UART0_RX_PIN Pin = D0
115+
UART1_TX_PIN Pin = D18
116+
UART1_RX_PIN Pin = D19
117+
UART2_TX_PIN Pin = D16
118+
UART2_RX_PIN Pin = D17
119+
UART3_TX_PIN Pin = D14
120+
UART3_RX_PIN Pin = D15
121+
)
122+
```
123+
124+
UART pins
125+
126+
109127
```go
110128
const (
111129
TWI_FREQ_100KHZ = 100000
@@ -258,6 +276,46 @@ const (
258276

259277
## Variables
260278

279+
```go
280+
var (
281+
UART1 = &_UART1
282+
_UART1 = UART{
283+
Buffer: NewRingBuffer(),
284+
285+
dataReg: avr.UDR1,
286+
baudRegH: avr.UBRR1H,
287+
baudRegL: avr.UBRR1L,
288+
statusRegA: avr.UCSR1A,
289+
statusRegB: avr.UCSR1B,
290+
statusRegC: avr.UCSR1C,
291+
}
292+
UART2 = &_UART2
293+
_UART2 = UART{
294+
Buffer: NewRingBuffer(),
295+
296+
dataReg: avr.UDR2,
297+
baudRegH: avr.UBRR2H,
298+
baudRegL: avr.UBRR2L,
299+
statusRegA: avr.UCSR2A,
300+
statusRegB: avr.UCSR2B,
301+
statusRegC: avr.UCSR2C,
302+
}
303+
UART3 = &_UART3
304+
_UART3 = UART{
305+
Buffer: NewRingBuffer(),
306+
307+
dataReg: avr.UDR3,
308+
baudRegH: avr.UBRR3H,
309+
baudRegL: avr.UBRR3L,
310+
statusRegA: avr.UCSR3A,
311+
statusRegB: avr.UCSR3B,
312+
statusRegC: avr.UCSR3C,
313+
}
314+
)
315+
```
316+
317+
318+
261319
```go
262320
var (
263321
ErrTimeoutRNG = errors.New("machine: RNG Timeout")
@@ -289,7 +347,16 @@ Always use UART0 as the serial output.
289347
var (
290348
// UART0 is the hardware serial port on the AVR.
291349
UART0 = &_UART0
292-
_UART0 = UART{Buffer: NewRingBuffer()}
350+
_UART0 = UART{
351+
Buffer: NewRingBuffer(),
352+
353+
dataReg: avr.UDR0,
354+
baudRegH: avr.UBRR0H,
355+
baudRegL: avr.UBRR0L,
356+
statusRegA: avr.UCSR0A,
357+
statusRegB: avr.UCSR0B,
358+
statusRegC: avr.UCSR0C,
359+
}
293360
)
294361
```
295362

@@ -835,7 +902,15 @@ SPIConfig is used to store config info for SPI.
835902

836903
```go
837904
type UART struct {
838-
Buffer *RingBuffer
905+
Buffer *RingBuffer
906+
907+
dataReg *volatile.Register8
908+
baudRegH *volatile.Register8
909+
baudRegL *volatile.Register8
910+
911+
statusRegA *volatile.Register8
912+
statusRegB *volatile.Register8
913+
statusRegC *volatile.Register8
839914
}
840915
```
841916

0 commit comments

Comments
 (0)