diff options
| author | liYangYang <[email protected]> | 2023-02-12 11:14:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-11 22:14:54 -0500 |
| commit | 1eec660b125f21ca59b251a76b193a5a1ddf78bf (patch) | |
| tree | 00a6cd1a86acbd5921b4379e7fe2ab5c2451e256 /components/drivers/include | |
| parent | e4edf7e1824b45199cbca95303fc262d207dc8f6 (diff) | |
[spi]添加rt_spi_bus_attach_device_cspin 函数 (#6916)
这个函数实现了原先的挂载功能,并且调用pin框架,初始化cs引脚,是一个功能相对完善的挂载函数。用户也能更简单的使用。
该函数取代rt_spi_bus_attach_device,后续rt_spi_bus_attach_device会被逐渐淘汰掉。新的BSP以及软件包应当使用rt_spi_bus_attach_device_cspin新函数。
STM32L475潘多拉测试通过。
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/spi.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/drivers/include/drivers/spi.h b/components/drivers/include/drivers/spi.h index cd5ebe2db6..7e3842d76e 100644 --- a/components/drivers/include/drivers/spi.h +++ b/components/drivers/include/drivers/spi.h @@ -177,6 +177,13 @@ rt_err_t rt_spi_bus_attach_device(struct rt_spi_device *device, const char *bus_name, void *user_data); +/* attach a device on SPI bus with CS pin */ +rt_err_t rt_spi_bus_attach_device_cspin(struct rt_spi_device *device, + const char *name, + const char *bus_name, + rt_base_t cs_pin, + void *user_data); + /** * This function takes SPI bus. * |
