Skip to content

Commit df828c1

Browse files
committed
re-generated by skipping targets with sanity check errors
1 parent 0cbcfde commit df828c1

35 files changed

+1573
-126
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Arduino Mega 1280"
33
weight: 3
44
---
55

6-
The [Arduino Mega 1280](https://www.arduino.cc/en/Main/arduinoBoardMega/) is based on the AVR [ATmega1280](https://www.microchip.com/wwwproducts/en/ATMEGA1280) microcontroller.
6+
The [Arduino Mega 1280](https://docs.arduino.cc/retired/other/arduino-older-boards#arduino-mega/) is based on the AVR [ATmega1280](https://www.microchip.com/wwwproducts/en/ATMEGA1280) microcontroller.
77

88
Note: the AVR backend of LLVM is still experimental so you may encounter bugs.
99

content/docs/reference/microcontrollers/bluepill.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'ST Micro STM32F103XX "Bluepill"'
33
weight: 3
44
---
55

6-
The [Bluepill](http://wiki.stm32duino.com/index.php?title=Blue_Pill) is a popular, ultra-cheap and compact ARM development board based on the ST Micro [STM32F103C8](https://www.st.com/en/microcontrollers/stm32f103c8.html) SoC.
6+
The [Bluepill](https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill.html) is a popular, ultra-cheap and compact ARM development board based on the ST Micro [STM32F103C8](https://www.st.com/en/microcontrollers/stm32f103c8.html) SoC.
77

88
## Interfaces
99

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

+38-9
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,6 @@ var (
317317

318318

319319

320-
```go
321-
var I2C0 *I2C = nil
322-
```
323-
324-
I2C0 is the only I2C interface on most AVRs.
325-
326-
327320
```go
328321
var DefaultUART = UART0
329322
```
@@ -496,6 +489,18 @@ value of each parameter will use the peripheral's default settings.
496489

497490
```go
498491
type I2C struct {
492+
srReg *volatile.Register8
493+
brReg *volatile.Register8
494+
crReg *volatile.Register8
495+
drReg *volatile.Register8
496+
497+
srPS0 byte
498+
srPS1 byte
499+
crEN byte
500+
crINT byte
501+
crSTO byte
502+
crEA byte
503+
crSTA byte
499504
}
500505
```
501506

@@ -526,6 +531,15 @@ is a shortcut to easily read such registers. Also, it only works for devices
526531
with 7-bit addresses, which is the vast majority.
527532

528533

534+
### func (*I2C) SetBaudRate
535+
536+
```go
537+
func (i2c *I2C) SetBaudRate(br uint32) error
538+
```
539+
540+
SetBaudRate sets the communication speed for I2C.
541+
542+
529543
### func (*I2C) Tx
530544

531545
```go
@@ -1003,6 +1017,17 @@ type SPI struct {
10031017
spdr *volatile.Register8
10041018
spsr *volatile.Register8
10051019

1020+
spcrR0 byte
1021+
spcrR1 byte
1022+
spcrCPHA byte
1023+
spcrCPOL byte
1024+
spcrDORD byte
1025+
spcrSPE byte
1026+
spcrMSTR byte
1027+
1028+
spsrI2X byte
1029+
spsrSPIF byte
1030+
10061031
// The io pins for the SPIx port set by the chip
10071032
sck Pin
10081033
sdi Pin
@@ -1150,7 +1175,8 @@ Usually called by the IRQ handler for a machine.
11501175
func (uart *UART) Write(data []byte) (n int, err error)
11511176
```
11521177

1153-
Write data to the UART.
1178+
Write data over the UART's Tx.
1179+
This function blocks until the data is finished being sent.
11541180

11551181

11561182
### func (*UART) WriteByte
@@ -1159,7 +1185,8 @@ Write data to the UART.
11591185
func (uart *UART) WriteByte(c byte) error
11601186
```
11611187

1162-
WriteByte writes a byte of data to the UART.
1188+
WriteByte writes a byte of data over the UART's Tx.
1189+
This function blocks until the data is finished being sent.
11631190

11641191

11651192

@@ -1171,6 +1198,8 @@ type UARTConfig struct {
11711198
BaudRate uint32
11721199
TX Pin
11731200
RX Pin
1201+
RTS Pin
1202+
CTS Pin
11741203
}
11751204
```
11761205

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

+38-9
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,6 @@ var (
375375

376376

377377

378-
```go
379-
var I2C0 *I2C = nil
380-
```
381-
382-
I2C0 is the only I2C interface on most AVRs.
383-
384-
385378
```go
386379
var DefaultUART = UART0
387380
```
@@ -541,6 +534,18 @@ value of each parameter will use the peripheral's default settings.
541534

542535
```go
543536
type I2C struct {
537+
srReg *volatile.Register8
538+
brReg *volatile.Register8
539+
crReg *volatile.Register8
540+
drReg *volatile.Register8
541+
542+
srPS0 byte
543+
srPS1 byte
544+
crEN byte
545+
crINT byte
546+
crSTO byte
547+
crEA byte
548+
crSTA byte
544549
}
545550
```
546551

@@ -571,6 +576,15 @@ is a shortcut to easily read such registers. Also, it only works for devices
571576
with 7-bit addresses, which is the vast majority.
572577

573578

579+
### func (*I2C) SetBaudRate
580+
581+
```go
582+
func (i2c *I2C) SetBaudRate(br uint32) error
583+
```
584+
585+
SetBaudRate sets the communication speed for I2C.
586+
587+
574588
### func (*I2C) Tx
575589

576590
```go
@@ -918,6 +932,17 @@ type SPI struct {
918932
spdr *volatile.Register8
919933
spsr *volatile.Register8
920934

935+
spcrR0 byte
936+
spcrR1 byte
937+
spcrCPHA byte
938+
spcrCPOL byte
939+
spcrDORD byte
940+
spcrSPE byte
941+
spcrMSTR byte
942+
943+
spsrI2X byte
944+
spsrSPIF byte
945+
921946
// The io pins for the SPIx port set by the chip
922947
sck Pin
923948
sdi Pin
@@ -1065,7 +1090,8 @@ Usually called by the IRQ handler for a machine.
10651090
func (uart *UART) Write(data []byte) (n int, err error)
10661091
```
10671092

1068-
Write data to the UART.
1093+
Write data over the UART's Tx.
1094+
This function blocks until the data is finished being sent.
10691095

10701096

10711097
### func (*UART) WriteByte
@@ -1074,7 +1100,8 @@ Write data to the UART.
10741100
func (uart *UART) WriteByte(c byte) error
10751101
```
10761102

1077-
WriteByte writes a byte of data to the UART.
1103+
WriteByte writes a byte of data over the UART's Tx.
1104+
This function blocks until the data is finished being sent.
10781105

10791106

10801107

@@ -1086,6 +1113,8 @@ type UARTConfig struct {
10861113
BaudRate uint32
10871114
TX Pin
10881115
RX Pin
1116+
RTS Pin
1117+
CTS Pin
10891118
}
10901119
```
10911120

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

+101-10
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ NoPin explicitly indicates "not a pin". Use this pin if you want to leave one
163163
of the pins in a peripheral unconfigured (if supported by the hardware).
164164

165165

166+
```go
167+
const (
168+
PinRising PinChange = 1 << iota
169+
PinFalling
170+
PinToggle = PinRising | PinFalling
171+
)
172+
```
173+
174+
175+
166176
```go
167177
const (
168178
PinInput PinMode = iota
@@ -223,13 +233,6 @@ var (
223233

224234

225235

226-
```go
227-
var I2C0 *I2C = nil
228-
```
229-
230-
I2C0 is the only I2C interface on most AVRs.
231-
232-
233236
```go
234237
var DefaultUART = UART0
235238
```
@@ -267,15 +270,47 @@ var (
267270

268271

269272

273+
```go
274+
var I2C0 = &I2C{
275+
srReg: avr.TWSR,
276+
brReg: avr.TWBR,
277+
crReg: avr.TWCR,
278+
drReg: avr.TWDR,
279+
srPS0: avr.TWSR_TWPS0,
280+
srPS1: avr.TWSR_TWPS1,
281+
crEN: avr.TWCR_TWEN,
282+
crINT: avr.TWCR_TWINT,
283+
crSTO: avr.TWCR_TWSTO,
284+
crEA: avr.TWCR_TWEA,
285+
crSTA: avr.TWCR_TWSTA,
286+
}
287+
```
288+
289+
I2C0 is the only I2C interface on most AVRs.
290+
291+
270292
```go
271293
var SPI0 = SPI{
272294
spcr: avr.SPCR,
273295
spdr: avr.SPDR,
274296
spsr: avr.SPSR,
297+
298+
spcrR0: avr.SPCR_SPR0,
299+
spcrR1: avr.SPCR_SPR1,
300+
spcrCPHA: avr.SPCR_CPHA,
301+
spcrCPOL: avr.SPCR_CPOL,
302+
spcrDORD: avr.SPCR_DORD,
303+
spcrSPE: avr.SPCR_SPE,
304+
spcrMSTR: avr.SPCR_MSTR,
305+
306+
spsrI2X: avr.SPSR_SPI2X,
307+
spsrSPIF: avr.SPSR_SPIF,
308+
275309
sck: PB5,
276310
sdo: PB3,
277311
sdi: PB4,
278-
cs: PB2}
312+
cs: PB2,
313+
}
279314
```
280315

281316
SPI configuration
@@ -399,6 +434,18 @@ value of each parameter will use the peripheral's default settings.
399434

400435
```go
401436
type I2C struct {
437+
srReg *volatile.Register8
438+
brReg *volatile.Register8
439+
crReg *volatile.Register8
440+
drReg *volatile.Register8
441+
442+
srPS0 byte
443+
srPS1 byte
444+
crEN byte
445+
crINT byte
446+
crSTO byte
447+
crEA byte
448+
crSTA byte
402449
}
403450
```
404451

@@ -429,6 +476,15 @@ is a shortcut to easily read such registers. Also, it only works for devices
429476
with 7-bit addresses, which is the vast majority.
430477

431478

479+
### func (*I2C) SetBaudRate
480+
481+
```go
482+
func (i2c *I2C) SetBaudRate(br uint32) error
483+
```
484+
485+
SetBaudRate sets the communication speed for I2C.
486+
487+
432488
### func (*I2C) Tx
433489

434490
```go
@@ -813,6 +869,26 @@ func (p Pin) Set(value bool)
813869
Set changes the value of the GPIO pin. The pin must be configured as output.
814870

815871

872+
### func (Pin) SetInterrupt
873+
874+
```go
875+
func (pin Pin) SetInterrupt(pinChange PinChange, callback func(Pin)) (err error)
876+
```
877+
878+
879+
880+
881+
882+
## type PinChange
883+
884+
```go
885+
type PinChange uint8
886+
```
887+
888+
Pin Change Interrupts
889+
890+
891+
816892

817893

818894
## type PinConfig
@@ -906,6 +982,17 @@ type SPI struct {
906982
spdr *volatile.Register8
907983
spsr *volatile.Register8
908984

985+
spcrR0 byte
986+
spcrR1 byte
987+
spcrCPHA byte
988+
spcrCPOL byte
989+
spcrDORD byte
990+
spcrSPE byte
991+
spcrMSTR byte
992+
993+
spsrI2X byte
994+
spsrSPIF byte
995+
909996
// The io pins for the SPIx port set by the chip
910997
sck Pin
911998
sdi Pin
@@ -1053,7 +1140,8 @@ Usually called by the IRQ handler for a machine.
10531140
func (uart *UART) Write(data []byte) (n int, err error)
10541141
```
10551142

1056-
Write data to the UART.
1143+
Write data over the UART's Tx.
1144+
This function blocks until the data is finished being sent.
10571145

10581146

10591147
### func (*UART) WriteByte
@@ -1062,7 +1150,8 @@ Write data to the UART.
10621150
func (uart *UART) WriteByte(c byte) error
10631151
```
10641152

1065-
WriteByte writes a byte of data to the UART.
1153+
WriteByte writes a byte of data over the UART's Tx.
1154+
This function blocks until the data is finished being sent.
10661155

10671156

10681157

@@ -1074,6 +1163,8 @@ type UARTConfig struct {
10741163
BaudRate uint32
10751164
TX Pin
10761165
RX Pin
1166+
RTS Pin
1167+
CTS Pin
10771168
}
10781169
```
10791170

0 commit comments

Comments
 (0)