2024-01-28 16:05:52 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
2024-03-21 13:13:52 +08:00
|
|
|
src = Split('''
|
2024-03-28 23:35:54 +08:00
|
|
|
drv_uart.c
|
|
|
|
drv_por.c
|
2024-05-14 06:20:57 +08:00
|
|
|
drv_gpio.c
|
2024-03-21 13:13:52 +08:00
|
|
|
''')
|
2024-01-28 16:05:52 +08:00
|
|
|
CPPDEFINES = []
|
|
|
|
|
|
|
|
CPPPATH = [cwd]
|
|
|
|
|
2024-03-28 23:35:54 +08:00
|
|
|
CHIP_TYPE = 'cv180x'
|
2024-04-09 22:48:57 +08:00
|
|
|
if GetDepend('BOARD_TYPE_MILKV_DUO256M') or GetDepend('BOARD_TYPE_MILKV_DUO256M_SPINOR') or GetDepend('BOARD_TYPE_MILKV_DUO256M_SPINAND'):
|
2024-03-28 23:35:54 +08:00
|
|
|
CHIP_TYPE = 'cv181x'
|
|
|
|
elif GetDepend('BOARD_TYPE_MILKV_DUO') or GetDepend('BOARD_TYPE_MILKV_DUO_SPINOR') or GetDepend('BOARD_TYPE_MILKV_DUO_SPINAND'):
|
|
|
|
CHIP_TYPE = 'cv180x'
|
2024-01-28 16:05:52 +08:00
|
|
|
|
2024-03-28 23:35:54 +08:00
|
|
|
CPPPATH += [cwd + r'/libraries']
|
|
|
|
CPPPATH += [cwd + r'/libraries/' + CHIP_TYPE]
|
|
|
|
|
2024-02-16 07:05:39 +08:00
|
|
|
if GetDepend('BSP_USING_I2C'):
|
|
|
|
src += ['drv_hw_i2c.c']
|
|
|
|
|
2024-02-28 00:04:31 +08:00
|
|
|
if GetDepend('BSP_USING_ADC'):
|
|
|
|
src += ['drv_adc.c']
|
|
|
|
|
2024-03-04 00:37:38 +08:00
|
|
|
if GetDepend('BSP_USING_WDT'):
|
|
|
|
src += ['drv_wdt.c']
|
|
|
|
|
2024-03-31 20:28:24 +08:00
|
|
|
if GetDepend(['BSP_USING_SPI']):
|
|
|
|
src += ['drv_spi.c']
|
|
|
|
|
2024-03-02 16:16:22 +08:00
|
|
|
if GetDepend('BSP_USING_PWM'):
|
|
|
|
src += ['drv_pwm.c']
|
2024-03-28 23:35:54 +08:00
|
|
|
CPPPATH += [cwd + r'/libraries/cv180x/pwm']
|
2024-04-24 05:40:22 +08:00
|
|
|
|
|
|
|
if GetDepend('BSP_USING_SDH'):
|
|
|
|
src += ['drv_sdhci.c', 'port/mnt.c']
|
|
|
|
CPPPATH += [cwd + r'/libraries/sdif']
|
|
|
|
|
2024-04-30 05:47:50 +08:00
|
|
|
|
|
|
|
if GetDepend('BSP_USING_ETH'):
|
|
|
|
src += Split('''
|
|
|
|
drv_eth.c
|
|
|
|
libraries/eth/dw_eth_mac.c
|
|
|
|
libraries/eth/cvi_eth_phy.c
|
|
|
|
libraries/eth/eth_phy_cvitek.c
|
|
|
|
''')
|
|
|
|
CPPPATH += [cwd + r'/libraries/eth']
|
|
|
|
|
2024-01-28 16:05:52 +08:00
|
|
|
CPPDEFINES += ['-DCONFIG_64BIT']
|
|
|
|
|
2024-03-08 06:18:53 +08:00
|
|
|
if GetDepend('BSP_USING_RTC'):
|
|
|
|
src += ['drv_rtc.c']
|
|
|
|
|
2024-01-28 16:05:52 +08:00
|
|
|
group = DefineGroup('drivers', src, depend = [''], CPPDEFINES = CPPDEFINES, CPPPATH = CPPPATH)
|
|
|
|
|
|
|
|
Return('group')
|