#######################################
## This file is created by MCUdude 
## for use with MicroCore - an Arduino
## core for the ATtiny13.
## https://github.com/MCUdude/MicroCore
##
## This is the file where fuse settings
## and compiler flags are located.
#######################################

menu.BOD=BOD
menu.eeprom=EEPROM
menu.clock=Clock
menu.timing=Timing

# General
13.name=ATtiny13
13.bootloader.tool=avrdude
13.upload.tool=avrdude
13.upload.using=avrdude
13.bootloader.unlock_bits=0x3f
13.bootloader.lock_bits=0x3e
13.build.core=microcore
13.build.board=attiny
13.build.extra_flags={build.timing}
13.upload.maximum_size=1024
13.upload.maximum_data_size=64
13.build.mcu_compile=attiny13a
13.build.mcu=attiny13
13.build.variant=attiny13

#LTO
13.compiler.c.extra_flags=-Wextra -flto -g
13.compiler.c.elf.extra_flags=-w -flto -g
13.compiler.cpp.extra_flags=-Wextra -flto -g
13.compiler.flag_indicator=
13.ltoarcmd=avr-gcc-ar

# Clock frequencies
13.menu.clock.9M6=9.6 MHz internal osc.
13.menu.clock.9M6.bootloader.low_fuses=0b0{bootloader.eesave_bit}111010
13.menu.clock.9M6.build.f_cpu=9600000L

13.menu.clock.4M8=4.8 MHz internal osc.
13.menu.clock.4M8.bootloader.low_fuses=0b0{bootloader.eesave_bit}111001
13.menu.clock.4M8.build.f_cpu=4800000L

13.menu.clock.1M2=1.2 MHz internal osc.
13.menu.clock.1M2.bootloader.low_fuses=0b0{bootloader.eesave_bit}101010
13.menu.clock.1M2.build.f_cpu=1200000L

13.menu.clock.600k=600 kHz internal osc.
13.menu.clock.600k.bootloader.low_fuses=0b0{bootloader.eesave_bit}101001
13.menu.clock.600k.build.f_cpu=600000L

13.menu.clock.128k=128 KHz internal osc.
13.menu.clock.128k.bootloader.low_fuses=0b0{bootloader.eesave_bit}111011
13.menu.clock.128k.build.f_cpu=128000L

13.menu.clock.20M=20 MHz external clock
13.menu.clock.20M.bootloader.low_fuses=0b0{bootloader.eesave_bit}111000
13.menu.clock.20M.build.f_cpu=20000000L

13.menu.clock.16M=16 MHz external clock
13.menu.clock.16M.bootloader.low_fuses=0b0{bootloader.eesave_bit}111000
13.menu.clock.16M.build.f_cpu=16000000L

13.menu.clock.12M=12 MHz external clock
13.menu.clock.12M.bootloader.low_fuses=0b0{bootloader.eesave_bit}111000
13.menu.clock.12M.build.f_cpu=12000000L

13.menu.clock.8M=8 MHz external clock
13.menu.clock.8M.bootloader.low_fuses=0b0{bootloader.eesave_bit}111000
13.menu.clock.8M.build.f_cpu=8000000L

13.menu.clock.1M=1 MHz external clock
13.menu.clock.1M.bootloader.low_fuses=0b0{bootloader.eesave_bit}111000
13.menu.clock.1M.build.f_cpu=1000000L

# EEPROM
13.menu.eeprom.keep=EEPROM retained
13.menu.eeprom.keep.bootloader.eesave_bit=0
13.menu.eeprom.erase=EEPROM not retained
13.menu.eeprom.erase.bootloader.eesave_bit=1

# Brown out detection
13.menu.BOD.2v7=BOD 2.7V
13.menu.BOD.2v7.bootloader.high_fuses=0xfb
13.menu.BOD.4v3=BOD 4.3V
13.menu.BOD.4v3.bootloader.high_fuses=0xf9
13.menu.BOD.1v8=BOD 1.8V
13.menu.BOD.1v8.bootloader.high_fuses=0xfd
13.menu.BOD.disabled=BOD disabled
13.menu.BOD.disabled.bootloader.high_fuses=0xff

# Timing
13.menu.timing.micros_disabled=Micros disabled
13.menu.timing.micros_disabled.build.timing=
13.menu.timing.micros_enabled=Micros enabled
13.menu.timing.micros_enabled.build.timing=-DENABLE_MICROS
