Skip to content

Commit 86af3c7

Browse files
aykevldeadprogram
authored andcommitted
microcontrollers: run doc-gen to update documentation
This required a few hacks to get it to run on version 0.28, this is something we should fix some time.
1 parent 614095a commit 86af3c7

Some content is hidden

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

87 files changed

+9904
-278
lines changed

content/docs/reference/microcontrollers/lorae5.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ It has onboard LoRa®, (G)FSK, (G)MSK, and BPSK as well as 1 user LED, 1 user bu
2424
| Pin | Hardware pin | Alternative names |
2525
| ----------------- | ------------ | ----------------- |
2626
| `LED` | `PB5` | |
27+
| `POWER_EN3V3` | `PA9` | |
28+
| `POWER_EN5V` | `PB10` | |
2729
| `SPI0_NSS_PIN` | `PA4` | |
2830
| `SPI0_SCK_PIN` | `PA5` | |
2931
| `SPI0_SDO_PIN` | `PA6` | |
@@ -32,8 +34,8 @@ It has onboard LoRa®, (G)FSK, (G)MSK, and BPSK as well as 1 user LED, 1 user bu
3234
| `UART1_RX_PIN` | `PB7` | `UART_RX_PIN` |
3335
| `UART2_TX_PIN` | `PA2` | |
3436
| `UART2_RX_PIN` | `PA3` | |
35-
| `I2C1_SCL_PIN` | `PA9` | `I2C0_SCL_PIN` |
36-
| `I2C1_SDA_PIN` | `PA10` | `I2C0_SDA_PIN` |
37+
| `I2C2_SCL_PIN` | `PB15` | `I2C0_SCL_PIN` |
38+
| `I2C2_SDA_PIN` | `PA15` | `I2C0_SDA_PIN` |
3739

3840
## Machine Package Docs
3941

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,37 @@ TWI_FREQ is the I2C bus speed. Normally either 100 kHz, or 400 kHz for high-spee
118118
Deprecated: use 100 * machine.KHz or 400 * machine.KHz instead.
119119

120120

121+
```go
122+
const (
123+
// I2CReceive indicates target has received a message from the controller.
124+
I2CReceive I2CTargetEvent = iota
125+
126+
// I2CRequest indicates the controller is expecting a message from the target.
127+
I2CRequest
128+
129+
// I2CFinish indicates the controller has ended the transaction.
130+
//
131+
// I2C controllers can chain multiple receive/request messages without
132+
// relinquishing the bus by doing 'restarts'. I2CFinish indicates the
133+
// bus has been relinquished by an I2C 'stop'.
134+
I2CFinish
135+
)
136+
```
137+
138+
139+
140+
```go
141+
const (
142+
// I2CModeController represents an I2C peripheral in controller mode.
143+
I2CModeController I2CMode = iota
144+
145+
// I2CModeTarget represents an I2C peripheral in target mode.
146+
I2CModeTarget
147+
)
148+
```
149+
150+
151+
121152
```go
122153
const Device = deviceName
123154
```
@@ -450,6 +481,7 @@ type ADCConfig struct {
450481
Reference uint32 // analog reference voltage (AREF) in millivolts
451482
Resolution uint32 // number of bits for a single conversion (e.g., 8, 10, 12)
452483
Samples uint32 // number of samples for a single conversion (e.g., 4, 8, 16, 32)
484+
SampleTime uint32 // sample time, in microseconds (µs)
453485
}
454486
```
455487

@@ -535,6 +567,30 @@ I2CConfig is used to store config info for I2C.
535567

536568

537569

570+
## type I2CMode
571+
572+
```go
573+
type I2CMode int
574+
```
575+
576+
I2CMode determines if an I2C peripheral is in Controller or Target mode.
577+
578+
579+
580+
581+
582+
## type I2CTargetEvent
583+
584+
```go
585+
type I2CTargetEvent uint8
586+
```
587+
588+
I2CTargetEvent reflects events on the I2C bus
589+
590+
591+
592+
593+
538594
## type NullSerial
539595

540596
```go

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,37 @@ TWI_FREQ is the I2C bus speed. Normally either 100 kHz, or 400 kHz for high-spee
136136
Deprecated: use 100 * machine.KHz or 400 * machine.KHz instead.
137137

138138

139+
```go
140+
const (
141+
// I2CReceive indicates target has received a message from the controller.
142+
I2CReceive I2CTargetEvent = iota
143+
144+
// I2CRequest indicates the controller is expecting a message from the target.
145+
I2CRequest
146+
147+
// I2CFinish indicates the controller has ended the transaction.
148+
//
149+
// I2C controllers can chain multiple receive/request messages without
150+
// relinquishing the bus by doing 'restarts'. I2CFinish indicates the
151+
// bus has been relinquished by an I2C 'stop'.
152+
I2CFinish
153+
)
154+
```
155+
156+
157+
158+
```go
159+
const (
160+
// I2CModeController represents an I2C peripheral in controller mode.
161+
I2CModeController I2CMode = iota
162+
163+
// I2CModeTarget represents an I2C peripheral in target mode.
164+
I2CModeTarget
165+
)
166+
```
167+
168+
169+
139170
```go
140171
const Device = deviceName
141172
```
@@ -495,6 +526,7 @@ type ADCConfig struct {
495526
Reference uint32 // analog reference voltage (AREF) in millivolts
496527
Resolution uint32 // number of bits for a single conversion (e.g., 8, 10, 12)
497528
Samples uint32 // number of samples for a single conversion (e.g., 4, 8, 16, 32)
529+
SampleTime uint32 // sample time, in microseconds (µs)
498530
}
499531
```
500532

@@ -580,6 +612,30 @@ I2CConfig is used to store config info for I2C.
580612

581613

582614

615+
## type I2CMode
616+
617+
```go
618+
type I2CMode int
619+
```
620+
621+
I2CMode determines if an I2C peripheral is in Controller or Target mode.
622+
623+
624+
625+
626+
627+
## type I2CTargetEvent
628+
629+
```go
630+
type I2CTargetEvent uint8
631+
```
632+
633+
I2CTargetEvent reflects events on the I2C bus
634+
635+
636+
637+
638+
583639
## type NullSerial
584640

585641
```go

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

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,37 @@ TWI_FREQ is the I2C bus speed. Normally either 100 kHz, or 400 kHz for high-spee
192192
Deprecated: use 100 * machine.KHz or 400 * machine.KHz instead.
193193

