Lines Matching +full:host +full:- +full:io
4 * SPDX-License-Identifier: Apache-2.0
27 /* SPI host configuration */
33 struct spi_emul_data *data = dev->data; in spi_emul_get_config()
35 return data->config; in spi_emul_get_config()
46 * @param chipsel Chip-select value
52 struct spi_emul_data *data = dev->data; in spi_emul_find()
55 SYS_SLIST_FOR_EACH_NODE(&data->emuls, node) { in spi_emul_find()
59 if (emul->chipsel == chipsel) { in spi_emul_find()
74 emul = spi_emul_find(dev, config->slave); in spi_emul_io()
76 return -EIO; in spi_emul_io()
79 api = emul->api; in spi_emul_io()
80 __ASSERT_NO_MSG(emul->api); in spi_emul_io()
81 __ASSERT_NO_MSG(emul->api->io); in spi_emul_io()
83 if (emul->mock_api != NULL && emul->mock_api->io != NULL) { in spi_emul_io()
84 ret = emul->mock_api->io(emul->target, config, tx_bufs, rx_bufs); in spi_emul_io()
85 if (ret != -ENOSYS) { in spi_emul_io()
90 return api->io(emul->target, config, tx_bufs, rx_bufs); in spi_emul_io()
94 * @brief This is a no-op stub of the SPI API's `release` method to protect drivers under test
112 struct spi_emul_data *data = dev->data; in spi_emul_init()
114 sys_slist_init(&data->emuls); in spi_emul_init()
121 struct spi_emul_data *data = dev->data; in spi_emul_register()
122 const char *name = emul->target->dev->name; in spi_emul_register()
124 sys_slist_append(&data->emuls, &emul->node); in spi_emul_register()
126 LOG_INF("Register emulator '%s' at cs %u\n", name, emul->chipsel); in spi_emul_register()