summaryrefslogtreecommitdiff
path: root/bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/SConscript
blob: 5d6dd0e1d11500f2b18690d44a374b2c2d8fab83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Import('RTT_ROOT')
Import('rtconfig')
from building import *
import os

cwd = GetCurrentDir()
group = []
src = []
path = [cwd]

if GetDepend(['RT_USING_PIN']):
    src += ['drv_gpio.c']

if GetDepend(['RT_USING_SERIAL']):
    if GetDepend(['RT_USING_SERIAL_V2']):
        src += ['drv_usart_v2.c']
    else:
        src += ['drv_usart.c']

if GetDepend(['BSP_USING_CLOCK_TIMER']) or GetDepend(['BSP_USING_PWM']) or GetDepend(['BSP_USING_PULSE_ENCODER']):
    src += ['drv_tim.c']

if GetDepend(['BSP_USING_PWM']):
    src += ['drv_pwm.c']

if GetDepend(['RT_USING_SPI']):
    src += ['drv_spi.c']

if GetDepend(['RT_USING_QSPI']):
    src += ['drv_qspi.c']

if GetDepend(['RT_USING_I2C']):
    if GetDepend('BSP_USING_HARD_I2C1') or GetDepend('BSP_USING_HARD_I2C2') or GetDepend('BSP_USING_HARD_I2C3') or GetDepend('BSP_USING_HARD_I2C4') or GetDepend('BSP_USING_HARD_I2C5') or GetDepend('BSP_USING_HARD_I2C6') or GetDepend('BSP_USING_HARD_I2C7') or GetDepend('BSP_USING_HARD_I2C8') or GetDepend('BSP_USING_HARD_I2C9') or GetDepend('BSP_USING_HARD_I2C10'):
        src += ['drv_hard_i2c.c']

if GetDepend(['BSP_USING_ETH', 'RT_USING_LWIP']):
    src += ['drv_eth.c']

if GetDepend(['RT_USING_ADC']):
    src += ['drv_adc.c']

if GetDepend(['RT_USING_DAC']):
    src += ['drv_dac.c']

if GetDepend(['RT_USING_CAN']):
    if GetDepend(['SOC_SERIES_N32H7xx']) or GetDepend(['SOC_SERIES_N32H47x_48x']) or GetDepend(['SOC_SERIES_N32H49x']):
        src += ['drv_fdcan.c']
    else:
        src += ['drv_can.c']

if GetDepend(['RT_USING_PM']):
    src += ['drv_pm.c']

if GetDepend(['BSP_USING_LPTIM']):
    src += ['drv_lptim.c']

if GetDepend('BSP_USING_SDRAM'):
    src += ['drv_sdram.c']

if GetDepend(['BSP_USING_NAND']):
    src += ['drv_nand.c']

if GetDepend('BSP_USING_LCD'):
    src += ['drv_lcd.c']

if GetDepend('BSP_USING_ONCHIP_RTC'):
    src += ['drv_rtc.c']

if GetDepend(['BSP_USING_ON_CHIP_FLASH', 'SOC_SERIES_N32H49x']):
    src += [os.path.join('drv_flash', 'drv_flash_h49x.c')]

if GetDepend(['BSP_USING_ON_CHIP_FLASH', 'SOC_SERIES_N32H47x_48x']):
    src += [os.path.join('drv_flash', 'drv_flash_h47x_48x.c')]

if GetDepend(['BSP_USING_ON_CHIP_FLASH', 'SOC_SERIES_N32H7xx']):
    src += [os.path.join('drv_flash', 'drv_flash_h7xx.c')]

if GetDepend(['BSP_USING_WDT']):
    src += ['drv_wdt.c']

if GetDepend(['BSP_USING_SDIO']):
    if GetDepend('SOC_SERIES_N32H7xx'):
        src += ['drv_sdmmc.c']
    else:
        src += ['drv_sdio.c']

if GetDepend(['BSP_USING_PULSE_ENCODER']):
    src += ['drv_pulse_encoder.c']


path += [os.path.join(cwd, 'config')]

if GetDepend('BSP_USING_ON_CHIP_FLASH'):
    path += [os.path.join(cwd, 'drv_flash')]

group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)

Return('group')