mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 10:36:04 +08:00
[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潘多拉测试通过。
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user