Skip to content

Commit fa6d383

Browse files
committed
WIP
1 parent 93366e8 commit fa6d383

File tree

6 files changed

+6
-21
lines changed

6 files changed

+6
-21
lines changed

src/machine/board_embedfire_py32f002b.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//go:build embedfire_py32f002b
22

33
// Pin mappings for the Embedfire PY32F002B board.
4-
// Only LED and button aliases are provided.
54

65
package machine
76

src/machine/board_embedfire_py32f030.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//go:build embedfire_py32f030
22

33
// Pin mappings for the Embedfire PY32F030 board.
4-
// Only LED and button aliases are provided.
54

65
package machine
76

src/machine/machine_py32_pin.go

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99

1010
const deviceName = py32.Device
1111

12-
// Peripheral port offsets. Keep the same spacing used on other MCUs so helpers
13-
// like Pin.getPort can keep using simple division by 16 even though PY32 ports
14-
// only expose 8 pins each.
12+
// Peripheral port offsets.
13+
// Keep the same spacing used on other MCUs so helpers like Pin.getPortNumber
14+
// can keep using simple division by 16.
1515
const (
1616
portA Pin = iota * 16
1717
portB
@@ -21,7 +21,6 @@ const (
2121
portF
2222
)
2323

24-
// Port A pins.
2524
const (
2625
PA0 Pin = portA + iota
2726
PA1
@@ -41,7 +40,6 @@ const (
4140
PA15
4241
)
4342

44-
// Port B pins.
4543
const (
4644
PB0 Pin = portB + iota
4745
PB1
@@ -61,7 +59,6 @@ const (
6159
PB15
6260
)
6361

64-
// Port C pins.
6562
const (
6663
PC0 Pin = portC + iota
6764
PC1
@@ -81,7 +78,6 @@ const (
8178
PC15
8279
)
8380

84-
// Port D pins.
8581
const (
8682
PD0 Pin = portD + iota
8783
PD1
@@ -101,7 +97,6 @@ const (
10197
PD15
10298
)
10399

104-
// Port E pins.
105100
const (
106101
PE0 Pin = portE + iota
107102
PE1
@@ -121,7 +116,6 @@ const (
121116
PE15
122117
)
123118

124-
// Port F pins.
125119
const (
126120
PF0 Pin = portF + iota
127121
PF1
@@ -141,7 +135,6 @@ const (
141135
PF15
142136
)
143137

144-
// PinMode values specific to PY32: only GPIO direction and pull configuration.
145138
const (
146139
PinOutput PinMode = iota
147140
PinInputFloating
@@ -151,7 +144,6 @@ const (
151144
)
152145
const PinInput PinMode = PinInputFloating
153146

154-
// Internal helpers for GPIO configuration.
155147
const (
156148
gpioModeInput = 0
157149
gpioModeOutput = 1
@@ -167,11 +159,6 @@ const (
167159
gpioOutputSpeedMask = 0x3
168160
)
169161

170-
// // CPUFrequency returns the core clock frequency.
171-
// func CPUFrequency() uint32 {
172-
// return 48_000_000
173-
// }
174-
175162
func (p Pin) getPortNumber() uint8 {
176163
return uint8(p) >> 4
177164

src/machine/machine_py32_pin_afrh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build py32 && !py32f002bxx
1+
//go:build py32 && !no_gpio_afrh
22

33
package machine
44

src/machine/machine_py32_pin_no_afrh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build py32 && py32f002bxx
1+
//go:build py32 && no_gpio_afrh
22

33
package machine
44

targets/py32f002b.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"py32"
44
],
55
"build-tags": [
6-
"py32f002bxx"
6+
"py32f002bxx", "no_gpio_afrh"
77
],
88
"linkerscript": "targets/py32f002b.ld",
99
"extra-files": [

0 commit comments

Comments
 (0)