/Zephyr-latest/drivers/spi/ |
D | spi_pw.c | 3 * SPDX-License-Identifier: Apache-2.0 12 #include <zephyr/drivers/spi.h> 13 #include <zephyr/drivers/spi/rtio.h> 25 static uint32_t spi_pw_reg_read(const struct device *dev, uint32_t offset) in spi_pw_reg_read() argument 27 return sys_read32(DEVICE_MMIO_GET(dev) + offset); in spi_pw_reg_read() 30 static void spi_pw_reg_write(const struct device *dev, in spi_pw_reg_write() argument 34 sys_write32(val, DEVICE_MMIO_GET(dev) + offset); in spi_pw_reg_write() 37 static void spi_pw_ssp_reset(const struct device *dev) in spi_pw_ssp_reset() argument 40 spi_pw_reg_write(dev, PW_SPI_REG_RESETS, 0x00); in spi_pw_ssp_reset() 41 spi_pw_reg_write(dev, PW_SPI_REG_RESETS, PW_SPI_INST_RESET); in spi_pw_ssp_reset() [all …]
|
D | spi_dw.c | 6 * SPDX-License-Identifier: Apache-2.0 11 /* spi_dw.c - Designware SPI driver implementation */ 33 #include <zephyr/drivers/spi.h> 34 #include <zephyr/drivers/spi/rtio.h> 44 static inline bool spi_dw_is_slave(struct spi_dw_data *spi) in spi_dw_is_slave() argument 47 spi_context_is_slave(&spi->ctx)); in spi_dw_is_slave() 50 static void completed(const struct device *dev, int error) in completed() argument 52 struct spi_dw_data *spi = dev->data; in completed() local 53 struct spi_context *ctx = &spi->ctx; in completed() 59 if (spi_context_tx_on(&spi->ctx) || in completed() [all …]
|
D | spi_sedi.c | 4 * SPDX-License-Identifier: Apache-2.0 10 #include <zephyr/drivers/spi.h> 11 #include <zephyr/drivers/spi/rtio.h> 37 static int spi_sedi_configure(const struct device *dev, in spi_sedi_configure() argument 40 struct spi_sedi_data *data = dev->data; in spi_sedi_configure() 41 const struct spi_sedi_config *info = dev->config; in spi_sedi_configure() 44 if (spi_context_configured(&data->ctx, config) == true) { in spi_sedi_configure() 48 word_size = SPI_WORD_SIZE_GET(config->operation); in spi_sedi_configure() 49 sedi_spi_control(info->spi_device, SEDI_SPI_IOCTL_DATA_WIDTH, in spi_sedi_configure() 53 cpol = SPI_MODE_GET(config->operation) & SPI_MODE_CPOL; in spi_sedi_configure() [all …]
|
D | spi_nrfx_spi.c | 2 * Copyright (c) 2017 - 2018, Nordic Semiconductor ASA 4 * SPDX-License-Identifier: Apache-2.0 7 #include <zephyr/drivers/spi.h> 8 #include <zephyr/drivers/spi/rtio.h> 23 const struct device *dev; member 30 nrfx_spi_t spi; member 87 static int configure(const struct device *dev, in configure() argument 90 struct spi_nrfx_data *dev_data = dev->data; in configure() 91 const struct spi_nrfx_config *dev_config = dev->config; in configure() 92 struct spi_context *ctx = &dev_data->ctx; in configure() [all …]
|
D | spi_max32.c | 4 * SPDX-License-Identifier: Apache-2.0 15 #include <zephyr/drivers/spi.h> 16 #include <zephyr/drivers/spi/rtio.h> 23 #include <zephyr/drivers/spi/rtio.h> 32 const struct device *dev; member 44 void (*irq_config_func)(const struct device *dev); 55 const struct device *dev; member 83 static int spi_configure(const struct device *dev, const struct spi_config *config) in spi_configure() argument 86 const struct max32_spi_config *cfg = dev->config; in spi_configure() 87 mxc_spi_regs_t *regs = cfg->regs; in spi_configure() [all …]
|
D | spi_ll_stm32.c | 4 * SPDX-License-Identifier: Apache-2.0 18 #include <zephyr/drivers/spi.h> 19 #include <zephyr/drivers/spi/rtio.h> 35 #include <zephyr/dt-bindings/memory-attr/memory-attr-arm.h> 39 #include <zephyr/linker/linker-defs.h> 76 static void spi_stm32_pm_policy_state_lock_get(const struct device *dev) in spi_stm32_pm_policy_state_lock_get() argument 79 struct spi_stm32_data *data = dev->data; in spi_stm32_pm_policy_state_lock_get() 81 if (!data->pm_policy_state_on) { in spi_stm32_pm_policy_state_lock_get() 82 data->pm_policy_state_on = true; in spi_stm32_pm_policy_state_lock_get() 87 pm_device_runtime_get(dev); in spi_stm32_pm_policy_state_lock_get() [all …]
|
D | spi_xmc4xxx.c | 4 * SPDX-License-Identifier: Apache-2.0 17 #include <zephyr/drivers/spi.h> 18 #include <zephyr/drivers/spi/rtio.h> 37 XMC_USIC_CH_t *spi; member 41 void (*irq_config_func)(const struct device *dev); 79 data->dma_status_flags |= SPI_XMC4XXX_DMA_ERROR_FLAG; in spi_xmc4xxx_dma_callback() 81 if (dev_dma == data->dma_tx.dev_dma && dma_channel == data->dma_tx.dma_channel) { in spi_xmc4xxx_dma_callback() 82 data->dma_status_flags |= SPI_XMC4XXX_DMA_TX_DONE_FLAG; in spi_xmc4xxx_dma_callback() 83 } else if (dev_dma == data->dma_rx.dev_dma && in spi_xmc4xxx_dma_callback() 84 dma_channel == data->dma_rx.dma_channel) { in spi_xmc4xxx_dma_callback() [all …]
|
D | spi_emul.c | 4 * SPDX-License-Identifier: Apache-2.0 6 * This driver creates fake SPI buses which can contain emulated devices, 19 #include <zephyr/drivers/spi.h> 20 #include <zephyr/drivers/spi/rtio.h> 27 /* SPI host configuration */ 31 uint32_t spi_emul_get_config(const struct device *dev) in spi_emul_get_config() argument 33 struct spi_emul_data *data = dev->data; in spi_emul_get_config() 35 return data->config; in spi_emul_get_config() 39 * Find an emulator for a SPI bus 45 * @param dev SPI emulation controller device [all …]
|
D | spi_numaker.c | 2 * SPDX-License-Identifier: Apache-2.0 15 #include <zephyr/drivers/spi/rtio.h> 26 SPI_T *spi; member 42 * CPOL/CPHA = 0/0 --> SPI_MODE_0 43 * CPOL/CPHA = 0/1 --> SPI_MODE_1 44 * CPOL/CPHA = 1/0 --> SPI_MODE_2 45 * CPOL/CPHA = 1/1 --> SPI_MODE_3 55 static int spi_numaker_configure(const struct device *dev, const struct spi_config *config) in spi_numaker_configure() argument 58 struct spi_numaker_data *data = dev->data; in spi_numaker_configure() 59 const struct spi_numaker_config *dev_cfg = dev->config; in spi_numaker_configure() [all …]
|
/Zephyr-latest/drivers/sensor/tdk/icm42605/ |
D | icm42605_setup.c | 4 * SPDX-License-Identifier: Apache-2.0 17 int icm42605_set_fs(const struct device *dev, uint16_t a_sf, uint16_t g_sf) in icm42605_set_fs() argument 19 const struct icm42605_config *cfg = dev->config; in icm42605_set_fs() 23 result = inv_spi_read(&cfg->spi, REG_ACCEL_CONFIG0, &databuf, 1); in icm42605_set_fs() 31 result = inv_spi_single_write(&cfg->spi, REG_ACCEL_CONFIG0, &databuf); in icm42605_set_fs() 33 result = inv_spi_read(&cfg->spi, REG_GYRO_CONFIG0, &databuf, 1); in icm42605_set_fs() 42 result = inv_spi_single_write(&cfg->spi, REG_GYRO_CONFIG0, &databuf); in icm42605_set_fs() 51 int icm42605_set_odr(const struct device *dev, uint16_t a_rate, uint16_t g_rate) in icm42605_set_odr() argument 53 const struct icm42605_config *cfg = dev->config; in icm42605_set_odr() 60 return -ENOTSUP; in icm42605_set_odr() [all …]
|
/Zephyr-latest/samples/boards/ti/cc13x2_cc26x2/system_off/src/ |
D | ext_flash.c | 5 * SPDX-License-Identifier: Apache-2.0 24 void CC1352R1_LAUNCHXL_sendExtFlashByte(const struct device *dev, in CC1352R1_LAUNCHXL_sendExtFlashByte() argument 29 /* SPI Flash CS */ in CC1352R1_LAUNCHXL_sendExtFlashByte() 30 gpio_pin_set(dev, DIO20_PIN, 0); in CC1352R1_LAUNCHXL_sendExtFlashByte() 33 gpio_pin_set(dev, DIO10_PIN, 0); /* SPI Flash CLK */ in CC1352R1_LAUNCHXL_sendExtFlashByte() 35 /* SPI Flash MOSI */ in CC1352R1_LAUNCHXL_sendExtFlashByte() 36 gpio_pin_set(dev, DIO9_PIN, (byte >> (7 - i)) & 0x01); in CC1352R1_LAUNCHXL_sendExtFlashByte() 37 gpio_pin_set(dev, DIO10_PIN, 1); /* SPI Flash CLK */ in CC1352R1_LAUNCHXL_sendExtFlashByte() 47 gpio_pin_set(dev, DIO10_PIN, 0); /* CLK */ in CC1352R1_LAUNCHXL_sendExtFlashByte() 48 gpio_pin_set(dev, DIO20_PIN, 1); /* CS */ in CC1352R1_LAUNCHXL_sendExtFlashByte() [all …]
|
/Zephyr-latest/drivers/sensor/adi/adxl372/ |
D | adxl372_spi.c | 1 /* adxl372_spi.c - SPI routines for ADXL372 driver 7 * SPDX-License-Identifier: Apache-2.0 17 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 21 static int adxl372_bus_access(const struct device *dev, uint8_t reg, in adxl372_bus_access() argument 24 const struct adxl372_dev_config *config = dev->config; in adxl372_bus_access() 48 return spi_transceive_dt(&config->spi, &tx, &rx); in adxl372_bus_access() 53 return spi_write_dt(&config->spi, &tx); in adxl372_bus_access() 56 static int adxl372_spi_reg_read(const struct device *dev, uint8_t reg_addr, in adxl372_spi_reg_read() argument 59 return adxl372_bus_access(dev, ADXL372_REG_READ(reg_addr), reg_data, 1); in adxl372_spi_reg_read() 62 static int adxl372_spi_reg_read_multiple(const struct device *dev, in adxl372_spi_reg_read_multiple() argument [all …]
|
/Zephyr-latest/drivers/sensor/ens160/ |
D | ens160_spi.c | 4 * SPDX-License-Identifier: Apache-2.0 9 #include <zephyr/drivers/spi.h> 15 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 19 static int ens160_read_reg_spi(const struct device *dev, uint8_t reg, uint8_t *val) in ens160_read_reg_spi() argument 21 const struct ens160_config *config = dev->config; in ens160_read_reg_spi() 51 return spi_transceive_dt(&config->spi, &tx, &rx); in ens160_read_reg_spi() 54 static int ens160_read_data_spi(const struct device *dev, uint8_t start, uint8_t *data, size_t len) in ens160_read_data_spi() argument 56 const struct ens160_config *config = dev->config; in ens160_read_data_spi() 86 return spi_transceive_dt(&config->spi, &tx, &rx); in ens160_read_data_spi() 89 static int ens160_write_reg_spi(const struct device *dev, uint8_t reg, uint8_t val) in ens160_write_reg_spi() argument [all …]
|
/Zephyr-latest/drivers/sensor/bosch/bma4xx/ |
D | bma4xx_spi.c | 1 /* Bosch BMA4xx 3-axis accelerometer driver 5 * SPDX-License-Identifier: Apache-2.0 10 #include <zephyr/drivers/spi.h> 15 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 19 static int bma4xx_spi_read_data(const struct device *dev, uint8_t reg_addr, in bma4xx_spi_read_data() argument 22 return -ENOTSUP; in bma4xx_spi_read_data() 25 static int bma4xx_spi_write_data(const struct device *dev, uint8_t reg_addr, in bma4xx_spi_write_data() argument 28 return -ENOTSUP; in bma4xx_spi_write_data() 31 static int bma4xx_spi_read_reg(const struct device *dev, uint8_t reg_addr, in bma4xx_spi_read_reg() argument 34 return -ENOTSUP; in bma4xx_spi_read_reg() [all …]
|
/Zephyr-latest/drivers/mfd/ |
D | mfd_ad559x.h | 3 * SPDX-License-Identifier: Apache-2.0 22 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 23 #include <zephyr/drivers/spi.h> 24 #endif /* DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) */ 36 int (*read_raw)(const struct device *dev, uint8_t *val, size_t len); 37 int (*write_raw)(const struct device *dev, uint8_t *val, size_t len); 38 int (*read_reg)(const struct device *dev, uint8_t reg, uint8_t reg_data, uint16_t *val); 39 int (*write_reg)(const struct device *dev, uint8_t reg, uint16_t val); 47 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 48 struct spi_dt_spec spi; member [all …]
|
/Zephyr-latest/drivers/sensor/st/lsm6dsl/ |
D | lsm6dsl_spi.c | 1 /* lsm6dsl_spi.c - SPI routines for LSM6DSL driver 7 * SPDX-License-Identifier: Apache-2.0 17 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 23 static int lsm6dsl_raw_read(const struct device *dev, uint8_t reg_addr, in lsm6dsl_raw_read() argument 26 const struct lsm6dsl_config *cfg = dev->config; in lsm6dsl_raw_read() 53 return -EIO; in lsm6dsl_raw_read() 56 if (spi_transceive_dt(&cfg->bus_cfg.spi, &tx, &rx)) { in lsm6dsl_raw_read() 57 return -EIO; in lsm6dsl_raw_read() 63 static int lsm6dsl_raw_write(const struct device *dev, uint8_t reg_addr, in lsm6dsl_raw_write() argument 66 const struct lsm6dsl_config *cfg = dev->config; in lsm6dsl_raw_write() [all …]
|
/Zephyr-latest/boards/renesas/da1469x_dk_pro/dts/ |
D | da1469x_dk_pro_psram.overlay | 4 * SPDX-License-Identifier: Apache-2.0 9 sram-ext = &memc; 17 /* QSPIC settings for the APS6404L-3SQR QSPI PSRAM memory in QPI mode. */ 20 is-ram; 21 dev-size = <DT_SIZE_M(64)>; 22 dev-type = <0x5D>; 23 dev-id = <0x0D>; 24 dev-density = <0xE040>; 25 reset-delay-us = <50>; 26 read-cs-idle-min-ns = <18>; [all …]
|
/Zephyr-latest/drivers/sensor/st/iis2mdc/ |
D | iis2mdc.h | 1 /* ST Microelectronics IIS2MDC 3-axis magnetometer sensor 5 * SPDX-License-Identifier: Apache-2.0 21 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 22 #include <zephyr/drivers/spi.h> 23 #endif /* DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) */ 34 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 35 struct spi_dt_spec spi; member 36 #endif /* DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) */ 38 int (*bus_init)(const struct device *dev); 46 const struct device *dev; member [all …]
|
D | iis2mdc_spi.c | 1 /* ST Microelectronics IIS2MDC 3-axis magnetometer sensor 5 * SPDX-License-Identifier: Apache-2.0 17 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 23 static int iis2mdc_spi_read(const struct device *dev, uint8_t reg, in iis2mdc_spi_read() argument 26 const struct iis2mdc_dev_config *cfg = dev->config; in iis2mdc_spi_read() 52 return -EIO; in iis2mdc_spi_read() 55 if (spi_transceive_dt(&cfg->spi, &tx, &rx)) { in iis2mdc_spi_read() 56 return -EIO; in iis2mdc_spi_read() 62 static int iis2mdc_spi_write(const struct device *dev, uint8_t reg, in iis2mdc_spi_write() argument 65 const struct iis2mdc_dev_config *cfg = dev->config; in iis2mdc_spi_write() [all …]
|
/Zephyr-latest/drivers/sensor/st/lis2dh/ |
D | lis2dh_spi.c | 1 /* ST Microelectronics LIS2DH 3-axis accelerometer driver 5 * SPDX-License-Identifier: Apache-2.0 17 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 26 static int lis2dh_raw_read(const struct device *dev, uint8_t reg_addr, in lis2dh_raw_read() argument 29 const struct lis2dh_config *cfg = dev->config; in lis2dh_raw_read() 56 return -EIO; in lis2dh_raw_read() 63 if (spi_transceive_dt(&cfg->bus_cfg.spi, &tx, &rx)) { in lis2dh_raw_read() 64 return -EIO; in lis2dh_raw_read() 70 static int lis2dh_raw_write(const struct device *dev, uint8_t reg_addr, in lis2dh_raw_write() argument 73 const struct lis2dh_config *cfg = dev->config; in lis2dh_raw_write() [all …]
|
/Zephyr-latest/include/zephyr/devicetree/ |
D | spi.h | 3 * @brief SPI Devicetree macro public API header file. 9 * SPDX-License-Identifier: Apache-2.0 20 * @defgroup devicetree-spi Devicetree SPI API 26 * @brief Does a SPI controller node have chip select GPIOs configured? 28 * SPI bus controllers use the "cs-gpios" property for configuring 29 * chip select GPIOs. Its value is a phandle-array which specifies the 34 * spi1: spi@... { 35 * compatible = "vnd,spi"; 36 * cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>, 40 * spi2: spi@... { [all …]
|
/Zephyr-latest/drivers/sensor/st/iis3dhhc/ |
D | iis3dhhc_spi.c | 5 * SPDX-License-Identifier: Apache-2.0 17 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 23 static int iis3dhhc_spi_read(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t len) in iis3dhhc_spi_read() argument 25 const struct iis3dhhc_config *config = dev->config; in iis3dhhc_spi_read() 50 if (spi_transceive_dt(&config->spi, &tx, &rx)) { in iis3dhhc_spi_read() 51 return -EIO; in iis3dhhc_spi_read() 57 static int iis3dhhc_spi_write(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t len) in iis3dhhc_spi_write() argument 59 const struct iis3dhhc_config *config = dev->config; in iis3dhhc_spi_write() 77 if (spi_write_dt(&config->spi, &tx)) { in iis3dhhc_spi_write() 78 return -EIO; in iis3dhhc_spi_write() [all …]
|
/Zephyr-latest/drivers/sensor/st/i3g4250d/ |
D | i3g4250d_spi.c | 4 * SPDX-License-Identifier: Apache-2.0 12 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) 19 static int i3g4250d_spi_read(const struct device *dev, uint8_t reg, in i3g4250d_spi_read() argument 23 const struct i3g4250d_device_config *config = dev->config; in i3g4250d_spi_read() 48 ret = spi_transceive_dt(&config->spi, &tx, &rx); in i3g4250d_spi_read() 56 static int i3g4250d_spi_write(const struct device *dev, uint8_t reg, in i3g4250d_spi_write() argument 60 const struct i3g4250d_device_config *config = dev->config; in i3g4250d_spi_write() 77 ret = spi_write_dt(&config->spi, &tx); in i3g4250d_spi_write() 91 int i3g4250d_spi_init(const struct device *dev) in i3g4250d_spi_init() argument 93 struct i3g4250d_data *i3g4250d = dev->data; in i3g4250d_spi_init() [all …]
|
/Zephyr-latest/drivers/sensor/st/lis2dux12/ |
D | lis2dux12.h | 1 /* ST Microelectronics LIS2DUX12 3-axis accelerometer driver 5 * SPDX-License-Identifier: Apache-2.0 27 #if DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(st_lis2dux12, spi) || \ 28 DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(st_lis2duxs12, spi) 29 #include <zephyr/drivers/spi.h> 37 typedef int32_t (*api_lis2dux12_set_odr_raw)(const struct device *dev, uint8_t odr); 38 typedef int32_t (*api_lis2dux12_set_range)(const struct device *dev, uint8_t range); 39 typedef int32_t (*api_lis2dux12_sample_fetch_accel)(const struct device *dev); 41 typedef int32_t (*api_lis2dux12_sample_fetch_temp)(const struct device *dev); 44 typedef void (*api_lis2dux12_handle_interrupt)(const struct device *dev); [all …]
|
/Zephyr-latest/include/zephyr/drivers/ |
D | spi.h | 4 * SPDX-License-Identifier: Apache-2.0 9 * @brief Public API for SPI drivers and applications 16 * @brief SPI Interface 17 * @defgroup spi_interface SPI Interface 27 #include <zephyr/dt-bindings/spi/spi.h> 39 * @name SPI operational mode 47 /** Get SPI operational mode. */ 52 * @name SPI Polarity & Phase Modes 73 * Whatever data is transmitted is looped-back to the receiving buffer of 81 /** Get SPI polarity and phase mode bits. */ [all …]
|