/Zephyr-latest/drivers/ethernet/phy/ |
D | phy_adin2111.c | 5 * SPDX-License-Identifier: Apache-2.0 23 /* PHYs out of reset check retry delay */ 26 * Number of retries for PHYs out of reset check, 27 * rmii variants as ADIN11XX need 70ms maximum after hw reset to be up, 28 * so the increasing the count for that, as default 25ms (sw reset) + 45. 37 /* Software reset, CLK_25 disabled time*/ 56 * - RM mask 0x6FFF 57 * - ADI driver example mask 0x2BFF 73 /* Software Power-down Control Register */ 77 /* Software Power-down Status */ [all …]
|
D | phy_dm8806.c | 2 * DM8806 Stand-alone Ethernet PHY with RMII 6 * SPDX-License-Identifier: Apache-2.0 50 const struct phy_dm8806_config *cfg = drv_data->dev->config; in phy_dm8806_gpio_callback() 52 gpio_pin_interrupt_configure_dt(&cfg->gpio_int, GPIO_INT_DISABLE); in phy_dm8806_gpio_callback() 53 k_sem_give(&drv_data->gpio_sem); in phy_dm8806_gpio_callback() 60 struct phy_dm8806_data *drv_data = dev->data; in phy_dm8806_thread_cb() 61 const struct phy_dm8806_config *cfg = dev->config; in phy_dm8806_thread_cb() 63 if (drv_data->link_speed_chenge_cb != NULL) { in phy_dm8806_thread_cb() 64 drv_data->link_speed_chenge_cb(dev, state, cb_data); in phy_dm8806_thread_cb() 69 mdio_read(cfg->mdio, INT_STAT_PHY_ADDR, INT_STAT_REG_ADDR, &data); in phy_dm8806_thread_cb() [all …]
|
/Zephyr-latest/drivers/ethernet/ |
D | eth_lan865x.c | 4 * SPDX-License-Identifier: Apache-2.0 26 struct lan865x_data *ctx = dev->data; in lan865x_mac_rxtx_control() 33 return oa_tc6_reg_write(ctx->tc6, LAN865x_MAC_NCR, ctl); in lan865x_mac_rxtx_control() 39 struct lan865x_data *ctx = dev->data; in lan865x_iface_init() 41 net_if_set_link_addr(iface, ctx->mac_address, sizeof(ctx->mac_address), in lan865x_iface_init() 44 if (ctx->iface == NULL) { in lan865x_iface_init() 45 ctx->iface = iface; in lan865x_iface_init() 51 ctx->iface_initialized = true; in lan865x_iface_init() 65 const struct lan865x_config *cfg = dev->config; in lan865x_set_config() 66 struct lan865x_data *ctx = dev->data; in lan865x_set_config() [all …]
|
D | phy_gecko.c | 5 * SPDX-License-Identifier: Apache-2.0 18 /* Maximum time to establish a link through auto-negotiation for 19 * 10BASE-T, 100BASE-TX is 3.7s, to add an extra margin the timeout 27 eth->NETWORKCTRL |= ETH_NETWORKCTRL_MANPORTEN; in mdio_bus_enable() 33 eth->NETWORKCTRL &= ~ETH_NETWORKCTRL_MANPORTEN; in mdio_bus_disable() 41 while (!(eth->NETWORKSTATUS & ETH_NETWORKSTATUS_MANDONE)) { in mdio_bus_wait() 42 if (retries-- == 0U) { in mdio_bus_wait() 44 return -ETIMEDOUT; in mdio_bus_wait() 60 eth->PHYMNGMNT = ETH_PHYMNGMNT_WRITE0_DEFAULT in mdio_bus_send() 83 ETH_TypeDef *const eth = phy->regs; in phy_read() [all …]
|
D | eth_adin2111.c | 4 * SPDX-License-Identifier: Apache-2.0 62 uint32_t val; in eth_adin2111_mac_reset() local 81 ret = eth_adin2111_reg_read(dev, ADIN1110_MAC_RST_STATUS_REG, &val); in eth_adin2111_mac_reset() 85 if (val == 0) { in eth_adin2111_mac_reset() 86 return -EBUSY; in eth_adin2111_mac_reset() 95 uint32_t val; in eth_adin2111_reg_update() local 98 ret = eth_adin2111_reg_read(dev, reg, &val); in eth_adin2111_reg_update() 103 val &= ~mask; in eth_adin2111_reg_update() 104 val |= mask & data; in eth_adin2111_reg_update() 106 return eth_adin2111_reg_write(dev, reg, val); in eth_adin2111_reg_update() [all …]
|
/Zephyr-latest/drivers/sensor/st/iis2mdc/ |
D | iis2mdc.c | 1 /* ST Microelectronics IIS2MDC 3-axis magnetometer sensor 5 * SPDX-License-Identifier: Apache-2.0 26 const struct sensor_value *val) in iis2mdc_set_odr() argument 28 struct iis2mdc_data *iis2mdc = dev->data; in iis2mdc_set_odr() 31 switch (val->val1) { in iis2mdc_set_odr() 45 return -EINVAL; in iis2mdc_set_odr() 48 if (iis2mdc_data_rate_set(iis2mdc->ctx, odr)) { in iis2mdc_set_odr() 49 return -EIO; in iis2mdc_set_odr() 58 const struct sensor_value *val) in iis2mdc_set_hard_iron() argument 60 struct iis2mdc_data *iis2mdc = dev->data; in iis2mdc_set_hard_iron() [all …]
|
/Zephyr-latest/drivers/dp/ |
D | swdp_bitbang.c | 2 * Copyright (c) 2018-2019 PHYTEC Messtechnik GmbH 5 * SPDX-License-Identifier: Apache-2.0 9 * This file is based on SW_DP.c from CMSIS-DAP Source (Revision: V2.0.0) 10 * https://github.com/ARM-software/CMSIS_5/tree/develop/CMSIS/DAP/Firmware 11 * Copyright (c) 2013-2017, ARM Limited, All Rights Reserved 12 * SPDX-License-Identifier: Apache-2.0 16 /* Serial Wire Debug Port interface bit-bang driver */ 50 struct gpio_dt_spec reset; member 69 * - CMSIS-DAP Command Specification, DAP_Transfer 70 * - ARM Debug Interface v5 Architecture Specification [all …]
|
/Zephyr-latest/drivers/sensor/asahi_kasei/akm09918c/ |
D | akm09918c_emul.h | 3 * SPDX-License-Identifier: Apache-2.0 19 void akm09918c_emul_set_reg(const struct emul *target, uint8_t reg_addr, const uint8_t *val, 30 void akm09918c_emul_get_reg(const struct emul *target, uint8_t reg_addr, uint8_t *val, 34 * @brief Reset the emulator 36 * @param target The target emulator to reset
|
D | akm09918c.c | 4 * SPDX-License-Identifier: Apache-2.0 33 struct akm09918c_data *data = dev->data; in akm09918c_start_measurement() 34 const struct akm09918c_config *cfg = dev->config; in akm09918c_start_measurement() 39 return -EINVAL; in akm09918c_start_measurement() 42 if (data->mode == AKM09918C_CNTL2_PWR_DOWN) { in akm09918c_start_measurement() 43 if (i2c_reg_write_byte_dt(&cfg->i2c, AKM09918C_REG_CNTL2, in akm09918c_start_measurement() 46 return -EIO; in akm09918c_start_measurement() 64 const struct akm09918c_config *cfg = dev->config; in akm09918c_fetch_measurement() 68 if (i2c_burst_read_dt(&cfg->i2c, AKM09918C_REG_ST1, buf, ARRAY_SIZE(buf)) != 0) { in akm09918c_fetch_measurement() 70 return -EIO; in akm09918c_fetch_measurement() [all …]
|
/Zephyr-latest/drivers/sensor/st/lsm6dso/ |
D | lsm6dso.c | 1 /* ST Microelectronics LSM6DSO 6-axis IMU sensor driver 5 * SPDX-License-Identifier: Apache-2.0 36 return -EINVAL; in lsm6dso_freq_to_odr_val() 47 return lsm6dso_odr_map[ARRAY_SIZE(lsm6dso_odr_map) - 1]; in lsm6dso_odr_to_freq_val() 62 return -EINVAL; in lsm6dso_accel_range_to_fs_val() 86 return -EINVAL; in lsm6dso_gyro_range_to_fs_val() 91 const struct lsm6dso_config *cfg = dev->config; in lsm6dso_reboot() 92 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm6dso_reboot() 95 return -EIO; in lsm6dso_reboot() 98 /* Wait sensor turn-on time as per datasheet */ in lsm6dso_reboot() [all …]
|
/Zephyr-latest/dts/bindings/dac/ |
D | gd,gd32-dac.yaml | 2 # SPDX-License-Identifier: Apache-2.0 6 compatible: "gd,gd32-dac" 8 include: [dac-controller.yaml, reset-device.yaml, pinctrl-device.yaml] 20 num-channels: 25 reset-val: 28 description: Reset value of DAC output. Defaults to 0, the SoC default. 30 "#io-channel-cells": 33 io-channel-cells: 34 - output
|
/Zephyr-latest/drivers/sensor/aosong/dht20/ |
D | dht20.c | 4 * SPDX-License-Identifier: Apache-2.0 35 * Reset register 0x1B, 0x1C and 0x1E 44 /** Wait some time after reset sequence (in ms) */ 72 const struct dht20_config *cfg = dev->config; in read_status() 78 rc = i2c_write_dt(&cfg->bus, tx_buf, sizeof(tx_buf)); in read_status() 84 rc = i2c_read_dt(&cfg->bus, rx_buf, sizeof(rx_buf)); in read_status() 97 const struct dht20_config *cfg = dev->config; in reset_register() 103 rc = i2c_write_read_dt(&cfg->bus, tx_buf, sizeof(tx_buf), rx_buf, sizeof(rx_buf)); in reset_register() 105 LOG_ERR("Failed to reset register."); in reset_register() 113 rc = i2c_write_dt(&cfg->bus, tx_buf, sizeof(tx_buf)); in reset_register() [all …]
|
/Zephyr-latest/drivers/fuel_gauge/sbs_gauge/ |
D | emul_sbs_gauge.c | 5 * SPDX-License-Identifier: Apache-2.0 33 /** Run-time data used by the emulator */ 48 /* Non-register values associated with the state of the battery */ 51 /* Battery terminal current - Pos is charging, Neg is discharging */ 65 static void emul_sbs_gauge_maybe_do_battery_cutoff(const struct emul *target, int reg, int val) in emul_sbs_gauge_maybe_do_battery_cutoff() argument 67 struct sbs_gauge_emul_data *data = target->data; in emul_sbs_gauge_maybe_do_battery_cutoff() 68 const struct sbs_gauge_emul_cfg *cfg = target->cfg; in emul_sbs_gauge_maybe_do_battery_cutoff() 71 if (cfg->cutoff_support && reg == cfg->cutoff_reg_addr) { in emul_sbs_gauge_maybe_do_battery_cutoff() 72 __ASSERT_NO_MSG(ARRAY_SIZE(cfg->cutoff_payload) > 0); in emul_sbs_gauge_maybe_do_battery_cutoff() 79 uint16_t target_payload_elem_val = cfg->cutoff_payload[data->cutoff_writes]; in emul_sbs_gauge_maybe_do_battery_cutoff() [all …]
|
/Zephyr-latest/drivers/sensor/nxp/fxos8700/ |
D | fxos8700.c | 5 * SPDX-License-Identifier: Apache-2.0 19 #define RANGE2FS(x) (__builtin_ctz(x) - 1) 29 const struct fxos8700_config *cfg = dev->config; in fxos8700_transceive() 33 return spi_transceive_dt(&cfg->bus_cfg.spi, &s, &s); in fxos8700_transceive() 41 const struct fxos8700_config *cfg = dev->config; in fxos8700_read_spi() 52 return spi_transceive_dt(&cfg->bus_cfg.spi, &tx, &rx); in fxos8700_read_spi() 82 uint8_t val) in fxos8700_reg_field_update_spi() argument 87 return -EIO; in fxos8700_reg_field_update_spi() 90 return fxos8700_byte_write_spi(dev, reg, (old_val & ~mask) | (val & mask)); in fxos8700_reg_field_update_spi() 107 const struct fxos8700_config *config = dev->config; in fxos8700_read_i2c() [all …]
|
/Zephyr-latest/include/zephyr/drivers/ethernet/ |
D | eth_adin2111.h | 4 * SPDX-License-Identifier: Apache-2.0 27 * @retval -EBUSY Returned without waiting. 28 * @retval -EAGAIN Waiting period timed out. 38 * @retval -EPERM The current thread does not own the device lock. 39 * @retval -EINVAL The device is not locked. 51 * @param val Value to write. 56 int eth_adin2111_reg_write(const struct device *dev, const uint16_t reg, uint32_t val); 66 * @param[out] val Read value output. 71 int eth_adin2111_reg_read(const struct device *dev, const uint16_t reg, uint32_t *val); 91 * @brief Reset both the MAC and PHY. [all …]
|
/Zephyr-latest/drivers/sensor/st/lsm6dsv16x/ |
D | lsm6dsv16x.c | 1 /* ST Microelectronics LSM6DSV16X 6-axis IMU sensor driver 5 * SPDX-License-Identifier: Apache-2.0 29 * should be selected through accel-odr property in DT 50 const struct lsm6dsv16x_config *cfg = dev->config; in lsm6dsv16x_freq_to_odr_val() 51 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lsm6dsv16x_freq_to_odr_val() 57 return -EINVAL; in lsm6dsv16x_freq_to_odr_val() 64 LOG_DBG("mode: %d - odr: %d", mode, i); in lsm6dsv16x_freq_to_odr_val() 69 return -EINVAL; in lsm6dsv16x_freq_to_odr_val() 84 return -EINVAL; in lsm6dsv16x_accel_range_to_fs_val() 111 return -EINVAL; in lsm6dsv16x_gyro_range_to_fs_val() [all …]
|
/Zephyr-latest/drivers/audio/ |
D | tlv320dac310x.c | 4 * SPDX-License-Identifier: Apache-2.0 25 #define CODEC_OUTPUT_VOLUME_MIN (-78 * 2) 44 uint8_t val); 46 uint8_t *val); 66 const struct codec_driver_config *const dev_cfg = dev->config; in codec_initialize() 68 if (!device_is_ready(dev_cfg->bus.bus)) { in codec_initialize() 70 return -ENODEV; in codec_initialize() 73 if (!gpio_is_ready_dt(&dev_cfg->reset_gpio)) { in codec_initialize() 75 return -ENODEV; in codec_initialize() 84 const struct codec_driver_config *const dev_cfg = dev->config; in codec_configure() [all …]
|
/Zephyr-latest/drivers/sensor/hp206c/ |
D | hp206c.c | 5 * SPDX-License-Identifier: Apache-2.0 26 const struct hp206c_device_config *cfg = dev->config; in hp206c_bus_config() 31 return i2c_configure(cfg->i2c.bus, i2c_cfg); in hp206c_bus_config() 37 const struct hp206c_device_config *cfg = dev->config; in hp206c_read() 41 if (i2c_burst_read_dt(&cfg->i2c, cmd, data, len) < 0) { in hp206c_read() 42 return -EIO; in hp206c_read() 59 const struct hp206c_device_config *cfg = dev->config; in hp206c_write() 63 if (i2c_burst_write_dt(&cfg->i2c, cmd, data, len) < 0) { in hp206c_write() 64 return -EIO; in hp206c_write() 80 const struct hp206c_device_config *cfg = dev->config; in hp206c_cmd_send() [all …]
|
/Zephyr-latest/drivers/sensor/meas/ms5607/ |
D | ms5607_i2c.c | 4 * SPDX-License-Identifier: Apache-2.0 22 return i2c_write_dt(&config->bus_cfg.i2c, &cmd, 1); in ms5607_i2c_raw_cmd() 37 uint16_t *val) in ms5607_i2c_read_prom() argument 42 err = i2c_burst_read_dt(&config->bus_cfg.i2c, cmd, valb, sizeof(valb)); in ms5607_i2c_read_prom() 47 *val = sys_get_be16(valb); in ms5607_i2c_read_prom() 58 static int ms5607_i2c_read_adc(const struct ms5607_config *config, uint32_t *val) in ms5607_i2c_read_adc() argument 63 err = i2c_burst_read_dt(&config->bus_cfg.i2c, MS5607_CMD_CONV_READ_ADC, valb, sizeof(valb)); in ms5607_i2c_read_adc() 68 *val = (valb[0] << 16) + (valb[1] << 8) + valb[2]; in ms5607_i2c_read_adc() 76 if (!device_is_ready(config->bus_cfg.i2c.bus)) { in ms5607_i2c_check() 78 return -ENODEV; in ms5607_i2c_check() [all …]
|
/Zephyr-latest/drivers/can/ |
D | can_mcux_mcan.c | 4 * SPDX-License-Identifier: Apache-2.0 14 #include <zephyr/drivers/reset.h> 31 const struct reset_dt_spec reset; member 34 static int mcux_mcan_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) in mcux_mcan_read_reg() argument 36 const struct can_mcan_config *mcan_config = dev->config; in mcux_mcan_read_reg() 37 const struct mcux_mcan_config *mcux_config = mcan_config->custom; in mcux_mcan_read_reg() 39 return can_mcan_sys_read_reg(mcux_config->base, reg, val); in mcux_mcan_read_reg() 42 static int mcux_mcan_write_reg(const struct device *dev, uint16_t reg, uint32_t val) in mcux_mcan_write_reg() argument 44 const struct can_mcan_config *mcan_config = dev->config; in mcux_mcan_write_reg() 45 const struct mcux_mcan_config *mcux_config = mcan_config->custom; in mcux_mcan_write_reg() [all …]
|
/Zephyr-latest/drivers/sensor/nxp/fxas21002/ |
D | fxas21002.c | 4 * SPDX-License-Identifier: Apache-2.0 28 const struct fxas21002_config *cfg = dev->config; in fxas21002_transceive() 32 return spi_transceive_dt(&cfg->bus_cfg.spi, &s, &s); in fxas21002_transceive() 40 const struct fxas21002_config *cfg = dev->config; in fxas21002_read_spi() 51 return spi_transceive_dt(&cfg->bus_cfg.spi, &tx, &rx); in fxas21002_read_spi() 81 uint8_t val) in fxas21002_reg_field_update_spi() argument 91 return fxas21002_byte_write_spi(dev, reg, (old_val & ~mask) | (val & mask)); in fxas21002_reg_field_update_spi() 108 const struct fxas21002_config *config = dev->config; in fxas21002_read_i2c() 110 return i2c_burst_read_dt(&config->bus_cfg.i2c, reg, data, length); in fxas21002_read_i2c() 117 const struct fxas21002_config *config = dev->config; in fxas21002_byte_read_i2c() [all …]
|
/Zephyr-latest/drivers/sensor/bosch/bmm150/ |
D | bmm150.c | 1 /* bmm150.c - Driver for Bosch BMM150 Geomagnetic Sensor */ 7 * SPDX-License-Identifier: Apache-2.0 40 const struct bmm150_config *cfg = dev->config; in bmm150_bus_check() 42 return cfg->bus_io->check(&cfg->bus); in bmm150_bus_check() 48 const struct bmm150_config *cfg = dev->config; in bmm150_reg_read() 50 return cfg->bus_io->read(&cfg->bus, start, buf, size); in bmm150_reg_read() 54 uint8_t val) in bmm150_reg_write() argument 56 const struct bmm150_config *cfg = dev->config; in bmm150_reg_write() 58 return cfg->bus_io->write(&cfg->bus, reg, val); in bmm150_reg_write() 100 static int bmm150_set_odr(const struct device *dev, uint8_t val) in bmm150_set_odr() argument [all …]
|
/Zephyr-latest/drivers/reset/ |
D | reset_nxp_rstctl.c | 4 * SPDX-License-Identifier: Apache-2.0 10 #include <zephyr/drivers/reset.h> 23 const uint32_t *base = dev->config; in reset_nxp_rstctl_status() 25 uint32_t val = *ctl_reg; in reset_nxp_rstctl_status() local 27 *status = (uint8_t)FIELD_GET(NXP_RSTCTL_BIT(id), val); in reset_nxp_rstctl_status() 34 const uint32_t *base = dev->config; in reset_nxp_rstctl_line_assert() 44 const uint32_t *base = dev->config; in reset_nxp_rstctl_line_deassert() 67 static DEVICE_API(reset, reset_nxp_rstctl_driver_api) = {
|
/Zephyr-latest/tests/lib/devicetree/api/ |
D | app.overlay | 4 * SPDX-License-Identifier: Apache-2.0 9 * with real-world devicetree nodes, to allow these tests to run on 15 test-alias = &test_nodelabel; 28 #address-cells = < 0x1 >; 29 #size-cells = < 0x1 >; 30 interrupt-parent = <&test_intc>; 32 test_cpu_intc: interrupt-controller { 33 compatible = "vnd,cpu-intc"; 34 #address-cells = <0>; 35 #interrupt-cells = < 0x01 >; [all …]
|
/Zephyr-latest/drivers/sensor/st/lis2mdl/ |
D | lis2mdl.c | 1 /* ST Microelectronics LIS2MDL 3-axis magnetometer sensor 3 * Copyright (c) 2018-2019 STMicroelectronics 5 * SPDX-License-Identifier: Apache-2.0 21 /* Based on the data sheet, the maximum turn-on time is ("9.4 ms + 1/ODR") when 35 const struct sensor_value *val) in lis2mdl_set_odr() argument 37 const struct lis2mdl_config *cfg = dev->config; in lis2mdl_set_odr() 38 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in lis2mdl_set_odr() 41 switch (val->val1) { in lis2mdl_set_odr() 55 return -EINVAL; in lis2mdl_set_odr() 59 return -EIO; in lis2mdl_set_odr() [all …]
|