You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
2.0 KiB
115 lines
2.0 KiB
#ifndef CONFIG_H_
|
|
#define CONFIG_H_
|
|
|
|
#include <inttypes.h>
|
|
#include <avr/io.h>
|
|
|
|
//Configure project
|
|
//Select MCU in project properties
|
|
|
|
//Undefine this if needed
|
|
#define _DEBUG_
|
|
//#define _NO_BOOTLOADER_
|
|
|
|
//Choose one
|
|
#define _SLAVE_MODULE_
|
|
//#define _SLAVE_EXT_
|
|
//#define _CUSTOM_TYPE_
|
|
|
|
//After this see idibus_hw.h to change PIN definition
|
|
|
|
//Done!
|
|
|
|
|
|
//For 328pb
|
|
#ifdef __ATmega328PB__
|
|
|
|
|
|
#define FLASH_SIZE 256*1024
|
|
|
|
//DONT FORGET TO CHANGE LINKER OPTIONS!!!!
|
|
#define locationInBoot (0x3FE8UL) //CAREFUL ONLY 48 byte in size for data
|
|
#define locationInApp (0x37C0UL)
|
|
|
|
//FUSES
|
|
#define F_Low 0xE0
|
|
#define F_Ext 0xFC
|
|
|
|
#ifdef _DEBUG_
|
|
#define F_High 0xC0 //Allow DebugWIRE + EEPROM save
|
|
#define F_Lock 0xFF //Disable LOCKS
|
|
#else
|
|
#define F_High 0xC8 //No DEBUG thing + No EEPROM save
|
|
#define F_Lock 0xCC
|
|
#endif
|
|
|
|
#define SRAM_size 2048UL
|
|
|
|
#endif
|
|
|
|
//For 2560
|
|
#ifdef __ATmega2560__
|
|
|
|
#define _LONG_ADDR_SPACE_
|
|
#define _FAT_CRC_
|
|
|
|
|
|
#define FLASH_SIZE 256*1024
|
|
|
|
//Settings in the linker
|
|
#define locationInBoot (0x1FF80ULL)
|
|
#define locationInApp (0x1EF80ULL)
|
|
|
|
//FUSES
|
|
#define F_Low 0xE0
|
|
#define F_Ext 0xFC
|
|
|
|
#ifdef _DEBUG_
|
|
#define F_High 0x00 //Enable JTAG and OCD + EEPROM save + no bootloader
|
|
#define F_Lock 0xFF //Disable LOCKS
|
|
#else
|
|
#define F_High 0xC8 //No DEBUG thing + No EEPROM save
|
|
#define F_Lock 0xCC
|
|
#endif
|
|
|
|
|
|
#define SRAM_size 8192UL
|
|
|
|
#endif
|
|
|
|
//For 1280
|
|
#ifdef __ATmega1280__
|
|
|
|
#define _LONG_ADDR_SPACE_
|
|
#define _FAT_CRC_
|
|
|
|
|
|
#define FLASH_SIZE 128*1024
|
|
//Settings in the linker
|
|
#define locationInBoot (0x0FF80ULL)
|
|
#define locationInApp (0x0EF80ULL)
|
|
|
|
//FUSES
|
|
#define F_Low 0xE0
|
|
#define F_Ext 0xFC
|
|
|
|
#ifdef _DEBUG_
|
|
#define F_High 0x00 //Enable JTAG and OCD + EEPROM save
|
|
#define F_Lock 0xFF //Disable LOCKS
|
|
#else
|
|
#define F_High 0xC8 //No DEBUG thing + No EEPROM save
|
|
#define F_Lock 0xCC
|
|
#endif
|
|
|
|
|
|
#define SRAM_size 8192UL
|
|
|
|
#endif
|
|
//COMMON Define
|
|
#define PAGE_COUNT (((locationInApp*2)/SPM_PAGESIZE)+1)
|
|
|
|
#define LAST_FLASH_PAGE_ADDRW ((FLASH_SIZE - SPM_PAGESIZE)/2)
|
|
|
|
|
|
|
|
#endif /* CONFIG_H_ */ |