text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>e ASSERT_SIZE_PAGESIZE_VALID(size, page) \ BUILD_ASSERT(size % page == 0U, \ "Size is not an integer multiple of page size") #define INST_DT_AT2X(inst, t) DT_INST(inst, atmel_at##t) #define EEPROM_AT24_BUS(n, t) \ { .i2c = I2C_DT_SPEC_GET(INST_DT_AT2X(n, t)) } #define EEPROM_AT25_BUS(n,...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright 2020 Google LLC * Copyright (c) 2020 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apa<|fim_suffix|> the 'buf' member with the data that was read * @param num_msgs Number of messages to process * @param addr Address of the I2C target device. This is assumed to be correct, * d...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>izeof(buf)) >= dev_config->page_size)) { rc = eeprom_emu_compactor(dev, NULL); if (rc) { return rc; } } /* Fill the ram buffer if enabled */ if (dev_config->rambuf) { offset = 0; while (offset < dev_config->size) { rc = eeprom_emu_word_read(dev, offset, buf); if (rc) { return r...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2022 Vestas Wind Systems A/S * * SPDX-License-Identifier: Apache-2.0 */ #include <string.h> #include <zephyr/device.h> #include <zeph<|fim_suffix|>ce *dev) { ARG_UNUSED(dev); /* Install default delegates */ fake_eeprom_read_fake.custom_fake = fake_eeprom_read_delegate; fake_e...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Luna Pes <zephyr@orangemurker.com> * * SPDX-License-Identifier: Apache-2.0 */ /* This file implements the Infineon AN304 SPI Guide for F-RAM */ #include "zephyr/devicetree.h" #include "zephyr/kernel.h" #include "zephyr/sys/byteorder.h" #include "zephyr/sys/util.h" #include <z...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>size)); return z_impl_eeprom_get_size((const struct device *)dev); } #include <zephyr/syscalls/eeprom_get_size_mrsh.c> <|fim_prefix|>/* * Copyright (c) 2019 Vestas Wind Systems A/S * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/internal/syscall_handler.h> #include <zephyr/drivers/eeprom...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2020 Seagate Technology LLC * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT nxp_lpc11u6x_eeprom /** * @file * @brief EEPROM driver for NXP LPC11U6X MCUs * * This driver supports the on-chip EEPROM found on NXP LPC11U6x MCUs. * * @note This driver is only a w...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ar *)buf + len_in_page; offset += len_in_page; } k_mutex_unlock(&data->lock); return 0; } static int mb85rcxx_i2c_write(const struct device *dev, uint16_t i2c_addr, uint8_t *addr, const void *buf, size_t len) { const struct mb85rcxx_config *cfg = dev->config; struct i2c_msg msgs[2]; ms...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024 Antmicro <www.antmicro.com> * * SPDX-License-Identifier: Apache-2.0 */ /** * @file * @brief Driver for Fujitsu MB85RSXX FRAM over SPI. */ #define DT_DRV_COMPAT fujitsu_mb85rsxx #include <zephyr/device.h> #include <zephyr/drivers/eeprom.h> #include <zephyr/drivers/spi.h> #...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>uct eeprom_xec_regs * const regs = devcfg->regs; int ret; switch (action) { case PM_DEVICE_ACTION_RESUME: ret = pinctrl_apply_state(devcfg->pcfg, PINCTRL_STATE_DEFAULT); if (ret != 0) { LOG_ERR("XEC EEPROM pinctrl setup failed (%d)", ret); return ret; } regs->mode |= XEC_EEPROM_MODE_ACTI...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>NVAL; } err = 0; len = shell_strtoul(argv[args_indx.length], 0, &err); if (err) { shell_error(sh, "Error parsing length"); return -EINVAL; } eeprom = shell_device_get_binding(argv[args_indx.device]); if (!eeprom) { shell_error(sh, "EEPROM device not found"); return -EINVAL; } shell_prin...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ev->config; if ((offset + len) <= config->size) { return 1; } return 0; } static int eeprom_sim_read(const struct device *dev, off_t offset, void *data, size_t len) { if (!len) { return 0; } if (!eeprom_range_is_valid(dev, offset, len)) { LOG_WRN("attempt to read past device boundary...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> remove the file but do not error out if we can't */ (void)remove(eeprom_file_path); } } <|fim_prefix|>/* * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 * * Part of EEPROM simulator which interacts with the host OS / Linux * * When building for the native s...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #ifndef DRIVERS_EEPROM_EEPROM_SIMULATOR_NATIVE_H #define DRIVERS_EEPROM_EEPROM_SIMULATOR_NATIVE_H #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif int eeprom_mock_init_native(bool eeprom_in_ram, char **mock_ee...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2019 Kwon Tae-young <tykwon@m2i.co.kr> * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_stm32_eeprom #include <zephyr/drivers/eeprom.h> #include <soc.h> #include <zephyr/kernel.h> #define LOG_LEVEL CONFIG_EEPROM_LOG_LEVEL #include <zephyr/logging/log.h> LOG_MOD...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2020 Innoseis B.V * * SPDX-License-Identifier: Apache-2.0 */ #include <errno.h> #include <zephyr/devicetree.h> #include <zephyr/drivers/eeprom.h> #include <zephyr/drivers/sensor/tmp11x.h> #define DT_DRV_COMPAT ti_tmp11x_eeprom struct eeprom_tmp11x_config { const str<|fim_suffix...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>NT 5 static inline uint32_t get_trng_u32(void) { return AM_REGVAL(TRNG_BASE); } static int entropy_ambiq_get_trng(const struct device *dev, uint8_t *buffer, uint16_t length) { ARG_UNUSED(dev); /* Validate input parameters */ if (length == 0 || buffer == NULL) { return -EINVAL; } uint8_t *byte_...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2026 Realtek Semiconductor Corp. * * SPDX-License-Identifier: Apache-2.0 */ /** * @brief Driver for Realtek Ameba TRNG */ #define DT_DRV_COMPAT realtek_ameba_trng /* Include <soc.h> before <ameba_soc.h> to avoid redefining unlikely() macro */ #include <soc.h> #include <ameba_soc.h> #include ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. * SPDX-License-Identifier: Apache-2.0 *<|fim_suffix|>ure_counter = 0; uint16_t generated_bytes = 0; while (length > 0) { unsigned long value; if (__builtin_aarch64_rndrrs(&value) != 0) { if (++failure_counter > max_retri...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>tropy_b91_trng_api); <|fim_prefix|>/* * Copyright (c) 2021 Telink Semiconductor * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT telink_b91_trng #include <trng.h> #include <zephyr/drivers/entropy.h> #include <string.h> /* API implementation: driver initialization */ static int entr...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright(c) 2026, Realtek Semiconductor Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT realtek_bee_trng #include <zephyr/drivers/entropy.h> #include <string.h> #include <utils.h> static int entropy_bee_get_entropy(const struct device *dev, uint8_t *buffer<|fim_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>val |= SEC_ENG_SE_TRNG_0_DOUT_CLR_1T; sys_write32(regval, base + SEC_ENG_SE_TRNG_0_CTRL_0_OFFSET); regval = sys_read32(base + SEC_ENG_SE_TRNG_0_CTRL_0_OFFSET); regval &= ~SEC_ENG_SE_TRNG_0_DOUT_CLR_1T; sys_write32(regval, base + SEC_ENG_SE_TRNG_0_CTRL_0_OFFSET); out_disable: /* Disable TRNG */ reg...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2022, Commonwealth Scientific and Industrial Research * Organisation (CSIRO) ABN 41 687 119 230. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT zephyr_bt_hci_entropy #include <zephyr/drivers/entropy.h> #include <zephyr/bluetooth/hci.h> #include <string.h> stati...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2019 Brett Witherspoon * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT ti_cc13xx_cc26xx_trng #include <zephyr/kernel.h> #include <zephyr/device.h> #include <zephyr/drivers/entropy.h> #include <zephyr/irq.h> #include <zephyr/pm/policy.h> #include <zephyr/pm/device....
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2017 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT espressif_esp32_trng #include <string.h> #include <soc/rtc.h> #include <hal/rng_ll.h> #include <esp_system.h> #include <soc.h> #include <esp_cpu.h> #include <zephyr/logging/log.h> #include <zep...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>wait_drdy(); if (ret < 0) { return ret; } uint32_t word = trng_get_true_random_data(); if (len >= sizeof(word)) { memcpy(dst, &word, sizeof(word)); dst += sizeof(word); len -= sizeof(word); } else { memcpy(dst, &word, len); len = 0U; } } return 0; } static int entropy_...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2021 Safran Passenger Innovations Germany GmbH * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT silabs_gecko_semailbox #include <zephyr/drivers/entropy.h> #include <soc.h> #include "em_cmu.h" #include "sl_se_manager.h" #include "sl_se_manager_entropy.h" static int entropy...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ot for Crypto * ACC RNGOUT FIFO memory base address, like it does for register address definitions. * * Solution: Check which register base address is used for the Crypto ACC peripheral and select an * appropriate FIFO memory base address. */ #if (CRYPTOACC_BASE == CRYPTOACC_S_BASE) #define S2_FIFO_B...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>; } #include <zephyr/syscalls/entropy_get_entropy_mrsh.c> <|fim_prefix|>/* * Copyright (c) 2017 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/entropy.h> #include <zephyr/internal/syscall_handler.h> static inline int z_vrfy_entropy_get_entropy(const struct devi...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2025 TOKITA Hiroshi * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT brcm_iproc_rng200 #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(iproc_rng200_entropy, CONFIG_ENTROPY_LOG_LEVEL); #include <zephyr/device.h> #include <zephyr/drivers/entropy.h> #include <errno.h> #include...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>th > 0) { size_t to_copy; uint32_t value; value = litex_read(PRBS_STATUS, PRBS_WIDTH); to_copy = MIN(length, sizeof(value)); memcpy(buffer, &value, to_copy); buffer += to_copy; length -= to_copy; } return 0; } static DEVICE_API(entropy, entropy_prbs_api) = { .get_entropy = entropy_prbs...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>reak; /* Data not ready do not wait */ } copy_len = MIN(len, 4); memcpy(buf, (uint8_t *)&temp, copy_len); len -= copy_len; buf += copy_len; count += copy_len; } /* User would like to read len bytes but in non-blocking mode * the function might read less, in that case return va...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Vogl Electronic GmbH * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT adi_maxq10xx_trng #include <zephyr/kernel.h> #include <zephyr/device.h> #include <zephyr/drivers/spi.h> #include <zephyr/drivers/entropy.h> #include <zephyr/drivers/mfd/mfd_maxq10xx.h> #incl...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Microchip Technology Inc. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT microchip_trng_g1_entropy #include <soc.h> #include <zephyr/logging/log.h> #include <zephyr/drivers/entropy.h> #include <zephyr/drivers/clock_control/mchp_clock_control.h> LOG_MODULE_R...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright 2022, NXP * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT nxp_imx_caam #include <zephyr/device.h> #include <zephyr/drivers/entropy.h> #include <zephyr/random/random.h> #include <zephyr/init.h> #include <zephyr/kernel.h> #include "fsl_caam.h" struct mcux_entropy_conf...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2017 Linaro Limited. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT nxp_lpc_rng #include <zephyr/device.h> #include <zephyr/drivers/entropy.h> #include <zephyr/random/random.h> #include <zephyr/init.h> #include "fsl_rng.h" struct mcux_entropy_config { RNG_Type...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>RT_NO_MSG(!status); output ^= random; } RNGA_SetMode(RNG, kRNGA_ModeSleep); return output; } static int entropy_mcux_rnga_get_entropy(const struct device *dev, uint8_t *buffer, uint16_t length) { int i; ARG_UNUSED(dev); for (i = 0; i < length; i++) { buffer[i] = entropy_mcux_rng...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ch (action) { case PM_DEVICE_ACTION_RESUME: break; case PM_DEVICE_ACTION_SUSPEND: break; case PM_DEVICE_ACTION_TURN_OFF: break; case PM_DEVICE_ACTION_TURN_ON: entropy_mcux_trng_init(dev); break; default: return -ENOTSUP; } return 0; } #endif /*CONFIG_PM_DEVICE*/ PM_DEVICE_DT_INST_DEFIN...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>.sem_sync, 0, 1), }; DEVICE_DT_INST_DEFINE(0, entropy_mspm0_trng_init, NULL, &entropy_mspm0_trng_data, &entropy_mspm0_trng_config, PRE_KERNEL_1, CONFIG_ENTROPY_INIT_PRIORITY, &entropy_mspm0_trng_driver_api); <|fim_prefix|>/* * Copyright (c) 2025 Linumiz GmbH * * SPDX-Li...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2021,2025 Henrik Brix Andersen <henrik@brixandersen.dk> * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT neorv32_trng #include <zephyr/device.h> #include <zephyr/drivers/syscon.h> #include <zephyr/drivers/entropy.h> #include <zephyr/logging/log.h> #include <zephyr/pm/device.h> #...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024 Nuvoton Technology Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT nuvoton_npcx_drbg #include <errno.h> #include <zephyr/kernel.h> #include <zephyr/drivers/entropy.h> #include <zephyr/pm/device.h> #include <zephyr/logging/log.h> LOG_MODULE_REGIS...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>py_nrf5_data.sem_lock, 1, 1); /* Syncing semaphore */ k_sem_init(&entropy_nrf5_data.sem_sync, 0, 1); rng_pool_init((struct rng_pool *)(entropy_nrf5_data.thr), CONFIG_ENTROPY_NRF5_THR_POOL_SIZE, CONFIG_ENTROPY_NRF5_THR_THRESHOLD); rng_pool_init((struct rng_pool *)(entropy_nrf5_data.is...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>onst struct device *dev) { (void)dev; return nrfx_cracen_ctr_drbg_init(); } static DEVICE_API(entropy, nrf_cracen_api_funcs) = { .get_entropy = nrf_cracen_get_entropy, .get_entropy_isr = nrf_cracen_get_entropy_isr }; DEVICE_DT_INST_DEFINE(0, nrf_cracen_cracen_init, NULL, NULL, NULL, PRE_KERNEL_1, ...
fim
zephyrproject-rtos/zephyr
c
/* entropy_nxp_ele.c - NXP ELE entropy driver */ /* * Copyright 2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT nxp_ele_trng #include <zephyr/logging/log.h> #include <zephyr/drivers/entropy.h> #include <zephyr/kernel.h> #include <zephyr/sys/atomic.h> #include <zephyr/sys/util.h> #includ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>NG_NODE, entropy_els_init, NULL, NULL, NULL, PRE_KERNEL_1, CONFIG_ENTROPY_INIT_PRIORITY, &entropy_els_api_funcs); <|fim_prefix|>/* * Copyright 2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/clock_control.h> #include <zephyr/drivers/entropy.h> #include <zephyr/sys/util...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>rypto_rng_init, NULL, NULL, NULL, PRE_KERNEL_1, CONFIG_ENTROPY_INIT_PRIORITY, &entropy_psa_crypto_rng_api); <|fim_prefix|>/* * Copyright (c) 2022 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT zephyr_psa_crypto_rng #include <zephyr/drivers/e...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>)) { return -ENODATA; } memcpy(buf, n, to_copy); buf += to_copy; len -= to_copy; } return 0; } static DEVICE_API(entropy, entropy_renesas_ra_api) = { .get_entropy = entropy_renesas_ra_get_entropy, }; static int entropy_renesas_ra_init(const struct device *dev) { HW_SCE_McuSpecificInit();...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>lue = get_rand_64(); } memcpy(buf_bytes, &value, to_copy); buf_bytes += to_copy; len -= to_copy; } return 0; } static DEVICE_API(entropy, entropy_rpi_pico_api_funcs) = { .get_entropy = entropy_rpi_pico_get_entropy }; DEVICE_DT_INST_DEFINE(0, NULL, NULL, NULL, NULL, PRE_KERNEL_1, ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright 2019 NXP * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT openisa_rv32m1_trng #include <zephyr/device.h> #include <zephyr/drivers/entropy.h> #include <zephyr/random/random.h> #include <zephyr/init.h> #include "fsl_trng<|fim_suffix|>; status = TRNG_GetRandomData(conf...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2018 Aurelien Jarno * Copyright (c) 2023 Gerson Fernando Budke * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT atmel_sam_trng #include <zephyr/device.h> #include <zephyr/drivers/entropy.h> #include <zephyr/drivers/clock_control/atmel_sam_pmc.h> #include <errno.h>...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>e (length) { sys_set_bit(config->base + TRNG_CTRL, TRNG_CTRL_GEN_SEED_START_Pos); while (!sys_test_bit(config->base + TRNG_STAT, TRNG_STAT_SEED_VALID_Pos)) { } /* Generate random data */ sys_set_bit(config->base + TRNG_CTRL, TRNG_CTRL_GEN_RAND_NUM_START_Pos); while (!sys_test_bit(config->base...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024 Silicon Laboratories Inc. * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT silabs_siwx91x_rng #include <zephyr/drivers/clock_control.h> #include <zephyr/drivers/entropy.h> #include "rsi_rom_rng.h" struct rng_siwx91x_config { HWRNG_Type *reg; const struct devic...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>RTBOND_THR_POOL_SIZE - 1)) == 0, "The CONFIG_ENTROPY_SMARTBOND_THR_POOL_SIZE must be a power of 2!"); struct entropy_smartbond_dev_data { struct k_sem sem_lock; struct k_sem sem_sync; RNG_POOL_DEFINE(isr, CONFIG_ENTROPY_SMARTBOND_ISR_POOL_SIZE); RNG_POOL_DEFINE(thr, CONFIG_ENTROPY_SMARTBOND_TH...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> CONFIG_ENTROPY_STM32_THR_THRESHOLD); rng_pool_init((struct rng_pool *)(dev_data->isr), CONFIG_ENTROPY_STM32_ISR_POOL_SIZE, CONFIG_ENTROPY_STM32_ISR_THRESHOLD); #if !IRQLESS_TRNG IRQ_CONNECT(IRQN, IRQ_PRIO, stm32_rng_isr, &entropy_stm32_rng_data, 0); #endif /* !IRQLESS_TRNG */ #if ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>d(CONFIG_SOC_SERIES_STM32WB0X) /* STM32WB05 / STM32WB06 / STM32WB07 */ return LL_RNG_IsActiveFlag_RNGRDY(RNGx); #else return LL_RNG_IsActiveFlag_DRDY(RNGx); #endif /* CONFIG_SOC_SERIES_STM32WB0X */ } #if defined(CONFIG_SOC_SERIES_STM32WB0X) && !defined(CONFIG_SOC_STM32WB09XX) /* STM32WB05, STM32WB06 a...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 sensry.io * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT sensry_sy1xx_trng #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(sy1xx_entropy, CONFIG_ENTROPY_LOG_LEVEL); #include <zephyr/device.h> #include <zephyr/drivers/entropy.h> #include <errno.h> #inclu...
fim
zephyrproject-rtos/zephyr
c
/** * Copyright (c) 2025 TOKITA Hiroshi * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/entropy.h> #include <zephyr/drivers/virtio.h> #include <zephyr/drivers/virtio/virtqueue.h> #include <zephyr/logging/log.h> #define VIRTIO_ENTROPY_QUEUE_IDX 0 #define DT_DRV_COMPAT virtio_device4 LOG_MODUL...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>N; return ret; } static DEVICE_API(entropy, entropy_wch_api_funcs) = {.get_entropy = entropy_wch_get_entropy}; #define ENTROPY_WCH_DEVICE(inst) \ static const struct entropy_wch_config entropy_wch_config_##inst = { ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 202<|fim_suffix|>f); } } <|fim_middle|>4 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 * * Bottom/Linux side of the pseudo-random entropy generator for the native simulator */ #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 700 #include <stdbool.h> #include <stdli...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> */ <|fim_prefix|>/* * Copyright (c) 2024 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #ifndef DRIVERS_ENTROPY_FAKE_ENTROPY_NATIVE_BOTTOM_H #define DRIVERS_ENTROPY_FAKE_ENTROPY_N<|fim_middle|>ATIVE_BOTTOM_H #ifdef __cplusplus extern "C" { #endif void entropy_native_seed(unsi...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ecimal), 0x17BCD (hex), or 0275715 (octal)" }, { .is_switch = true, .option = "seed-random", .type = 'b', .dest = (void *)&seed_random, .descript = "Seed the random generator from /dev/urandom. " "Note your test may not be reproducible if you set this option" }, ARG_TABLE_EN...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>{ \ DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(n), EMUL_LINK_AND_COMMA)}; \ static struct emul_list_for_bus espi_emul_cfg_##n = { \ .children = emuls_##n, ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2020 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/espi.h> #include <zephyr/internal/syscall_handler.h> static inline int z_vrfy_espi_config(const struct device *dev, struct espi_cfg *cfg) { struct espi_cfg cfg_copy; K_OOPS(K_S...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2021 ITE Corporation. All Rights Reserved. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT ite_it8xxx2_espi #include <assert.h> #include <zephyr/drivers/espi.h> #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/interrupt_controller/wuc_ite_it51xxx.h> #incl...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>_ids[1]) = girq_result; for (int i = 0; i < ARRAY_SIZE(m2s_vwires_ext_isr); i++) { struct espi_isr entry = m2s_vwires_ext_isr[i]; if (girq_result & entry.girq_bit) { if (entry.the_isr != NULL) { entry.the_isr(dev); } } } } #endif static void espi_xec_periph_isr(const struct device *de...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>CONFIG_ESPI_PERIPHERAL_DEBUG_PORT_80)) { mchp_xec_ecia_info_girq_src_dis(xec_p80bd0_cfg.ecia_info); } } #endif /* CONFIG_ESPI_PERIPHERAL_CUSTOM_OPCODE */ <|fim_prefix|>/* * Copyright (c) 2019 Intel Corporation * Copyright (c) 2021 Microchip Technology Inc. * * SPDX-License-Identifier: Apache-2.0 *...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2019 Intel Corporation * Copyright (c) 2021 Microchip Technology Inc. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT microchip_xec_espi_v2 #include <zephyr/kernel.h> #include <soc.h> #include <errno.h> #include <zephyr/drivers/espi.h> #include <zephyr/drivers/cl...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ct device *dev, enum lpc_peripheral_opcode op, uint32_t *data); #endif /* ZEPHYR_DRIVERS_ESPI_MCHP_XEC_ESPI_V2_H_ */ <|fim_prefix|>/* * Copyright (c) 2021 Microchip Technology Inc. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_ESPI_MCHP_XEC_ESPI_V2_H_ #define ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>_MAX_PAYLOAD) { LOG_ERR("Out of OOB received buffer: %d", sz_oob_rx); return -EINVAL; } /* Set received size to package structure */ pckt->len = sz_oob_rx; /* Read PUT_OOB data into 32-bits rx buffer in little endian */ for (idx_rx_buf = 0; idx_rx_buf < sz_oob_rx/4; idx_rx_buf++) { oob_data =...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Realtek, SIBG-SD7 * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT realtek_rts5912_espi #include <zephyr/kernel.h> #include <zephyr/drivers/espi.h> #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/pinctrl.h> #include <zephyr/drivers/clock_control.h> #...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>_CMD_CTYPE_READ0) || (cmd == MCHP_SAF_ECP_CMD_CTYPE_WRITE0)) { rc = check_ecp_access_size(pckt->len); if (rc) { LOG_ERR("SAF EC Portal size out of bounds"); return rc; } if (cmd == MCHP_SAF_ECP_CMD_CTYPE_WRITE0) { memcpy(slave_mem, pckt->buf, pckt->len); } n = pckt->len; } els...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>EC_READ_TIMEOUT), \ .sus_chk_delay = DT_INST_PROP_OR(n, sus_chk_delay, \ MCHP_SAF_FLASH_SUS_CHK_DELAY), \ .sus_rsm_interval = DT_INST_PROP_OR(n, sus_rsm_interval, \ MCHP_SAF_FLASH_SUS_RSM_INTERVAL), \ .poll_interval = DT_INST_PROP_OR(n, poll_interval, \ MCHP_SAF_FLASH_P...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2023 Nuvoton Technology Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT nuvoton_npcx_espi_taf #include <soc.h> #include <zephyr/drivers/espi.h> #include <zephyr/drivers/espi_saf.h> #include <zephyr/drivers/flash.h> #include <zephyr/dt-bindings/flash_c...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> instance. * @param pins The details on the event that triggered the callback. */ static inline void espi_send_callbacks(sys_slist_t *list, const struct device *dev, struct espi_event evt) { struct espi_callback *cb, *tmp; SYS_SLIST_FOR_EACH_CONTAINER_SAFE(list, cb, tmp, node) {...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2020 Nuvoton Technology Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT nuvoton_npcx_host_sub /** * @file * @brief Nuvoton NPCX host sub modules driver * * This file contains the drivers of NPCX Host Sub-Modules that serve as an * interface betwe...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>NET_TC_TX_COUNT) : 8); if (row > CONFIG_DSA_NXP_IMX_NETC_GCL_LEN) { LOG_ERR("The gate control list length exceeds the limit"); return -ENOTSUP; } prv->qbv_config[cfg->port_idx].gcList[row].interval = config->qbv_param.gate_control.time_interval; prv->qbv_config[cfg->port_idx].gcList[row]....
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * SPDX-FileCopyrightText: Copyright 2025-2026 NXP * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(dsa_tag_netc, CONFIG_ETHERNET_LOG_LEVEL); #include <zephyr/net/ethernet.h> #include <zephyr/net/dsa_core.h> #include <zephyr/net/dsa_tag.h> #include "dsa_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>switch_tag_common common; uint16_t: 4; uint16_t host_reason: 4; uint64_t timestamp; }; /* Switch tag for to_host with timestamp */ struct netc_switch_tag_host_tx_ts { struct netc_switch_tag_common common; uint16_t ts_req_id: 4; uint16_t host_reason: 4; uint64_t timestamp; }; #pragma pack() #endif...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024 Intel Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT snps_dwcxgmac #include "eth_dwc_xgmac_priv.h" #include <zephyr/cache.h> #define LOG_MODULE_NAME eth_dwc_xgmac #define LOG_LEVEL CONFIG_ETHERNET_LOG_LEVEL LOG_MODULE_REGISTER(LOG_MODULE_...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Intel Hard Processor System 10 Giga bit TSN Ethernet Media Access controller (XGMAC) driver * * Driver private data declarations * * Copyright (c) 2024 Intel Corporation. * SPDX-License-Identifier: Apache-2.0 */ #ifndef _ZEPHYR_DRIVERS_ETHERNET_ETH_DWC_XGMAC_PRIV_H_ #define _ZEPHYR_DRIVERS_ET...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>node, 1) == 0) && \ (NODE_MAC_ADDR_OCTET(node, 2) == 0) && \ (NODE_MAC_ADDR_OCTET(node, 3) == 0) && \ (NODE_MAC_ADDR_OCTET(node, 4) == 0) && \ (NODE_MAC_ADDR_OCTET(node, 5) == 0)) /* Given a device tree node for an ethernet controller will * returns false if there is no local-mac-address propert...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2023 PHOENIX CONTACT Electronics GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(eth_adin2111, CONFIG_ETHERNET_LOG_LEVEL); #include <zephyr/net/net_pkt.h> #include <zephyr/net/ethernet.h> #include <zephyr/net/phy.h> #if CONFIG_E...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2023 PHOENIX CONTACT Electronics GmbH * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ETH_ADIN2111_PRIV_H__ #define ETH_ADIN2111_PRIV_H__ #include <stdint.h> #include <stdbool.h> #include <zephyr/kernel.h> #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/spi.h> #include...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * SPDX-License-Identifier: Apache-2.0 * Copyright (C) 2022, Intel Corporation * Description: * 3504-0 Universal 10/100/1000 Ethernet MAC (DWC_gmac) * Driver specifically designed for Cyclone V SoC DevKit use only. * * based on Intel SOC FPGA HWLIB Repo * https://github.com/altera-opensource/int...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>#ifndef ETH_CYCLONEV_HEADER #define ETH_CYCLONEV_HEADER /* * SPDX-License-Identifier: Apache-2.0 * Copyright (C) 2022, Intel Corporation * Description: * Driver for the Synopsys DesignWare * 3504-0 Universal 10/100/1000 Ethernet MAC (DWC_gmac) * specifically designed for Cyclone V SoC DevKit use onl...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* Davicom DM9051 Ethernet Controller with SPI interface * * Copyright (c) 2026 Andrei-Edward Popa * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT davicom_dm9051 #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(eth_dm9051, CONFIG_ETHERNET_LOG_LEVEL); #include <string.h> #includ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ESC_PHYS_H(0)); REG_WRITE(DMA_CHn_TXDESC_LIST_ADDR(0), TXDESC_PHYS_L(0)); REG_WRITE(DMA_CHn_RXDESC_LIST_HADDR(0), RXDESC_PHYS_H(0)); REG_WRITE(DMA_CHn_RXDESC_LIST_ADDR(0), RXDESC_PHYS_L(0)); REG_WRITE(DMA_CHn_TXDESC_RING_LENGTH(0), NB_TX_DESCS - 1); REG_WRITE(DMA_CHn_RXDESC_RING_LENGTH(0), NB_RX_DESC...
fim
zephyrproject-rtos/zephyr
c
/* * Driver for Synopsys DesignWare MAC * * Copyright (c) 2021 BayLibre SAS * * SPDX-License-Identifier: Apache-2.0 */ #define LOG_MODULE_NAME dwmac_plat #define LOG_LEVEL CONFIG_ETHERNET_LOG_LEVEL #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(LOG_MODULE_NAME); #define DT_DRV_COMPAT snps_designware_ether...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Driver for Synopsys DesignWare MAC * * C<|fim_suffix|>ine MAC_AN_ADVERT 0x00e8 #define MAC_AN_ADVERT_NP BIT(15) #define MAC_AN_ADVERT_RFE GENMASK(13, 12) #define MAC_AN_ADVERT_PSE GENMASK(8, 7) #define MAC_AN_ADVERT_HD BIT(6) #define MAC_AN_ADVERT_FD BIT(5) /* 17.1.47 */ #define MA...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> DEVICE_DT_INST_GET(0), 0); irq_enable(DT_INST_IRQN(0)); /* retrieve MAC address */ ret = net_eth_mac_load(&mac_cfg, p->mac_addr); if (ret == -ENODATA) { uint8_t unique_device_ID_12_bytes[12]; uint32_t result_mac_32_bits; /** * Set MAC address locally administered bit (LAA) as this is not a...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>dev, RCTL, RCTL_EN | RCTL_MPE | DT_INST_PROP(inst, rdmts) << RDMTS_OFFSET); \ iow32(dev, ITR, DT_INST_PROP(inst, itr) & (uint32_t)GENMASK(15, 0)); \ } \ \ static const struct e1000_config config_##inst = { \ .config_func = e1000_config_##inst, \ }; \ \ ETH_NET_DE...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2018 Intel Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ETH_E1000_PRIV_H #define ETH_E1000_PRIV_H #ifdef __cplusplus extern "C" { #endif #define CTRL_SLU (1 << 6) /* Set Link Up */ #define TCTL_EN (1 << 1) #define RCTL_EN (1 << 1) #define ICR_TXDW (1) ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> \ \ ETH_NET_DEVICE_DT_INST_DEFINE(inst, eth_enc28j60_init, NULL, &eth_enc28j60_runtime_##inst, \ &eth_enc28j60_config_##inst, CONFIG_ETH_IN...
fim
zephyrproject-rtos/zephyr
c
/* ENC28J60 Stand-alone Ethernet Controller with SPI * * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/kernel.h> #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/spi.h> #ifndef _ENC28J60_ #define _ENC28J60_ /* Any Bank Registers */ #define ENC28J60_REG...
fim
zephyrproject-rtos/zephyr
c
/* ENC424J600 Stand-alone Ethernet Controller with SPI * * Copyright (c) 2016 Intel Corporation * Copyright (c) 2019 PHYTEC Messtechnik GmbH * Copyright (c) 2021 Laird Connectivity * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT microchip_enc424j600 #include <zephyr/kernel.h> #include <zephyr/...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>600_EIE_TXABTIE BIT(2) #define ENC424J600_EIE_RXABTIE BIT(1) #define ENC424J600_EIE_PCFULIE BIT(0) #define ENC424J600_ECON1_PKTDEC BIT(8) #define ENC424J600_ECON1_TXRTS BIT(1) #define ENC424J600_ECON1_RXEN BIT(0) #define ENC424J600_ECON2_ETHEN BIT(15) #define ENC424J600_ECON2_STRCH BIT(1...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>f pointers */ for (int i = 0; i < CONFIG_ETH_ESP32_DMA_RX_BUFFER_NUM; i++) { dev_data->dma_rx_buf[i] = dev_data->dma->rx_buf[i]; } for (int i = 0; i < CONFIG_ETH_ESP32_DMA_TX_BUFFER_NUM; i++) { dev_data->dma_tx_buf[i] = dev_data->dma->tx_buf[i]; } /* Initialize HAL context */ emac_hal_init(&dev...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2022 Grant Ramsay <grant.ramsay@hotmail.com> * Copyright (c) 2026 Espressif Systems (Shanghai) Co., Ltd. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_ETHERNET_ETH_ESP32_PRIV_H_ #define ZEPHYR_DRIVERS_ETHERNET_ETH_ESP32_PRIV_H_ #include <zephyr/drivers/pinctrl...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2019 Interay Solutions B.V. * Copyright (c) 2019 Oane Kingma * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT silabs_gecko_ethernet /* Silicon Labs EFM32 Giant Gecko 11 Ethernet driver. * Limitations: * - no link monitoring through PHY interrupt */ #include <z...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2019 Interay Solutions B.V. * Copyright (c) 2019 Oane Kingma * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_ETHERNET_ETH_GECKO_PRIV_H_ #define ZEPHYR_DRIVERS_ETHERNET_ETH_GECKO_PRIV_H_ #include <zephyr/kernel.h> #include <zephyr/types.h> #define ETH_GECKO_MTU ...
fim
zephyrproject-rtos/zephyr
c