Skip to content

Commit 8a74a2b

Browse files
aykevldeadprogram
authored andcommitted
Fix doc-gen and update docs
With a few simple tweaks I got doc-gen working again (though finding these issues took some time). The doc-gen script now works with Go 1.22.
1 parent c8fbd9c commit 8a74a2b

Some content is hidden

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

92 files changed

+5375
-1564
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ Peripherals:
4949
| `A7` | `PB03` | | |
5050
| `USBCDC_DM_PIN` | `PA24` | | `TCC1` (channel 2) |
5151
| `USBCDC_DP_PIN` | `PA25` | | `TCC1` (channel 3) |
52-
| `UART_TX_PIN` | `PA22` | `NINA_TX` | `TCC0` (channel 0) |
53-
| `UART_RX_PIN` | `PA23` | `NINA_RX` | `TCC0` (channel 1) |
54-
| `NINA_SDO` | `PA12` | | `TCC2` (channel 0), `TCC0` (channel 2) |
55-
| `NINA_SDI` | `PA13` | | `TCC2` (channel 1), `TCC0` (channel 3) |
56-
| `NINA_CS` | `PA14` | | `TCC0` (channel 0) |
57-
| `NINA_SCK` | `PA15` | | `TCC0` (channel 1) |
52+
| `UART_TX_PIN` | `PA22` | | `TCC0` (channel 0) |
53+
| `UART_RX_PIN` | `PA23` | | `TCC0` (channel 1) |
54+
| `NINA_SDO` | `PA12` | `NINA_TX` | `TCC2` (channel 0), `TCC0` (channel 2) |
55+
| `NINA_SDI` | `PA13` | `NINA_RX` | `TCC2` (channel 1), `TCC0` (channel 3) |
56+
| `NINA_CS` | `PA14` | `NINA_RTS` | `TCC0` (channel 0) |
57+
| `NINA_SCK` | `PA15` | `NINA_CTS` | `TCC0` (channel 1) |
5858
| `NINA_GPIO0` | `PA27` | | |
5959
| `NINA_RESETN` | `PA08` | `I2S_SD_PIN` | `TCC0` (channel 0), `TCC1` (channel 2) |
6060
| `NINA_ACK` | `PA28` | | |

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

Lines changed: 38 additions & 9 deletions
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+
srPS0byte
498+
srPS1byte
499+
crENbyte
500+
crINTbyte
501+
crSTObyte
502+
crEAbyte
503+
crSTAbyte
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+
spcrR0byte
1021+
spcrR1byte
1022+
spcrCPHAbyte
1023+
spcrCPOLbyte
1024+
spcrDORDbyte
1025+
spcrSPEbyte
1026+
spcrMSTRbyte
1027+
1028+
spsrI2Xbyte
1029+
spsrSPIFbyte
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
BaudRateuint32
11721199
TX Pin
11731200
RX Pin
1201+
RTS Pin
1202+
CTS Pin
11741203
}
11751204
```
11761205

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

Lines changed: 38 additions & 9 deletions
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+
srPS0byte
543+
srPS1byte
544+
crENbyte
545+
crINTbyte
546+
crSTObyte
547+
crEAbyte
548+
crSTAbyte
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+
spcrR0byte
936+
spcrR1byte
937+
spcrCPHAbyte
938+
spcrCPOLbyte
939+
spcrDORDbyte
940+
spcrSPEbyte
941+
spcrMSTRbyte
942+
943+
spsrI2Xbyte
944+
spsrSPIFbyte
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
BaudRateuint32
10871114
TX Pin
10881115
RX Pin
1116+
RTS Pin
1117+
CTS Pin
10891118
}
10901119
```
10911120

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

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ var (
444444
var (
445445
ErrUSBReadTimeout= errors.New("USB read timeout")
446446
ErrUSBBytesRead= errors.New("USB invalid number of bytes read")
447+
ErrUSBBytesWritten= errors.New("USB invalid number of bytes written")
447448
)
448449
```
449450

@@ -470,39 +471,40 @@ func CPUReset()
470471
CPUReset performs a hard system reset.
471472

472473

473-
### func EnableCDC
474+
### func ConfigureUSBEndpoint
474475

475476
```go
476-
func EnableCDC(txHandler func(), rxHandler func([]byte), setupHandler func(usb.Setup) bool)
477+
func ConfigureUSBEndpoint(desc descriptor.Descriptor, epSettings []usb.EndpointConfig, setup []usb.SetupConfig)
477478
```
478479

479480

480481

481-
### func EnableHID
482+
### func DeviceID
482483

483484
```go
484-
func EnableHID(txHandler func(), rxHandler func([]byte), setupHandler func(usb.Setup) bool)
485+
func DeviceID() []byte
485486
```
486487

487-
EnableHID enables HID. This function must be executed from the init().
488+
DeviceID returns an identifier that is unique within
489+
a particular chipset.
488490

491+
The identity is one burnt into the MCU itself, or the
492+
flash chip at time of manufacture.
489493

490-
### func EnableJoystick
494+
It's possible that two different vendors may allocate
495+
the same DeviceID, so callers should take this into
496+
account if needing to generate a globally unique id.
491497

492-
```go
493-
func EnableJoystick(txHandler func(), rxHandler func([]byte), setupHandler func(usb.Setup) bool, hidDesc []byte)
494-
```
498+
The length of the hardware ID is vendor-specific, but
499+
8 bytes (64 bits) and 16 bytes (128 bits) are common.
495500

496-
EnableJoystick enables HID. This function must be executed from the init().
497501

498-
499-
### func EnableMIDI
502+
### func EnableCDC
500503

501504
```go
502-
func EnableMIDI(txHandler func(), rxHandler func([]byte), setupHandler func(usb.Setup) bool)
505+
func EnableCDC(txHandler func(), rxHandler func([]byte), setupHandler func(usb.Setup) bool)
503506
```
504507

505-
EnableMIDI enables MIDI. This function must be executed from the init().
506508

507509

508510
### func EnterBootloader
@@ -759,10 +761,10 @@ with 7-bit addresses, which is the vast majority.
759761
### func (*I2C) SetBaudRate
760762

761763
```go
762-
func (i2c *I2C) SetBaudRate(br uint32)
764+
func (i2c *I2C) SetBaudRate(br uint32) error
763765
```
764766

765-
SetBaudRate sets the communication speed for the I2C.
767+
SetBaudRate sets the communication speed for I2C.
766768

767769

768770
### func (*I2C) Tx
@@ -1539,7 +1541,8 @@ SetBaudRate sets the communication speed for the UART.
15391541
func (uart *UART) Write(data []byte) (n int, err error)
15401542
```
15411543

1542-
Write data to the UART.
1544+
Write data over the UART's Tx.
1545+
This function blocks until the data is finished being sent.
15431546

15441547

15451548
### func (*UART) WriteByte
@@ -1548,7 +1551,8 @@ Write data to the UART.
15481551
func (uart *UART) WriteByte(c byte) error
15491552
```
15501553

1551-
WriteByte writes a byte of data to the UART.
1554+
WriteByte writes a byte of data over the UART's Tx.
1555+
This function blocks until the data is finished being sent.
15521556

15531557

15541558

@@ -1560,6 +1564,8 @@ type UARTConfig struct {
15601564
BaudRateuint32
15611565
TX Pin
15621566
RX Pin
1567+
RTS Pin
1568+
CTS Pin
15631569
}
15641570
```
15651571

0 commit comments

Comments
 (0)