194194

195+
```go
196+
const (
197+
// I2CReceive indicates target has received a message from the controller.
198+
I2CReceive I2CTargetEvent = iota
199+
200+
// I2CRequest indicates the controller is expecting a message from the target.
201+
I2CRequest
202+
203+
// I2CFinish indicates the controller has ended the transaction.
204+
//
205+
// I2C controllers can chain multiple receive/request messages without
206+
// relinquishing the bus by doing 'restarts'. I2CFinish indicates the
207+
// bus has been relinquished by an I2C 'stop'.
208+
I2CFinish
209+
)
210+
```
211+
212+
213+
214+
```go
215+
const (
216+
// I2CModeController represents an I2C peripheral in controller mode.
217+
I2CModeController I2CMode = iota
218+
219+
// I2CModeTarget represents an I2C peripheral in target mode.
220+
I2CModeTarget
221+
)
222+
```
223+
224+
225+
195226
```go
196227
const (
197228
I2SModeSource I2SMode = iota
@@ -370,6 +401,12 @@ var (
370401

371402

372403

404+
```go
405+
var Flash flashBlockDevice
406+
```
407+
408+
409+
373410
```go
374411
var (
375412
ErrPWMPeriodTooLong = errors.New("pwm: period too long")
@@ -424,6 +461,15 @@ func CPUFrequency() uint32
424461
Return the current CPU frequency in hertz.
425462

426463

464+
### func CPUReset
465+
466+
```go
467+
func CPUReset()
468+
```
469+
470+
CPUReset performs a hard system reset.
471+
472+
427473
### func EnableCDC
428474

429475
```go
@@ -469,6 +515,26 @@ EnterBootloader should perform a system reset in preperation
469515
to switch to the bootloader to flash new firmware.
470516

471517

518+
### func FlashDataEnd
519+
520+
```go
521+
func FlashDataEnd() uintptr
522+
```
523+
524+
Return the end of the writable flash area. Usually this is the address one
525+
past the end of the on-chip flash.
526+
527+
528+
### func FlashDataStart
529+
530+
```go
531+
func FlashDataStart() uintptr
532+
```
533+
534+
Return the start of the writable flash area, aligned on a page boundary. This
535+
is usually just after the program and static data.
536+
537+
472538
### func InitADC
473539

474540
```go
@@ -560,6 +626,7 @@ type ADCConfig struct {
560626
Reference uint32 // analog reference voltage (AREF) in millivolts
561627
Resolution uint32 // number of bits for a single conversion (e.g., 8, 10, 12)
562628
Samples uint32 // number of samples for a single conversion (e.g., 4, 8, 16, 32)
629+
SampleTime uint32 // sample time, in microseconds (µs)
563630
}
564631
```
565632

@@ -570,6 +637,43 @@ value of each parameter will use the peripheral's default settings.
570637

571638

572639

640+
## type BlockDevice
641+
642+
```go
643+
type BlockDevice interface {
644+
// ReadAt reads the given number of bytes from the block device.
645+
io.ReaderAt
646+
647+
// WriteAt writes the given number of bytes to the block device.
648+
io.WriterAt
649+
650+
// Size returns the number of bytes in this block device.
651+
Size() int64
652+
653+
// WriteBlockSize returns the block size in which data can be written to
654+
// memory. It can be used by a client to optimize writes, non-aligned writes
655+
// should always work correctly.
656+
WriteBlockSize() int64
657+
658+
// EraseBlockSize returns the smallest erasable area on this particular chip
659+
// in bytes. This is used for the block size in EraseBlocks.
660+
// It must be a power of two, and may be as small as 1. A typical size is 4096.
661+
EraseBlockSize() int64
662+
663+
// EraseBlocks erases the given number of blocks. An implementation may
664+
// transparently coalesce ranges of blocks into larger bundles if the chip
665+
// supports this. The start and len parameters are in block numbers, use
666+
// EraseBlockSize to map addresses to blocks.
667+
EraseBlocks(start, len int64) error
668+
}
669+
```
670+
671+
BlockDevice is the raw device that is meant to store flash data.
672+
673+
674+
675+
676+
573677
## type DAC
574678

575679
```go
@@ -713,6 +817,30 @@ I2CConfig is used to store config info for I2C.
713817

714818

715819

820+
## type I2CMode
821+
822+
```go
823+
type I2CMode int
824+
```
825+
826+
I2CMode determines if an I2C peripheral is in Controller or Target mode.
827+
828+
829+
830+
831+
832+
## type I2CTargetEvent
833+
834+
```go
835+
type I2CTargetEvent uint8
836+
```
837+
838+
I2CTargetEvent reflects events on the I2C bus
839+
840+
841+
842+
843+
716844
## type I2S
717845

718846
```go

0 commit comments

Comments
 (0)