diff options
| author | liYangYang <[email protected]> | 2023-01-18 13:27:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-18 00:27:08 -0500 |
| commit | 7ff64c1cfd2c3392f388ed91cd4955a064265c7f (patch) | |
| tree | 87f1c548d63072a0a86abdcd23499107668bc030 /components/drivers/include | |
| parent | 65f18040058c8f3aff638bdd407e5e9f34ccab3f (diff) | |
[stm32][spi] spi attach函数问题解决方案 (#6864)
attach #6819
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/pin.h | 4 | ||||
| -rw-r--r-- | components/drivers/include/drivers/spi.h | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/components/drivers/include/drivers/pin.h b/components/drivers/include/drivers/pin.h index 38e5abea2a..4390c9bb41 100644 --- a/components/drivers/include/drivers/pin.h +++ b/components/drivers/include/drivers/pin.h @@ -25,6 +25,8 @@ struct rt_device_pin const struct rt_pin_ops *ops; }; +#define PIN_NONE (-1) + #define PIN_LOW 0x00 #define PIN_HIGH 0x01 @@ -43,7 +45,7 @@ struct rt_device_pin #define PIN_IRQ_DISABLE 0x00 #define PIN_IRQ_ENABLE 0x01 -#define PIN_IRQ_PIN_NONE -1 +#define PIN_IRQ_PIN_NONE PIN_NONE struct rt_device_pin_mode { diff --git a/components/drivers/include/drivers/spi.h b/components/drivers/include/drivers/spi.h index 2cce830cd6..cd5ebe2db6 100644 --- a/components/drivers/include/drivers/spi.h +++ b/components/drivers/include/drivers/spi.h @@ -15,7 +15,7 @@ #include <stdlib.h> #include <rtthread.h> -#include <rtdevice.h> +#include <drivers/pin.h> #ifdef __cplusplus extern "C"{ @@ -79,7 +79,6 @@ struct rt_spi_configuration rt_uint8_t mode; rt_uint8_t data_width; rt_uint16_t reserved; - rt_base_t cs_pin; rt_uint32_t max_hz; }; @@ -113,6 +112,7 @@ struct rt_spi_device struct rt_spi_bus *bus; struct rt_spi_configuration config; + rt_base_t cs_pin; void *user_data; }; |
