mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-06 00:45:22 +08:00
[fix] drivers: spi: refactor SPI bit operations into independent configuration
Some checks failed
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
Weekly CI Scheduler / Trigger and Monitor CIs (push) Has been cancelled
Weekly CI Scheduler / Create Discussion Report (push) Has been cancelled
Some checks failed
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
Weekly CI Scheduler / Trigger and Monitor CIs (push) Has been cancelled
Weekly CI Scheduler / Create Discussion Report (push) Has been cancelled
- Add RT_USING_SPI_BITOPS as a separate configurable option - Make RT_USING_SOFT_SPI depend on RT_USING_SPI_BITOPS - Adjust build order in SConscript for proper com Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
This commit is contained in:
@@ -7,11 +7,16 @@ menuconfig RT_USING_SPI
|
||||
menuconfig RT_USING_SPI_ISR
|
||||
bool "Enable interrupt-safe SPI operations (using spinlocks in ISR context)"
|
||||
default y
|
||||
|
||||
config RT_USING_SPI_BITOPS
|
||||
bool "Enable SPI bit-bang operation functions"
|
||||
default n
|
||||
|
||||
menuconfig RT_USING_SOFT_SPI
|
||||
bool "Use GPIO to simulate SPI"
|
||||
default n
|
||||
select RT_USING_PIN
|
||||
select RT_USING_SPI_BITOPS
|
||||
if RT_USING_SOFT_SPI
|
||||
menuconfig RT_USING_SOFT_SPI0
|
||||
bool "Enable SPI0 Bus (software simulation)"
|
||||
|
||||
@@ -7,8 +7,10 @@ src = ['dev_spi_core.c', 'dev_spi.c']
|
||||
CPPPATH = [cwd, cwd + '/../include']
|
||||
LOCAL_CFLAGS = ''
|
||||
|
||||
if GetDepend('RT_USING_SOFT_SPI'):
|
||||
if GetDepend('RT_USING_SPI_BITOPS'):
|
||||
src += ['dev_spi_bit_ops.c']
|
||||
|
||||
if GetDepend('RT_USING_SOFT_SPI'):
|
||||
src += ['dev_soft_spi.c']
|
||||
|
||||
if GetDepend('RT_USING_QSPI'):
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#error "Please define at least one RT_USING_SOFT_SPIx"
|
||||
/*
|
||||
This driver can be disabled at:
|
||||
menuconfig -> RT-Thread Components -> Device Drivers -> Using I2C device drivers
|
||||
menuconfig -> RT-Thread Components -> Device Drivers -> Using SPI Bus/Device device drivers -> Use GPIO to simulate SPI
|
||||
*/
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user