2013-01-08 22:40:58 +08:00
|
|
|
from building import *
|
2023-08-21 01:26:39 +08:00
|
|
|
from gcc import *
|
2017-12-10 16:53:03 +08:00
|
|
|
import rtconfig
|
2013-01-08 22:40:58 +08:00
|
|
|
|
2014-07-31 14:42:37 +08:00
|
|
|
cwd = GetCurrentDir()
|
2024-09-14 05:40:40 +08:00
|
|
|
src = ['dev_spi_core.c', 'dev_spi.c']
|
2014-08-29 21:53:28 +08:00
|
|
|
CPPPATH = [cwd, cwd + '/../include']
|
2021-12-22 11:03:03 +08:00
|
|
|
LOCAL_CFLAGS = ''
|
2014-07-31 14:42:37 +08:00
|
|
|
|
2022-03-23 14:16:14 +08:00
|
|
|
if GetDepend('RT_USING_SPI_BITOPS'):
|
2024-09-14 05:40:40 +08:00
|
|
|
src += ['dev_spi_bit_ops.c']
|
2022-03-23 14:16:14 +08:00
|
|
|
|
2018-11-26 13:34:33 +08:00
|
|
|
if GetDepend('RT_USING_QSPI'):
|
2024-09-14 05:40:40 +08:00
|
|
|
src += ['dev_qspi_core.c']
|
2018-11-26 13:34:33 +08:00
|
|
|
|
2014-07-31 14:42:37 +08:00
|
|
|
src_device = []
|
|
|
|
|
|
|
|
if GetDepend('RT_USING_SPI_WIFI'):
|
2024-09-14 05:40:40 +08:00
|
|
|
src_device += ['dev_spi_wifi_rw009.c']
|
2014-07-31 14:42:37 +08:00
|
|
|
|
|
|
|
if GetDepend('RT_USING_ENC28J60'):
|
|
|
|
src_device += ['enc28j60.c']
|
|
|
|
|
2018-02-06 20:26:49 +08:00
|
|
|
if GetDepend('RT_USING_SPI_MSD'):
|
2024-09-14 05:40:40 +08:00
|
|
|
src_device += ['dev_spi_msd.c']
|
2018-02-06 20:26:49 +08:00
|
|
|
|
2016-10-09 09:06:01 +08:00
|
|
|
if GetDepend('RT_USING_SFUD'):
|
2024-09-14 05:40:40 +08:00
|
|
|
src_device += ['dev_spi_flash_sfud.c', 'sfud/src/sfud.c']
|
2016-10-09 09:06:01 +08:00
|
|
|
CPPPATH += [cwd + '/sfud/inc']
|
|
|
|
if GetDepend('RT_SFUD_USING_SFDP'):
|
|
|
|
src_device += ['sfud/src/sfud_sfdp.c']
|
2022-01-20 14:20:43 +08:00
|
|
|
|
2023-08-21 01:26:39 +08:00
|
|
|
if rtconfig.PLATFORM in GetGCCLikePLATFORM():
|
2022-01-20 14:20:43 +08:00
|
|
|
LOCAL_CFLAGS += ' -std=c99'
|
2022-08-15 22:32:27 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc']:
|
2022-01-20 14:20:43 +08:00
|
|
|
LOCAL_CFLAGS += ' --c99'
|
2016-05-20 14:07:32 +08:00
|
|
|
|
2024-11-27 11:08:08 +08:00
|
|
|
if GetDepend('RT_USING_DM'):
|
|
|
|
src += ['dev_spi_dm.c', 'dev_spi_bus.c']
|
|
|
|
|
2014-07-31 14:42:37 +08:00
|
|
|
src += src_device
|
|
|
|
|
2021-12-22 11:03:03 +08:00
|
|
|
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH, LOCAL_CFLAGS = LOCAL_CFLAGS)
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
Return('group')
|