Lines Matching +full:reset +full:- +full:delay +full:- +full:us

1 /* spi.c - SPI based Bluetooth driver */
8 * SPDX-License-Identifier: Apache-2.0
54 #define SPI_MAX_MSG_LEN 255 /* As defined by X-NUCLEO-IDB04A1 BSP */
62 #define MAX_MTU (SPI_MAX_MSG_LEN - H4_HDR_SIZE - BT_L2CAP_HDR_SIZE - BT_HCI_ACL_HDR_SIZE)
156 return -EINVAL; in bt_spi_get_header()
244 struct bt_spi_data *hci = dev->data; in bt_spi_rx_thread()
265 /* Delay here is rounded up to next tick */ in bt_spi_rx_thread()
273 /* Consider increasing controller-data-delay-us in bt_spi_rx_thread()
297 hci->recv(dev, buf); in bt_spi_rx_thread()
313 if (buf->len >= SPI_MAX_MSG_LEN) { in bt_spi_send()
314 LOG_ERR("Message too long (%d)", buf->len); in bt_spi_send()
315 return -EINVAL; in bt_spi_send()
331 return -EINVAL; in bt_spi_send()
335 size = MIN(buf->len, size); in bt_spi_send()
337 if (size < buf->len) { in bt_spi_send()
340 ret = -ECANCELED; in bt_spi_send()
344 /* Delay here is rounded up to next tick */ in bt_spi_send()
348 ret = bt_spi_transceive(buf->data, size, in bt_spi_send()
353 /* Consider increasing controller-data-delay-us in bt_spi_send()
367 LOG_HEXDUMP_DBG(buf->data, buf->len, "SPI TX"); in bt_spi_send()
377 struct bt_spi_data *hci = dev->data; in bt_spi_open()
380 /* Configure RST pin and hold BLE in Reset */ in bt_spi_open()
386 /* Configure IRQ pin and the IRQ call-back/handler */ in bt_spi_open()
404 hci->recv = recv; in bt_spi_open()
406 /* Take BLE out of reset */ in bt_spi_open()
418 /* Device will let us know when it's ready */ in bt_spi_open()
435 return -ENODEV; in bt_spi_init()
440 return -ENODEV; in bt_spi_init()
444 LOG_ERR("Reset GPIO device not ready"); in bt_spi_init()
445 return -ENODEV; in bt_spi_init()