Lines Matching +full:spi +full:- +full:addr

1 /* ieee802154_rf2xx_iface.c - ATMEL RF2XX IEEE 802.15.4 Interface */
4 * Copyright (c) 2019-2020 Gerson Fernando Budke
6 * SPDX-License-Identifier: Apache-2.0
18 #include <zephyr/drivers/spi.h>
29 const struct rf2xx_config *conf = dev->config; in rf2xx_iface_phy_rst()
32 gpio_pin_set_dt(&conf->reset_gpio, 0); in rf2xx_iface_phy_rst()
33 gpio_pin_set_dt(&conf->slptr_gpio, 0); in rf2xx_iface_phy_rst()
38 gpio_pin_set_dt(&conf->reset_gpio, 1); in rf2xx_iface_phy_rst()
40 gpio_pin_set_dt(&conf->reset_gpio, 0); in rf2xx_iface_phy_rst()
44 const struct rf2xx_config *conf = dev->config; in rf2xx_iface_phy_tx_start()
47 gpio_pin_set_dt(&conf->slptr_gpio, 1); in rf2xx_iface_phy_tx_start()
51 gpio_pin_set_dt(&conf->slptr_gpio, 0); in rf2xx_iface_phy_tx_start()
55 uint8_t addr) in rf2xx_iface_reg_read() argument
57 const struct rf2xx_config *conf = dev->config; in rf2xx_iface_reg_read()
61 addr |= RF2XX_RF_CMD_REG_R; in rf2xx_iface_reg_read()
64 .buf = &addr, in rf2xx_iface_reg_read()
86 if (spi_transceive_dt(&conf->spi, &tx, &rx) != 0) { in rf2xx_iface_reg_read()
88 addr); in rf2xx_iface_reg_read()
92 (addr & ~(RF2XX_RF_CMD_REG_R)), status, regval); in rf2xx_iface_reg_read()
98 uint8_t addr, in rf2xx_iface_reg_write() argument
101 const struct rf2xx_config *conf = dev->config; in rf2xx_iface_reg_write()
104 addr |= RF2XX_RF_CMD_REG_W; in rf2xx_iface_reg_write()
108 .buf = &addr, in rf2xx_iface_reg_write()
129 if (spi_transceive_dt(&conf->spi, &tx, &rx) != 0) { in rf2xx_iface_reg_write()
131 addr); in rf2xx_iface_reg_write()
135 (addr & ~(RF2XX_RF_CMD_REG_W)), status, data); in rf2xx_iface_reg_write()
139 uint8_t addr, in rf2xx_iface_bit_read() argument
145 ret = rf2xx_iface_reg_read(dev, addr); in rf2xx_iface_bit_read()
172 const struct rf2xx_config *conf = dev->config; in rf2xx_iface_frame_read()
192 if (spi_transceive_dt(&conf->spi, &tx, &rx) != 0) { in rf2xx_iface_frame_read()
204 const struct rf2xx_config *conf = dev->config; in rf2xx_iface_frame_write()
243 if (spi_transceive_dt(&conf->spi, &tx, &rx) != 0) { in rf2xx_iface_frame_write()
256 const struct rf2xx_config *conf = dev->config; in rf2xx_iface_sram_read()
289 if (spi_transceive_dt(&conf->spi, &tx, &rx) != 0) { in rf2xx_iface_sram_read()