2011-02-17 11:33:15 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
2011-11-29 17:15:10 +08:00
|
|
|
# get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
2012-05-18 12:40:40 +08:00
|
|
|
if rtconfig.CROSS_TOOL == 'gcc':
|
|
|
|
compiler = 'GCC'
|
|
|
|
|
2011-02-17 11:33:15 +08:00
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
src = Split("""
|
2012-05-18 12:40:40 +08:00
|
|
|
emlib/src/em_acmp.c
|
|
|
|
emlib/src/em_adc.c
|
|
|
|
emlib/src/em_aes.c
|
|
|
|
emlib/src/em_assert.c
|
|
|
|
emlib/src/em_cmu.c
|
|
|
|
emlib/src/em_dac.c
|
|
|
|
emlib/src/em_dbg.c
|
|
|
|
emlib/src/em_dma.c
|
|
|
|
emlib/src/em_ebi.c
|
|
|
|
emlib/src/em_emu.c
|
|
|
|
emlib/src/em_gpio.c
|
|
|
|
emlib/src/em_i2c.c
|
|
|
|
emlib/src/em_lcd.c
|
|
|
|
emlib/src/em_letimer.c
|
|
|
|
emlib/src/em_leuart.c
|
|
|
|
emlib/src/em_mpu.c
|
|
|
|
emlib/src/em_msc.c
|
|
|
|
emlib/src/em_pcnt.c
|
|
|
|
emlib/src/em_prs.c
|
|
|
|
emlib/src/em_rmu.c
|
|
|
|
emlib/src/em_rtc.c
|
|
|
|
emlib/src/em_system.c
|
|
|
|
emlib/src/em_timer.c
|
|
|
|
emlib/src/em_usart.c
|
|
|
|
emlib/src/em_vcmp.c
|
|
|
|
emlib/src/em_wdog.c
|
2011-02-17 11:33:15 +08:00
|
|
|
""")
|
|
|
|
|
2012-05-18 12:40:40 +08:00
|
|
|
# system code for each EFM32 family
|
|
|
|
system_codes = {}
|
|
|
|
system_codes['TinyGecko'] = 'EFM32TG/Source/system_efm32tg.c'
|
|
|
|
system_codes['Gecko'] = 'EFM32G/Source/system_efm32g.c'
|
|
|
|
system_codes['Giant Gecko'] = 'EFM32GG/Source/system_efm32gg.c'
|
|
|
|
|
|
|
|
# path of header files for each EFM32 family
|
|
|
|
header_path = {}
|
|
|
|
header_path['TinyGecko'] = 'EFM32TG'
|
|
|
|
header_path['Gecko'] = 'EFM32G'
|
|
|
|
header_path['Giant Gecko'] = 'EFM32GG'
|
|
|
|
|
2011-06-20 09:56:28 +08:00
|
|
|
# starupt scripts for each EFM32 family
|
2011-07-08 15:13:20 +08:00
|
|
|
startup_scripts = {}
|
2012-05-18 12:40:40 +08:00
|
|
|
startup_scripts['TinyGecko'] = 'EFM32TG/Source/' + compiler + '/startup_efm32tg.s'
|
|
|
|
startup_scripts['Gecko'] = 'EFM32G/Source/' + compiler + '/startup_efm32g.s'
|
|
|
|
startup_scripts['Giant Gecko'] = 'EFM32GG/Source/' + compiler + '/startup_efm32gg.s'
|
2011-06-20 09:56:28 +08:00
|
|
|
|
|
|
|
# linker scripts for each EFM32 family
|
2011-12-27 15:44:29 +08:00
|
|
|
linker_scripts = {}
|
2012-05-18 12:40:40 +08:00
|
|
|
linker_scripts['TinyGecko'] = 'EFM32TG/Source/' + compiler + '/efm32tg.ld'
|
|
|
|
linker_scripts['Gecko'] = 'EFM32G/Source/' + compiler + '/efm32g.ld'
|
|
|
|
linker_scripts['Giant Gecko'] = 'EFM32GG/Source/' + compiler + '/efm32gg.ld'
|
2011-06-20 09:56:28 +08:00
|
|
|
|
2012-05-18 12:40:40 +08:00
|
|
|
system_codes[rtconfig.EFM32_FAMILY] = 'Device/EnergyMicro/' + system_codes[rtconfig.EFM32_FAMILY]
|
|
|
|
startup_scripts[rtconfig.EFM32_FAMILY] = 'Device/EnergyMicro/' + startup_scripts[rtconfig.EFM32_FAMILY]
|
|
|
|
linker_scripts[rtconfig.EFM32_FAMILY] = cwd + '/Device/EnergyMicro/' + linker_scripts[rtconfig.EFM32_FAMILY]
|
|
|
|
src = src + [system_codes[rtconfig.EFM32_FAMILY]] + [startup_scripts[rtconfig.EFM32_FAMILY]]
|
2011-12-16 09:05:50 +08:00
|
|
|
|
2012-05-18 12:40:40 +08:00
|
|
|
path = [cwd + '/emlib/inc',
|
|
|
|
cwd + '/CMSIS/Include',
|
|
|
|
cwd + '/Device/EnergyMicro/' + header_path[rtconfig.EFM32_FAMILY] + '/Include']
|
2011-02-17 11:33:15 +08:00
|
|
|
|
2011-11-29 17:15:10 +08:00
|
|
|
CPPDEFINES = [rtconfig.EFM32_TYPE]
|
2011-12-27 15:44:29 +08:00
|
|
|
#group = DefineGroup('EFM32_StdPeriph', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES, LINKFLAGS = linker_scripts[rtconfig.EFM32_FAMILY])
|
2011-06-20 09:56:28 +08:00
|
|
|
group = DefineGroup('EFM32_StdPeriph', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
Return('group')
|