maixbit: add board definition and dummy runtime

This commit is contained in:
Yannis Huber
2020-06-15 08:56:11 +02:00
committed by Ron Evans
parent 2fe4a9be71
commit 7814964693
6 changed files with 284 additions and 1 deletions
+55
View File
@@ -0,0 +1,55 @@
// +build maixbit
package machine
// K210 IO pins.
const (
P00 Pin = 0
P01 Pin = 1
P02 Pin = 2
P03 Pin = 3
P04 Pin = 4
P05 Pin = 5
P06 Pin = 6
P07 Pin = 7
P08 Pin = 8
P09 Pin = 9
P10 Pin = 10
P11 Pin = 11
P12 Pin = 12
P13 Pin = 13
P14 Pin = 14
P15 Pin = 15
P16 Pin = 16
P17 Pin = 17
P18 Pin = 18
P19 Pin = 19
P20 Pin = 20
P21 Pin = 21
P22 Pin = 22
P23 Pin = 23
P24 Pin = 24
P25 Pin = 25
P26 Pin = 26
P27 Pin = 27
P28 Pin = 28
P29 Pin = 29
P30 Pin = 30
P31 Pin = 31
P32 Pin = 32
P33 Pin = 33
P34 Pin = 34
P35 Pin = 35
P36 Pin = 36
P37 Pin = 37
P38 Pin = 38
P39 Pin = 39
P40 Pin = 40
P41 Pin = 41
P42 Pin = 42
P43 Pin = 43
P44 Pin = 44
P45 Pin = 45
P46 Pin = 46
P47 Pin = 47
)
+61
View File
@@ -0,0 +1,61 @@
// +build maixbit
package machine
// GPIO pins.
const (
D0 = P08
D1 = P09
D2 = P10
D3 = P11
D4 = P12
D5 = P13
D6 = P14
D7 = P15
)
// High-speed GPIO pins (GPIOHS).
const (
DHS0 = P16
DHS1 = P17
DHS2 = P18
DHS3 = P19
DHS4 = P20
DHS5 = P21
DHS6 = P22
DHS7 = P23
DHS8 = P24
DHS9 = P25
DHS10 = P26
DHS11 = P27
DHS12 = P28
DHS13 = P29
DHS14 = P30
DHS15 = P31
DHS16 = P32
DHS17 = P33
DHS18 = P34
DHS19 = P35
DHS20 = P36
DHS21 = P37
DHS22 = P38
DHS23 = P39
DHS24 = P40
DHS25 = P41
DHS26 = P42
DHS27 = P43
DHS28 = P44
DHS29 = P45
DHS30 = P46
DHS31 = P47
)
const (
LED = LED1
LED1 = LED_RED
LED2 = LED_GREEN
LED3 = LED_BLUE
LED_RED = D5
LED_GREEN = D4
LED_BLUE = D6
)
+30
View File
@@ -0,0 +1,30 @@
// +build k210
package machine
func CPUFrequency() uint32 {
return 400000000
}
type PinMode uint8
const (
PinInput PinMode = iota
PinOutput
PinPWM
PinSPI
PinI2C = PinSPI
)
// Configure this pin with the given configuration.
func (p Pin) Configure(config PinConfig) {
}
// Set the pin to high or low.
func (p Pin) Set(high bool) {
}
// Get returns the current value of a GPIO pin.
func (p Pin) Get() bool {
return true
}