mirror of https://github.com/tinygo-org/tinygo.git
Ayke van Laethem
5 years ago
committed by
Ron Evans
5 changed files with 54 additions and 12 deletions
@ -0,0 +1,27 @@ |
|||
// +build arduino_nano
|
|||
|
|||
package machine |
|||
|
|||
// Return the current CPU frequency in hertz.
|
|||
func CPUFrequency() uint32 { |
|||
return 16000000 |
|||
} |
|||
|
|||
// LED on the Arduino
|
|||
const LED Pin = 13 |
|||
|
|||
// ADC on the Arduino
|
|||
const ( |
|||
ADC0 Pin = 0 |
|||
ADC1 Pin = 1 |
|||
ADC2 Pin = 2 |
|||
ADC3 Pin = 3 |
|||
ADC4 Pin = 4 // Used by TWI for SDA
|
|||
ADC5 Pin = 5 // Used by TWI for SCL
|
|||
) |
|||
|
|||
// UART pins
|
|||
const ( |
|||
UART_TX_PIN Pin = 1 |
|||
UART_RX_PIN Pin = 0 |
|||
) |
@ -0,0 +1,9 @@ |
|||
{ |
|||
"inherits": ["atmega328p"], |
|||
"build-tags": ["arduino_nano"], |
|||
"ldflags": [ |
|||
"-Wl,--defsym=_bootloader_size=512", |
|||
"-Wl,--defsym=_stack_size=512" |
|||
], |
|||
"flash-command": "avrdude -c arduino -p atmega328p -b 57600 -P {port} -U flash:w:{hex}:i" |
|||
} |
@ -1,19 +1,9 @@ |
|||
{ |
|||
"inherits": ["avr"], |
|||
"llvm-target": "avr-atmel-none", |
|||
"cpu": "atmega328p", |
|||
"build-tags": ["arduino", "atmega328p", "atmega", "avr5"], |
|||
"cflags": [ |
|||
"-mmcu=atmega328p" |
|||
], |
|||
"inherits": ["atmega328p"], |
|||
"build-tags": ["arduino"], |
|||
"ldflags": [ |
|||
"-Wl,--defsym=_bootloader_size=512", |
|||
"-Wl,--defsym=_stack_size=512" |
|||
], |
|||
"linkerscript": "src/device/avr/atmega328p.ld", |
|||
"extra-files": [ |
|||
"targets/avr.S", |
|||
"src/device/avr/atmega328p.s" |
|||
], |
|||
"flash-command": "avrdude -c arduino -p atmega328p -P {port} -U flash:w:{hex}:i" |
|||
} |
|||
|
@ -0,0 +1,14 @@ |
|||
{ |
|||
"inherits": ["avr"], |
|||
"llvm-target": "avr-atmel-none", |
|||
"cpu": "atmega328p", |
|||
"build-tags": ["atmega328p", "atmega", "avr5"], |
|||
"cflags": [ |
|||
"-mmcu=atmega328p" |
|||
], |
|||
"linkerscript": "src/device/avr/atmega328p.ld", |
|||
"extra-files": [ |
|||
"targets/avr.S", |
|||
"src/device/avr/atmega328p.s" |
|||
] |
|||
} |
Loading…
Reference in new issue