Lines Matching refs:spi
25 static int mb85rs64v_access(const struct device *spi, in mb85rs64v_access() argument
58 return spi_transceive(spi, spi_cfg, &tx, &rx); in mb85rs64v_access()
64 return spi_write(spi, spi_cfg, &tx); in mb85rs64v_access()
68 static int mb85rs64v_read_id(const struct device *spi, in mb85rs64v_read_id() argument
74 err = mb85rs64v_access(spi, spi_cfg, in mb85rs64v_read_id()
100 static int write_bytes(const struct device *spi, struct spi_config *spi_cfg, in write_bytes() argument
106 err = mb85rs64v_access(spi, spi_cfg, in write_bytes()
114 err = mb85rs64v_access(spi, spi_cfg, in write_bytes()
124 static int read_bytes(const struct device *spi, struct spi_config *spi_cfg, in read_bytes() argument
130 err = mb85rs64v_access(spi, spi_cfg, in read_bytes()
142 const struct device *spi; in main() local
148 spi = DEVICE_DT_GET(DT_ALIAS(spi_1)); in main()
149 if (!device_is_ready(spi)) { in main()
150 printk("SPI device %s is not ready\n", spi->name); in main()
158 err = mb85rs64v_read_id(spi, &spi_cfg); in main()
166 err = write_bytes(spi, &spi_cfg, 0x00, data, 1); in main()
175 err = write_bytes(spi, &spi_cfg, 0x01, data, 1); in main()
184 err = read_bytes(spi, &spi_cfg, 0x00, data, 1); in main()
193 err = read_bytes(spi, &spi_cfg, 0x01, data, 1); in main()
209 err = write_bytes(spi, &spi_cfg, 0x00, cmp_data, sizeof(cmp_data)); in main()
218 err = read_bytes(spi, &spi_cfg, 0x00, data, sizeof(data)); in main()