feat[spi]: enable interrupt-safe operations using spinlocks

This commit is contained in:
wdfk-prog
2025-11-13 15:41:41 +08:00
committed by R b b666
parent ec27e09df8
commit ddfe2cd61c
5 changed files with 111 additions and 19 deletions
@@ -8,6 +8,7 @@
* 2012-11-23 Bernard Add extern "C"
* 2020-06-13 armink fix the 3 wires issue
* 2022-09-01 liYony fix api rt_spi_sendrecv16 about MSB and LSB bug
* 2025-10-30 wdfk-prog enable interrupt-safe operations using spinlocks
*/
#ifndef __DEV_SPI_H__
@@ -181,6 +182,10 @@ struct rt_spi_bus
#endif /* RT_USING_DM */
struct rt_mutex lock;
#ifdef RT_USING_SPI_ISR
rt_base_t _isr_lvl;
struct rt_spinlock _spinlock;
#endif /* RT_USING_SPI_ISR */
struct rt_spi_device *owner;
};