2019-04-09 14:10:27 +08:00
|
|
|
import os
|
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
Import('SDK_LIB')
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# add general drivers
|
|
|
|
src = Split('''
|
|
|
|
board.c
|
|
|
|
CubeMX_Config/Src/stm32l4xx_hal_msp.c
|
|
|
|
''')
|
|
|
|
|
2019-04-24 09:35:06 +08:00
|
|
|
if GetDepend(['BSP_USING_DSI']):
|
|
|
|
src += Glob('ports/drv_lcd_dsi.c')
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SRAM']):
|
|
|
|
src += Glob('ports/drv_sram.c')
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_TOUCH']):
|
2023-01-09 10:14:23 +08:00
|
|
|
src += Glob('ports/drv_touch.c')
|
|
|
|
src += Glob('ports/drv_touch_ft.c')
|
2019-04-24 09:35:06 +08:00
|
|
|
|
2019-04-09 14:10:27 +08:00
|
|
|
path = [cwd]
|
|
|
|
path += [cwd + '/CubeMX_Config/Inc']
|
2019-04-24 09:35:06 +08:00
|
|
|
path += [cwd + '/ports/include']
|
2019-04-09 14:10:27 +08:00
|
|
|
|
|
|
|
startup_path_prefix = SDK_LIB
|
|
|
|
|
2022-05-31 06:04:05 +08:00
|
|
|
if rtconfig.PLATFORM in ['gcc']:
|
2019-04-09 14:10:27 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l4r9xx.s']
|
2022-04-20 09:56:04 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2019-04-09 14:10:27 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l4r9xx.s']
|
2022-05-31 06:11:15 +08:00
|
|
|
elif rtconfig.PLATFORM in ['iccarm']:
|
2019-04-09 14:10:27 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l4r9xx.s']
|
|
|
|
|
|
|
|
# STM32L412xx || STM32L422xx || STM32L431xx
|
|
|
|
# STM32L432xx || STM32L433xx || STM32L442xx
|
|
|
|
# STM32L443xx || STM32L451xx || STM32L452xx
|
|
|
|
# STM32L462xx || STM32L471xx || STM32L475xx
|
|
|
|
# STM32L476xx || STM32L485xx || STM32L486xx
|
|
|
|
# STM32L496xx || STM32L4A6xx || STM32L4R5xx
|
|
|
|
# STM32L4R7xx || STM32L4R9xx || STM32L4S5xx
|
|
|
|
# STM32L4S7xx || STM32L4S9xx
|
2023-01-09 10:14:23 +08:00
|
|
|
# You can select chips from the list above
|
2019-04-09 14:10:27 +08:00
|
|
|
CPPDEFINES = ['STM32L4R9xx']
|
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|
|
|
|
|