提交 b3b8c236 编写于 作者: L liYony 提交者: mysterywolf

[spi] rt_spi_configure 增加对cs_pin处理

上级 1533b883
......@@ -95,6 +95,14 @@ rt_err_t rt_spi_configure(struct rt_spi_device *device,
device->config.mode = cfg->mode & RT_SPI_MODE_MASK ;
device->config.max_hz = cfg->max_hz ;
if (device->cs_pin != PIN_NONE)
{
if (device->config.mode & RT_SPI_CS_HIGH)
rt_pin_write(device->cs_pin, PIN_LOW);
else
rt_pin_write(device->cs_pin, PIN_HIGH);
}
if (device->bus != RT_NULL)
{
result = rt_mutex_take(&(device->bus->lock), RT_WAITING_FOREVER);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册