Lines Matching +full:spi +full:- +full:addr
6 * SPDX-License-Identifier: Apache-2.0
10 * @file Driver for MPC23Sxx SPI-based GPIO driver.
18 #include <zephyr/drivers/spi.h>
29 const struct mcp23xxx_config *config = dev->config; in mcp23sxx_read_port_regs()
33 uint8_t nread = (config->ngpios == 8) ? 1 : 2; in mcp23sxx_read_port_regs()
35 uint8_t addr = MCP23SXX_ADDR | MCP23SXX_READBIT; in mcp23sxx_read_port_regs() local
36 uint8_t buffer_tx[4] = { addr, reg, 0, 0 }; in mcp23sxx_read_port_regs()
56 ret = spi_transceive_dt(&config->bus.spi, &tx, &rx); in mcp23sxx_read_port_regs()
71 const struct mcp23xxx_config *config = dev->config; in mcp23sxx_write_port_regs()
74 uint8_t nwrite = (config->ngpios == 8) ? 1 : 2; in mcp23sxx_write_port_regs()
81 uint8_t addr = MCP23SXX_ADDR; in mcp23sxx_write_port_regs() local
82 uint8_t buffer_tx[4] = { addr, reg, port_a_data, port_b_data }; in mcp23sxx_write_port_regs()
95 ret = spi_write_dt(&config->bus.spi, &tx); in mcp23sxx_write_port_regs()
106 const struct mcp23xxx_config *config = dev->config; in mcp23sxx_bus_is_ready()
108 if (!spi_is_ready_dt(&config->bus.spi)) { in mcp23sxx_bus_is_ready()
109 LOG_ERR("SPI bus %s not ready", config->bus.spi.bus->name); in mcp23sxx_bus_is_ready()
110 return -ENODEV; in mcp23sxx_bus_is_ready()
129 .spi = SPI_DT_SPEC_INST_GET(inst, \