text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|> \ .ppp = &MODEM_CELLULAR_INST_NAME(ppp, inst), \ }; \ \ MODEM_CELLULAR_DE...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2026 Embeint Inc * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/modem/modem_cellular.h> #define DT_DRV_COMPAT simcom_a76xx MODEM_CELLULAR_COMMON_CHAT_MATCHES(); MODEM_CHAT_MATCHES_DEFINE(simcom_a76xx_unsol, MODEM_CELLULAR_COMMON_UNSOL_MATCHES); MODEM_CHAT_S...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>m_sim7080_unsol), }, /* clang-format on */ .power_pulse_duration_ms = 1500, .reset_pulse_duration_ms = 100, .startup_time_ms = 10000, .shutdown_time_ms = 5000, }; #define MODEM_CELLULAR_DEVICE_SIMCOM_SIM7080(inst) \ MODEM_DT_INST_PPP_DEFINE(inst, MOD...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>tches, modem_cellular_chat_callback_handler, 15); MODEM_CHAT_SCRIPT_CMDS_DEFINE(sqn_gm02s_periodic_chat_script_cmds, MODEM_CHAT_SCRIPT_CMD_RESP("AT+CEREG?", ok_match)); MODEM_CHAT_SCRIPT_DEFINE(sqn_gm02s_periodic_chat_script, sqn_gm02s_periodic_chat_script_cmds, abort_matches, modem_cellula...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>EM_CELLULAR_COMMON_UNSOL_MATCHES); MODEM_CHAT_SCRIPT_CMDS_DEFINE( swir_hl7800_init_chat_script_cmds, MODEM_CHAT_SCRIPT_CMD_RESP_NONE("AT", 1000), MODEM_CHAT_SCRIPT_CMD_RESP_NONE("AT", 1000), MODEM_CHAT_SCRIPT_CMD_RESP_NONE("AT", 1000), MODEM_CHAT_SCRIPT_CMD_RESP_NONE("AT", 1000), /* Turn off sleep mo...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2026 Embeint Inc * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/modem/modem_cellular.h> #define DT_DRV_COMPAT telit_le910c1tx MODEM_CELLULAR_COMMON_CHAT_MATCHES(); MODEM_CHAT_MATCHES_DEFINE(telit_le910c1tx_unsol, MODEM_CELLULAR_COMMON_UNSOL_MATCHES); MODEM_...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2026 Embeint Inc * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/modem/modem_cellular.h> #define DT_DRV_COMPAT telit_lex10q1 MODEM_CELLULAR_COMMON_CHAT_MATCHES(); MODEM_CHAT_SCRIPT_CMDS_DEFINE( telit_lex10q1_init_chat_script_cmds, MODEM_CHAT_SCRIPT_CMD_RESP_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>config telit_me910g1_vendor = { /* clang-format off */ .scripts = { .init = &telit_mex10g1_init_chat_script, .dial = &telit_mex10g1_dial_chat_script, .periodic = &telit_mex10g1_periodic_chat_script, }, .unsol_matches = { .matches = telit_mex10g1_unsol, .size = ARRAY_SIZE(telit_mex10g1_unsol)...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2026 Embeint Inc * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/modem/modem_cellular.h> #define DT_DRV_COMPAT trasna_lexi_r10 MODEM_CELLULAR_COMMON_CHAT_MATCHES(); MODEM_CHAT_MATCHES_DEFINE(trasna_lexi_r10_unsol, MODEM_CELLULAR_COMMON_UNSOL_MATCHES); MODEM_CHAT_SCRIPT_CM...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2026 Embeint Inc * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/modem/modem_cellular.h> #define DT_DRV_COMPAT u_blox_lara_r6 MODEM_CELLULAR_COMMON_CHAT_MATCHES(); MODEM_CHAT_MATCHES_DEFINE(u_blox_lara_r6_unsol, MODEM_CELLULAR_COMMON_UNSOL_MATCHES); MODEM_CH...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2026 Embeint Inc * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/modem/modem_cellular.h> #define DT_DRV_COMPAT u_blox_sara_r4 MODEM_CELLULAR_COMMON_CHAT_MATCHES(); MODEM_CHAT_MATCHES_DEFINE(u_blox_sara_r4_unsol, MODEM_CELLULAR_COMMON_UNSOL_MATCHES); MODEM_CH...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>0, .force_autostart = true, }; #define MODEM_CELLULAR_DEVICE_U_BLOX_SARA_R5(inst) \ MODEM_DT_INST_PPP_DEFINE(inst, MODEM_CELLULAR_INST_NAME(ppp, inst), NULL, 98, 1500, 64); \ ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>@param dev Pointer to the device structure. * @param hard_reset Boolean indicating if a hard reset is required. * @return int 0 on success, negative errno code on failure. * Should be used internally to handle DNS resolution events. */ int dns_work_cb(const struct device *dev, bool hard_reset); /** ...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2025 Netfeasa Ltd. * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/kernel.h> #include <zephyr/logging/log.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include "hl78xx.h" #include "hl78xx_chat.h" #ifdef CONFIG_HL78XX_GNSS #inc...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> 1); } ret = modem_chat_match_set_match(&at_shell_script_chat_matches[1], at_shell_match_buf); if (ret < 0) { return -EINVAL; } at_shell_active_shell = sh; ret = modem_chat_run_script_async(at_shell_chat, &at_shell_script); if (ret < 0) { shell_error(sh, "failed to start script"); atomic_clea...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>EDRX_IDLE_TIMEOUT, cmd_timeout_s); k_work_reschedule(&data->hl78xx_edrx_idle_work, K_SECONDS(total_timeout_s)); return 0; } int hl78xx_is_edrx_idle_scheduled(struct hl78xx_data *data) { return k_work_delayable_is_pending(&data->hl78xx_edrx_idle_work); } int hl78xx_edrx_idle_cancel(struct hl78xx_data ...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2025 Netfeasa Ltd. * * SPDX-License-Identifier: Apache-2.0 */ /* * hl78xx_cfg.h * * Helper APIs for RAT, band and APN configuration extracted from hl78xx.c * to keep the state machine file smaller and easier to read. */ #ifndef ZEPHYR_DRIVERS_MODEM_HL78XX_HL78XX_CFG_H_ #define ZEPHYR_DRIVER...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Netfeasa Ltd. * * SPDX-License-Identifier: Apache-2.0 */ /* ***************************************************************************** * hl78xx_chat.c * * Centralized translation unit for MODEM_CHAT_* macro-generated objects and * chat scripts for the HL78xx driver. Th...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ta); int hl78xx_run_gnss_stop_search_chat_script(struct hl78xx_data *data); int hl78xx_run_gnss_terminate_nmea_chat_script(struct hl78xx_data *data); int hl78xx_run_gnss_gnssloc_script(struct hl78xx_data *data); int hl78xx_run_rrc_query_script_async(struct hl78xx_data *data); #endif /* CONFIG_HL78XX_GNSS ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> /* Register an event monitor */ int hl78xx_evt_monitor_register(struct hl78xx_evt_monitor_entry *mon) { k_spinlock_key_t key = k_spin_lock(&monitor_list_lock); mon->next = monitor_list_head; monitor_list_head = mon; k_spin_unlock(&monitor_list_lock, key); return 0; } /* Unregister an event monito...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> false; LOG_INF("Stopping GNSS search before exiting mode..."); hl78xx_delegate_event(data, MODEM_HL78XX_EVENT_GNSS_STOP_REQUESTED); } else { /* No search in progress, exit immediately */ gnss_evt.type = HL78XX_GNSS_EVENT_MODE_EXITED; gnss_evt.content.status = true; event_dispatcher_di...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2025 Netfeasa Ltd. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_MODEM_HL78XX_HL78XX_GNSS_H_ #define ZEPHYR_DRIVERS_MODEM_HL78XX_HL78XX_GNSS_H_ #include <zephyr/types.h> #include <zephyr/drivers/gnss.h> #include <zephyr/drivers/gnss/gnss_publish.h> #include "../../../gnss/...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Netfeasa Ltd. * * SPDX-License-Identifier: Apache-2.0 */ /** * @file hl78xx_gnss_parsers.c * * @brief Supplementary NMEA0183 parsers for HL78xx GNSS driver * * This file contains parsers for supplementary NMEA0183 sentences that are not * part of the standard Zephyr GNSS...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Netfeasa Ltd. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_MODEM_HL78XX_HL78XX_GNSS_PARSERS_H_ #define ZEPHYR_DRIVERS_MODEM_HL78XX_HL78XX_GNSS_PARSERS_H_ #include <zephyr/modem/chat.h> #include <zephyr/types.h> #include <zephyr/drivers/gnss.h> #include <z...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>t hl78xx_variant_ops hl78xx_variant_ops_hl7800 = { .socket_lpm_recreate_required = true, .cfg_select_rat = hl78xx_hl7800_cfg_select_rat, .cfg_apply_rat_post_select = hl78xx_hl7800_cfg_apply_rat_post_select, .cfg_skip_band_for_rat = hl78xx_hl7800_cfg_skip_band_for_rat, .on_kstatev_urc = NULL, /* HL780...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> .user_cmd = false, }); } return 0; #endif /* CONFIG_MODEM_HL78XX_EDRX */ return 0; } static bool hl78xx_hl7812_await_registered_timeout_lpm(struct hl78xx_data *data) { #ifdef CONFIG_MODEM_HL78XX_EDRX /* HL7812: avoid depending on GPIO6-derived eDRX previous/current state. * During wa...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 Netfeasa Ltd. * * SPDX-License-Identifier: Apache-2.0 */ #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L /* Required for strnlen() */ #include <string.h> #include <stdlib.h> #include <stddef.h> #include <zephyr/modem/chat.h> #include <zephyr/modem/backend/uart.h> #incl...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2020 Analog Life LLC * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT quectel_bg9x #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(modem_quectel_bg9x, CONFIG_MODEM_LOG_LEVEL); #include "quectel-bg9x.h" static struct k_thread modem_rx_thread; static struct k_work_q ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>r *recv_addr; uint16_t recv_read_len; }; #endif /* QUECTEL_BG9X_H */ <|fim_prefix|>/* * Copyright (c) 2020 Analog Life LLC * * SPDX-License-Identifier: Apache-2.0 */ #ifndef QUECTEL_BG9X_H #define QUECTEL_BG9X_H #include <zephyr/kernel.h> #include <ctype.h> #include <errno.h> #include <zephyr/dri...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (C) 2021 metraTec GmbH * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT simcom_sim7080 #include <zephyr/logging/log.h> #include <zephyr/net/offloaded_netdev.h> LOG_MODULE_REGISTER(modem_simcom_sim7080, CONFIG_MODEM_LOG_LEVEL); #include <zephyr/drivers/modem/simcom-sim...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (C) 2021 metraTec GmbH * * SPDX-License-Identifier: Apache-2.0 */ #ifndef SIMCOM_SIM7080_H #define SIMCOM_SIM7080_H #include <zephyr/kernel.h> #include <ctype.h> #include <inttypes.h> #include <errno.h> #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/modem/simcom-sim7080.h> ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ut we failed net_addr_pton */ if (hints && hints->ai_flags & ZSOCK_AI_NUMERICHOST) { return DNS_EAI_NONAME; } ret = snprintk(sendbuf, sizeof(sendbuf), "AT+CDNSGIP=\"%s\",%u,%u", node, mdata.dns.recount, mdata.dns.timeout); if (ret < 0) { LOG_ERR("Formatting dns query failed"); return ret; ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (C) 2025 Metratec GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(modem_sim7080_ftp, CONFIG_MODEM_LOG_LEVEL); #include "sim7080.h" /** * Parse the +FTPGET response. * * +FTPGET: <mode>,<len> * * Mode is hard set to 2. * * Len...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>1); ret = gnss_split_on_dot(lat, &number, &fraction); if (ret != 0) { goto error; } gnss_data.lat = number * 10000000 + fraction * 10; ret = gnss_split_on_dot(lon, &number, &fraction); if (ret != 0) { goto error; } gnss_data.lon = number * 10000000 + fraction * 10; if (alt) { ret = gnss_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>er Mode", }; /** * Check lookup table for match. * @param s 0 terminated source string. * @param lut The lookup table. * @param size Size of the lookup table. * @return Index in the lookup table or -1 on no match. */ static int8_t lut_match(const uint8_t *s, const uint8_t **lut, uint8_t size) { fo...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (C) 2025 metraTec GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> #include <zephyr/net/offloaded_netdev.h> LOG_MODULE_REGISTER(modem_simcom_sim7080_pdp, CONFIG_MODEM_LOG_LEVEL); #include "sim7080.h" static const struct setup_cmd band_setup_cmds[] = { #...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (C) 2025 Metratec GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> #include <zephyr/net/offloaded_netdev.h> LOG_MODULE_REGISTER(modem_sim7080_sms, CONFIG_MODEM_LOG_LEVEL); #include "sim7080.h" #define SMS_TP_UDHI_HEADER 0x40 /** * Decode readable hex to "real" hex....
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (C) 2025 metraTec GmbH * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT simcom_sim7080 #include <zephyr/logging/log.h> #include <zephyr/net/offloaded_netdev.h> LOG_MODULE_REGISTER(modem_simcom_sim7080_sock, CONFIG_MODEM_LOG_LEVEL); #include <zephyr/drivers/modem/simco...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (C) 2026 Metratec GmbH * * SPDX-License-Identifier: Apache-2.0 */ #include <inttypes.h> #include <string.h> #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(modem_simcom_sim7080_tls, CONFIG_MODEM_LOG_LEVEL); #include <zephyr/drivers/modem/simcom-sim7080.h> #include "sim7080.h" en...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> = strtok_r(time_str, ":", &saveptr); if (tmp == NULL) { LOG_WRN("Failed to parse hour"); goto out; } t->tm_hour = (int)strtol(tmp, NULL, 10); tmp = strtok_r(NULL, ":", &saveptr); if (tmp == NULL) { LOG_WRN("Failed to parse minute"); goto out; } t->tm_min = (int)strtol(tmp, NULL, 10); ...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT st_st87mxx #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <stdio.h> #include "st87mxx.h" #include <zephyr/logging/log.h> #include <zephyr/random/random.h> #include <zephyr/net/offloade...
fim
zephyrproject-rtos/zephyr
c
/* Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ #ifndef STM87MXX_H #define STM87MXX_H #include <stdint.h> #include <zephyr/types.h> #include <stdbool.h> #include <zephyr/net_buf.h> #include <zephyr/net/net_ip.h> #include <zephyr/net/net_context.h> #include <zephyr/drivers/modem/...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2019-2020 Foundries.io * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT u_blox_sara_r4 #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(modem_ublox_sara_r4, CONFIG_MODEM_LOG_LEVEL); #include <zephyr/kernel.h> #include <ctype.h> #include <errno.h> #include <zeph...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2018 Foundries.io * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT wnc_m14a2a #define LOG_DOMAIN modem_wncm14a2a #define LOG_LEVEL CONFIG_MODEM_LOG_LEVEL #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(LOG_DOMAIN); #include <zephyr/types.h> #include <stddef.h>...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> \ mspi_timing_cfg *timing = (mspi_timing_cfg *)cfg; \ timing->ui8TurnAround; \ } #define TIMING_CFG_SET_RX_DUMMY(cfg, num) \ { ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024~2025, Ambiq Micro Inc. <www.ambiq.com> * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT ambiq_mspi_controller #include <zephyr/logging/log.h> #include <zephyr/logging/log_instance.h> LOG_LEVEL_SET(CONFIG_MSPI_LOG_LEVEL); #include <zephyr/kernel.h> #include <ze...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> are the same if the first one has not finished yet. */ if (cfg_flag) { if (cfg_flag == 1) { ret = mspi_xfer_config(controller, xfer); if (ret) { goto dma_err; } } else { ret = cfg_flag; goto dma_err; } } ret = am_hal_mspi_interrupt_enable(data->mspiHandle, AM_HAL_MSPI_INT_D...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025, Ambiq Micro Inc. <www.ambiq.com> * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/mspi.h> #include <zephyr/cache.h> #include <zephyr/drivers/flash.h> #define LOG_LEVEL CONFIG_MSPI_LOG_LEVEL #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(mspi_ambiq_tim...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024 Nordic Semiconductor ASA * Copyright (c) 2025 Tenstorrent AI ULC * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT snps_designware_ssi #include <zephyr/drivers/mspi.h> #include <zephyr/drivers/gpio.h> #if defined(CONFIG_PINCTRL) #include <zephyr/drivers/pinctr...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024 Nordic Semiconductor ASA * Copyright (c) 2025 Tenstorrent AI ULC * * SPDX-License-Identifier: Apache-2.0 */ #if DT_HAS_COMPAT_STATUS_OKAY(snps_designware_ssi_v2) /* * Later versions of the SSI have different register offsets. Define a macro * to use these. */ #define SSI_V...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024 Nordic Semiconductor ASA * Copyright (c) 2025 Tenstorrent AI ULC * * SPDX-License-Identifier: Apache-2.0 */ /* * This header is part of mspi_dw.c extracted only for clarity. * It is not supposed to be included by any file other than mspi_dw.c. */<|fim_suffix|>AIN_DATA); ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2024, Ambiq Micro Inc. <www.ambiq.com> * * SPDX-License-Identifier: Apache-2.0 * * This driver creates fake MSPI buses which can contain emulated devices, * implemented by separate emulation drivers. * The API between this driver and its emulators is defined by * struct mspi_emu...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 EXALT Technologies. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_MSPI_MSPI_NOR_H_ #define ZEPHYR_DRIVERS_MSPI_MSPI_NOR_H_ /* Flash opcodes */ #define MSPI_NOR_CMD_WRSR 0x01 /* Write status register */ #define MSPI_NOR_CMD_RDSR 0x05 /...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>*/ struct mspi_stm32_data { union mspi_stm32_handle hmspi; uint32_t memmap_base_addr; struct mspi_stm32_context ctx; const struct mspi_dev_id *dev_id; struct k_mutex lock; struct k_sem sync; struct mspi_dev_cfg dev_cfg; struct mspi_xip_cfg xip_cfg; struct stm32_stream dma_tx; struct stm32_stream...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>DMA_SRC_DATAWIDTH_WORD LL_DMA_SRC_DATAWIDTH_WORD #else #define MSPI_DMA_SRC_DATAWIDTH_WORD LL_DMA_MDATAALIGN_WORD #endif #if defined(LL_DMA_DEST_DATAWIDTH_BYTE) #define MSPI_DMA_DEST_DATAWIDTH_BYTE LL_DMA_DEST_DATAWIDTH_BYTE #else #define MSPI_DMA_DEST_DATAWIDTH_BYTE LL_DMA_PDATAALIGN_BYTE #endif #if de...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ig->turnaround_cycles != 0) { /* Required for PSRAM where tx_dummy = total latency (WLC), * while STM32 XSPI expects dummy cycles excluding turnaround. */ dev_data->dev_cfg.tx_dummy = dev_data->dev_cfg.tx_dummy - config->turnaround_cycles; } return 0; } #endif /* defined(CONFIG_MSPI_TIMING) *...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>32_FIFO_THRESHOLD, \ .SampleShifting = (DT_INST_PROP(index, st_ssht_enable) \ ? QSPI_SAMPLE_SHIFTING_HALFCYCLE \ : QSPI_SAMPLE_SHIFTING_NONE), \ .FlashSize = 0x19, \ .ChipSelectHig...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025 EXALT Technologies. * * SPDX-License-Identifier: Apache-2.0 */ /* * * MSPI flash controller driver for stm32 series with multi-SPI peripherals * This driver is based on the stm32Cube HAL XSPI driver * */ #define DT_DRV_COMPAT st_stm32_xspi_controller #include <zephyr/dr...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>hyr_canbus)) }; NET_DEVICE_INIT(net_canbus, "NET_CANBUS", net_canbus_init, NULL, &net_canbus_ctx, &net_canbus_cfg, CONFIG_NET_CANBUS_INIT_PRIORITY, &net_canbus_api, CANBUS_RAW_L2, NET_L2_GET_CTX_TYPE(CANBUS_RAW_L2), CAN_MTU); <|fim_prefix|>/* * Copyright (c) 2022 Vestas Wind Systems A/S * Copyright...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> loopback_init, .send = loopback_send, }; NET_DEVICE_INIT(loopback, "lo", loopback_dev_init, NULL, NULL, NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &loopback_api, DUMMY_L2, NET_L2_GET_CTX_TYPE(DUMMY_L2), CONFIG_NET_LOOPBACK_MTU); <|fim_prefix|>/* * Copyright (c) 2015 Intel Corporation * Copyr...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/** * Copyright (c) 2023-2024 Marcin Niestroj * * SPDX-License-Identifier: Apache-2.0 */ #ifndef __DRIVERS_NET_NSOS_H__ #define __DRIVERS_NET_NSOS_H__ #include <stddef.h> #include <stdint.h> /* Protocol families. */ #define NSOS_MID_PF_UNSPEC 0 /**< Unspecified protocol family. */ #...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>RRAY_SIZE(events), 0); if (ret < 0) { if (errno == EINTR) { nsi_print_warning("interrupted epoll_wait()\n"); nsos_adapt_poll_time = nsi_hws_get_time() + 1; return; } nsi_print_error_and_exit("error in nsos_adapt poll(): errno=%d\n", errno); nsos_adapt_poll_time = NSI_NEVER; return; ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> if (flags & ai_flags_map[i].flag) { *flags_mid |= ai_flags_map[i].mid_flag; flags &= ~ai_flags_map[i].flag; } } if (flags) { return -NSI_ERRNO_MID_EINVAL; } return 0; } int addrinfo_flags_from_nsos_mid(int flags_mid, int *flags) { *flags = 0; for (int i = 0; i < ARRAY_SIZE(ai_flags_...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>fine NSOS_MID_AI_PASSIVE 0x1 #define NSOS_MID_AI_CANONNAME 0x2 #define NSOS_MID_AI_NUMERICHOST 0x4 #define NSOS_MID_AI_V4MAPPED 0x8 #define NSOS_MID_AI_ALL 0x10 #define NSOS_MID_AI_ADDRCONFIG 0x20 #define NSOS_MID_AI_NUMERICSERV 0x400 int eai_to_nsos_mid(int err); int eai_from_nsos_mid(...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ed, for compatibility) */ #define NSOS_MID_SO_SNDLOWAT 19 /** * Receive timeout * Applies to receive functions like recv(), but not to connect() */ #define NSOS_MID_SO_RCVTIMEO 20 /** Send timeout */ #define NSOS_MID_SO_SNDTIMEO 21 /** Bind a socket to an interface */ #define NSOS_MID_SO_BINDTODEVICE...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/** * Copyright (c) 2023-2024 Marcin Niestroj * * SPDX-License-Identifier: Apache-2.0 */ /** * @file * * Zephyr (top) side of NSOS (Native Simulator Offloaded Sockets). */ #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(nsos_sockets); ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>ue; } } } memset(ppp->buf, 0, sizeof(ppp->buf)); /* * Set the point-to-point interface flag. This is needed at least for IPv6 neighbor * discovery to handle packets correctly. */ net_if_flag_set(iface, NET_IF_POINTOPOINT); #if defined(CONFIG_PPP_NET_IF_NO_AUTO_START) /* * If interface...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> K_NO_WAIT); if (!slip->rx) { LOG_ERR("[%p] cannot allocate pkt", slip); return 0; } slip->last = net_pkt_get_frag(slip->rx, SLIP_FRAG_LEN, K_NO_WAIT); if (!slip->last) { LOG_ERR("[%p] cannot allocate 1st data buffer", slip); net_pkt_unref(slip->rx); s...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2016 Intel Corporation * Copyright (c) 2023 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ #include <stdbool.h> #include <zephyr/device.h> #include <zephyr/net_buf.h> #include <zephyr/net/net_pkt.h> #include <zephyr/net/net_if.h> #if defined(CONFIG_SLIP_TAP) #define _SLIP...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * SPDX-FileCopyrightText: <text>Copyright (c) 2026 Infineon Technologies AG, * or an affiliate of Infineon Technologies AG. All rights reserved.</text> * * SPDX-License-Identifier: Apache-2.0 */ /** * @brief Opamp driver for Infineon AutAnalog CTB. * * Each instance represents one of the two o...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright 2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ #include <fsl_opamp.h> #include <zephyr/drivers/opamp.h> #include <zephyr/pm/device.h> #if defined(CONFIG_SOC_FAMILY_LPC) #include <zephyr/drivers/reset.h> #endif #include <zephyr/drivers/clock_control.h> #include <zephyr/logging/log...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright 2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ #include <fsl_opamp.h> #include <zephyr/drivers/opamp.h> #include <zephyr/pm/device.h> #include <zephyr/drivers/clock_control.h> #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(nxp_opamp_fast, CONFIG_OPAMP_LOG_LEVEL); #define DT...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> }; \ \ PM_DEVICE_DT_INST_DEFINE(inst, stm32_opamp_pm_callback); \ ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2025-2026 MASSDRIVER EI (massdriver.space) * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT bflb_efuse #include <zephyr/drivers/otp.h> #include <zephyr/kernel.h> #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(efuse_bflb, CONFIG_OTP_LOG_LEVEL); #include <bflb...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>bytes_left == 0) { break; } } otp_bsec_stm32_unlock(); return 0; } static const struct bsec_stm32_config bsec_config = { .base = (void *)DT_INST_REG_ADDR(0), .upper_fuse_limit = DT_INST_PROP(0, st_upper_fuse_limit), }; static DEVICE_API(otp, otp_bsec_stm32_api) = { #if defined(CONFIG_OTP_PRO...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|> \ DEVICE_DT_INST_DEFINE(n, NULL, NULL, &otp_emul_mem_##n, &otp_emul_##n##_config, \ PRE_KERNEL_1, CONFIG_OTP_INIT_PRIORITY, &otp_emul_api); DT_INST_FOREACH_STATUS_OKAY(OTP_EMU_INIT) <|fim_prefix|>/* * Copyright (c) 2025 STMicroelectronics * SPDX-License-Identifier: Apache-2.0 */ ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2026 Basalte bv * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/sys/minmax.h> #include <zephyr/kernel.h> #include <zephyr/drivers/clock_control.h> #include <zephyr/drivers/otp.h> #include <zephyr/logging/log.h> #include "fsl_ocotp.h" #define DT_DRV_COMPAT nxp_ocotp LOG_...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * SPDX-FileCopyrightText: Copyright (c) 2026 STMicroelectronics * SPDX-License-Identifier: Apache-2.0 * * Driver for one-time programmable areas inside STM32 embedded NVM. * * "OTP for user data" area programming is not supported yet. * It shall be implemented as a dedicated, externally visible ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>aded into shadow registers */ if (!(base->HW_OCOTP_STATUS & OCOTP_HW_OCOTP_STATUS_FUSE_LATCHED_MASK)) { LOG_ERR("OTP fuses not latched into shadow registers"); return -EIO; } return 0; } #define NXP_OCOTP_INIT(inst) \ static struct nxp_ocotp_data nxp_ocotp_##inst##_data; \ \...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>"); return -EINVAL; } if (len > sizeof(wr_buf)) { shell_error(sh, "Write buffer size (%zu bytes) exceeded", sizeof(wr_buf)); return -EINVAL; } for (size_t i = 0; i < len; i++) { byte = shell_strtoul(argv[ARG_PROG_BUF + i], 0, &err); if (byte > UINT8_MAX || err < 0) { shell_error(sh, "Er...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>t; k_mutex_init(&data->lock); data->cached = false; /* Pre-load cache at initialization for better read performance */ ret = efuse_load_cache(dev); if (ret < 0) { LOG_WRN("Failed to pre-load eFuse cache: %d", ret); /* Non-fatal: cache will be loaded on first read */ } LOG_INF("SiFli eFuse OT...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2024 Junho Lee <junho@tsnlab.com> * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(pcie_brcmstb, LOG_LEVEL_ERR); #include <zephyr/arch/common/sys_bitops.h> #include <zephyr/arch/cpu.h> #include <zephyr/device.h> #include <zephyr/kernel.h> #include <...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2021 BayLibre, SAS * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(pcie_ecam, LOG_LEVEL_ERR); #include <zephyr/kernel.h> #include <zephyr/device.h> #include <zephyr/drivers/pcie/pcie.h> #include <zephyr/drivers/pcie/controller.h> #ifd...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>_mem_type); /* Check if outbound memory mapping succeeded */ if (mapped_size < 0) { return mapped_size; } ret = pcie_ep_dma_xfer(dev, mapped_addr, (uintptr_t)local_addr, mapped_size, dir); /* Check if dma succeeded */ if (ret < 0) { goto out_unmap; } /* Flush the PCIe writes upon s...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright 2020 Broadcom * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/dma.h> #include <zephyr/drivers/pcie/endpoint/pcie_ep.h> #define LOG_LEVEL CONFIG_PCIE_EP_LOG_LEVEL #include <zephyr/logging/log.h> #include <zephyr/irq.h> LOG_MODULE_REGISTER(iproc_pcie); #include "pcie_ep_iproc.h" ...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright 2020 Broadcom * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_INCLUDE_DRIVERS_PCIE_EP_IPROC_H_ #define ZEPHYR_INCLUDE_DRIVERS_PCIE_EP_IPROC_H_ #include <soc.h> #include <zephyr/sys/util.h> #include "pcie_ep_iproc_regs.h" #define PCIE_LINK_STATUS_CONTROL 0xbc #define PCIE_L...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright 2020 Broadcom * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/pcie/endpoint/pcie_ep.h> #include <zephyr/logging/log.h> #include "pcie_ep_iproc.h" LOG_MODULE_DECLARE(iproc_pcie, CONFIG_PCIE_EP_LOG_LEVEL); /* Helper macro to read 64-bit data using two 32-bit data r...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>le_in_pcie_link_down; uint32_t paxb_reserved_23[1]; uint32_t paxb_paxb_tx_debug_cfg; uint32_t paxb_paxb_misc_config; uint32_t paxb_reserved_24[2]; uint32_t paxb_paxb_intr_en; uint32_t paxb_paxb_intr_clear; uint32_t paxb_paxb_intr_status; uint32_t paxb_reserved_25[1]; uint32_t paxb_apb_err_en_for_...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2021 BayLibre, SAS * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(pcie_core, LOG_LEVEL_INF); #include <zephyr/kernel.h> #include <zephyr/drivers/pcie/pcie.h> #include <zephyr/drivers/pcie/controller.h> #if CONFIG_PCIE_MSI #include <...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2019 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/kernel.h> #include <zephyr/drivers/pcie/msi.h> #<|fim_suffix|> mcr |= PCIE_MSIX_MCR_EN; pcie_conf_write(bdf, base + PCIE_MSIX_MCR, mcr); } #else #define enable_msix(...) #endif /* CONFIG_PCIE_MSI_X...
fim
zephyrproject-rtos/zephyr
c
/* * Copyright (c) 2019 Intel Corporation * Copyright (c) 2020 acontis technologies GmbH * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT pcie_controller #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(pcie, LOG_LEVEL_ERR); #include <zephyr/init.h> #include <zephyr/kernel.h> #include <zephyr...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2021 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #define LOG_LEVEL CONFIG_PCIE_LOG_LEVEL #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(pcie); #include <errno.h> #include <zephyr/kernel.h> #include <soc.h> #include <zephyr/device.h> #include <zephyr/init.h>...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2021 Intel Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #ifndef ZEPHYR_DRIVERS_PCIE_HOST_PTM_H_ #define ZEPHYR_DRIVERS_PCIE_HOST_PTM_H_ #include <zephyr/drivers/pcie/pcie.h> #include <<|fim_suffix|>pcie/cap.h> #define PTM_CAP_REG_OFFSET 0x04U union ptm_cap_reg { stru...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>O_BUS(bdf), PCIE_BDF_TO_DEV(bdf), PCIE_BDF_TO_FUNC(bdf), PCIE_ID_TO_VEND(data), PCIE_ID_TO_DEV(data)); data = pcie_conf_read(bdf, PCIE_CONF_CLASSREV); shell_fprintf(sh, SHELL_NORMAL, "class %x subclass %x prog i/f %x rev %x", PCIE_CONF_CLASSREV_CLASS(data), ...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>rn 0; } int pcie_vc_enable(pcie_bdf_t bdf) { struct pcie_vc_regs regs; struct pcie_vc_resource_regs res_regs[PCIE_VC_MAX_COUNT]; int idx; if (get_vc_registers(bdf, &regs, res_regs) != 0) { return -ENOTSUP; } /* We do not touch VC0: it is always on */ for (idx = 1; idx < regs.cap_reg_1.vc_coun...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>; uint32_t raw; } ctrl_reg; union { struct { uint32_t _reserved1 : 16; /** Port Arbitration Table Status */ uint32_t pa_table_status : 1; /** Virtual Channel Negotiation Pending */ uint32_t vc_negocation_pending : 1; uint32_t _reserved2 : 14; }; uin...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2026 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT intel_espi_peci #include <stdlib.h> #include <zephyr/device.h> #include <zephyr/devicetree.h> #include <zephyr/drivers/espi.h> #include <zephyr/drivers/peci.h> #include <zephyr/logging/log.h> #...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>*sh, size_t argc, char **argv) { const struct device *dev; struct peci_msg msg; uint8_t ping_resp[2]; char *e; int ret; dev = shell_device_get_binding(argv[ARGV_DEV]); if (!dev) { shell_error(sh, "ESPI_PECI: Device driver %s not found.", argv[ARGV_DEV]); return -ENODEV; } msg.oob_addr = strt...
fim
zephyrproject-rtos/zephyr
c
<|fim_suffix|>sizeof(*msg))); return z_impl_peci_transfer(dev, &msg_copy); } #include <zephyr/syscalls/peci_transfer_mrsh.c> <|fim_prefix|>/* * Copyright (c) 2020 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/drivers/peci.h> #include <zephyr/internal/syscall_handler.h> static in...
fim
zephyrproject-rtos/zephyr
c
<|fim_prefix|>/* * Copyright (c) 2022 ITE Corporation. All Rights Reserved. * * SPDX-License-Identifier: Apache-2.0 */ #define DT_DRV_COMPAT ite_it8xxx2_peci #include <zephyr/drivers/gpio.h> #include <zephyr/drivers/pinctrl.h> #include <zephyr/drivers/peci.h> #include <zephyr/kernel.h> #include <errno.h> #include...
fim
zephyrproject-rtos/zephyr
c