mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 13:33:39 +00:00
74429b4a14
Rename the "arduino" target to "arduino-uno" to better reflect the board it represents. The "arduino" name is kept as an alias that inherits from "arduino-uno" for backward compatibility. - Rename targets/arduino.json to targets/arduino-uno.json - Create targets/arduino.json as alias inheriting from arduino-uno - Rename board_arduino.go to board_arduino_uno.go - Update build tag from "arduino" to "arduino_uno" - Rename corresponding example files Signed-off-by: deadprogram <ron@hybridgroup.com>
43 lines
942 B
Go
43 lines
942 B
Go
//go:build (avr && atmega328p) || arduino_uno || arduino_nano
|
|
|
|
package machine
|
|
|
|
// Return the current CPU frequency in hertz.
|
|
func CPUFrequency() uint32 {
|
|
return 16000000
|
|
}
|
|
|
|
const (
|
|
// Note: start at port B because there is no port A.
|
|
portB Pin = iota * 8
|
|
portC
|
|
portD
|
|
)
|
|
|
|
const (
|
|
PB0 = portB + 0
|
|
PB1 = portB + 1 // peripherals: Timer1 channel A
|
|
PB2 = portB + 2 // peripherals: Timer1 channel B
|
|
PB3 = portB + 3 // peripherals: Timer2 channel A
|
|
PB4 = portB + 4
|
|
PB5 = portB + 5
|
|
PB6 = portB + 6
|
|
PB7 = portB + 7
|
|
PC0 = portC + 0
|
|
PC1 = portC + 1
|
|
PC2 = portC + 2
|
|
PC3 = portC + 3
|
|
PC4 = portC + 4 // peripherals: I2C0 SDA
|
|
PC5 = portC + 5 // peripherals: I2C0 SCL
|
|
PC6 = portC + 6
|
|
PC7 = portC + 7
|
|
PD0 = portD + 0
|
|
PD1 = portD + 1
|
|
PD2 = portD + 2
|
|
PD3 = portD + 3 // peripherals: Timer2 channel B
|
|
PD4 = portD + 4
|
|
PD5 = portD + 5 // peripherals: Timer0 channel B
|
|
PD6 = portD + 6 // peripherals: Timer0 channel A
|
|
PD7 = portD + 7
|
|
)
|