if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']): if GetDepend('BSP_USING_I2C0') or GetDepend('BSP_USING_I2C1') or GetDepend('BSP_USING_I2C2') or GetDepend('BSP_USING_I2C3'): src += ['drv_soft_i2c.c'] # add spi drivers. if GetDepend('RT_USING_SPI'): src +=...
select RT_USING_SPI if BSP_USING_SPI config BSP_USING_SPI1 bool "Enable SPI1 BUS" default n config BSP_SPI1_TX_USING_DMA bool "Enable SPI1 TX DMA" depends on BSP_USING_SPI1 default n config BSP_SPI1_RX_USING_DMA bool "Enable SPI1 RX DMA" depends on BSP_USING_SPI1 select BSP...
ifGetDepend(['RT_USING_I2C','RT_USING_I2C_BITOPS']): ifGetDepend('BSP_USING_I2C0')orGetDepend('BSP_USING_I2C1')orGetDepend('BSP_USING_I2C2')orGetDepend('BSP_USING_I2C3'): src+=['drv_soft_i2c.c'] # add spi drivers. ifGetDepend('RT_USING_SPI'): src+=['drv_spi.c'] #...
ifGetDepend(['RT_USING_SERIAL']):src +=['GD32VF103_standard_peripheral/Source/gd32vf103_usart.c'] ifGetDepend(['RT_USING_I2C']):src +=['GD32VF103_standard_peripheral/Source/gd32vf103_i2c.c']ifGetDepend(['RT_USING_SPI']):src +=['GD32VF103_standard_peripheral/Source/gd32vf103...
若使用GPIO口模拟IIC总线,则还需要添加宏定义#define RT_USING_I2C_BITOPS。 一、IIC总线设备驱动框架 先看i2c.h中定义的一些数据结构: #define RT_I2C_WR 0x0000 #define RT_I2C_RD (1u << 0) #define RT_I2C_ADDR_10BIT (1u << 2) /* this is a ten bit chip address */...
好了,先看bsp/gd32/HAL_Drivers/SConscript文件。 Import('RTT_ROOT')Import('rtconfig')frombuildingimport*cwd=GetCurrentDir()#获取当前路径# add the general drivers.src=Split(""" """)#添加共同的驱动文件,暂无# add pin drivers.ifGetDepend('RT_USING_PIN'):src+=['drv_gpio.c']ifGetDepend(...
若使用GPIO口模拟IIC总线,则还需要添加宏定义#define RT_USING_I2C_BITOPS。 一、IIC总线设备驱动框架 先看i2c.h中定义的一些数据结构: #defineRT_I2C_WR 0x0000#defineRT_I2C_RD (1u << 0)#defineRT_I2C_ADDR_10BIT (1u << 2) /* this is a ten bit chip address */#defineRT_I2C_NO_START (...
['RT_USING_I2C','RT_USING_I2C_BITOPS']):21ifGetDepend('BSP_USING_I2C0')orGetDepend('BSP_USING_I2C1')orGetDepend('BSP_USING_I2C2')orGetDepend('BSP_USING_I2C3'):22src += ['drv_soft_i2c.c']2324# add spi drivers.25ifGetDepend('RT_USING_SPI'):26src += ['drv_spi.c']2728...
if GetDepend(['RT_USING_I2C']): src += ['GD32F10x_standard_peripheral/Source/gd32f10x_i2c.c'] if GetDepend(['RT_USING_SPI']): src += ['GD32F10x_standard_peripheral/Source/gd32f10x_spi.c'] if GetDepend(['RT_USING_CAN']): ...
config BSP_USING_COM3 bool "Enable COM3 (uart3 pin conflict with Ethernet)" select BSP_USING_UART3 default n config BSP_USING_SDRAM bool "Enable SDRAM" select BSP_USING_FMC default n config BSP_USING_SPI_FLASH bool "Enable SPI FLASH (W25Q256 spi5)" ...