text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>_DT_INST_CLOCK_INFO_BY_NAME(n, pclk), \
.aclken = STM32_DT_INST_CLOCK_INFO_BY_NAME(n, aclk), \
.reset = RESET_DT_SPEC_INST_GET(n), \
}; ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>fig_##inst = { \
.i2c = I2C_DT_SPEC_INST_GET(inst), \
.mclk_freq = DT_INST_PROP(inst, mclk_frequency)}; \
DEVICE_DT_INST_DEFINE(inst, max98091_init, NULL, NULL, &max98091_config_##inst, \
POST_KERNEL, CONFIG_AUDIO_CODEC_INIT_PRIORITY, &max98091_api);
DT_INST_FOREACH_STATUS_OKAY(MAX9... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2025 Silicon Signals Pvt. Ltd.
* Author: Rutvij Trivedi <rutvij.trivedi@siliconsignals.io>
* Author: Tarang Raval <tarang.raval@siliconsignals.io>
*/
#ifndef ZEPHYR_INCLUDE_CODEC_MAX98091_H_
#define ZEPHYR_INCLUDE_CODEC_MAX98091_H_
/*
* M... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2025 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <stdbool.h>
#include <stdint.h>
#include "mic_privacy_registers.h"
#include <zephyr/drivers/mic_privacy/intel/mic_privacy.h>
#include <zephyr/irq.h>
#include <zephyr/device.h>
#include <zep... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2025 Intel Corporation
*
* SPDX-License-Identifier: <|fim_suffix|>ST
*
* Indicates the time-out duration to wait before forcing the actual
* microphone privacy DMA data zeroing. Unit in number of RTC clocks.
* Valid and static when DDZE = 10. For DDZE = 0x or 11 case, time-ou... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>t, i2c), (PCM1681_CONFIG_I2C(inst)), \
(PCM1681_CONFIG_SPI(inst)))
#define PCM1681_DEFINE(inst) \
static const struct pcm1681_config pcm1681_##inst##_config = {PCM1681_CONFIG(inst)}; \
... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2025 Basalte bv
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_AUDIO_PCM1681_H_
#define ZEPHYR_DRIVERS_AUDIO_PCM1681_H_
#define PCM1681_N_CHANNELS 8
/* +0.5 for rounding */
#define VOL2ATT_FINE(vol) (127 * (vol) / 100 + 128 + 0.5)
#define VOL2ATT_WIDE(vol) (101 ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>_LEVEL_CLIP_N) ? 1U : 0U;
}
m->peak_n = peak;
m->clips = clips;
return 0;
}
<|fim_prefix|>/*
* SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/sys/util.h>
#inc... | fim | zephyrproject-rtos/zephyr | c |
/*
* SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief PCM level analysis: per-channel peak/clip measurement and dBFS conversion.
*/
#ifndef ZEPHYR_DRIVERS_AUDIO_PCM_LEVEL_H_
#define ZEPHYR_DRIVERS_AUDIO_PCM_LEVEL_H_
#include <stddef... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|> \
.dma_tx = SF32LB_DMA_DT_INST_SPEC_GET_BY_NAME(n, tx), \
.dma_rx = SF32LB_DMA_DT_INST_SPEC_GET_BY_NAME(n, rx), \
.clock = SF32LB_CLOCK_DT_INST_SPEC_GET(n), ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2026 Linumiz
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT ti_tas2563
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/audio/codec.h>
#include <zephyr/logging/log.h>
#include "tas2563.h"
LOG_MODULE_REGISTER(ta... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2026 Linumiz
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_AUDIO_TAS2563_REG_H_
#define ZEPHYR_DRIVERS_AUDIO_TAS2563_REG_H_
#include <zephyr/sys/util_macro.h>
/* Register Page and Book selection */
#define TAS2563_PAGE_REG 0x00
#define TAS2563_BOOK... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright (c) 2023 Centralp
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT ti_tas6422dac
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/audio/codec.h>
#include "tas6422dac.h"
#define LOG_LEVEL CONFIG_AUDIO_CODEC_LOG_LEVEL
#incl... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>AL_FAULTS_1_VBAT_OV_MASK BIT(2)
#define GLOBAL_FAULTS_1_PVDD_UV BIT(1)
#define GLOBAL_FAULTS_1_PVDD_UV_MASK BIT(1)
#define GLOBAL_FAULTS_1_VBAT_UV BIT(0)
#define GLOBAL_FAULTS_1_VBAT_UV_MASK BIT(0)
/* Global Faults 2 Register */
#define GLOBAL_FAULTS_2_ADDR 0x12
#d... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>C26_PAGE2, AIC26_P2_POWER_CTL,
AIC26_PWDNC | AIC26_ADPWDN, 0);
}
static int aic26_configure(const struct device *dev,
struct audio_codec_cfg *cfg)
{
const struct tlv320aic26_config *dev_cfg = dev->config;
struct tlv320aic26_data *data = dev->data;
struct aic26_pll_cfg pll;
bool need_dac;
b... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* SPDX-FileCopyrightText: Copyright (c) 2026 Linumiz
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_AUDIO_TLV320AIC26_H_
#define ZEPHYR_DRIVERS_AUDIO_TLV320AIC26_H_
#include <zephyr/sys/util_macro.h>
/* SPI command word */
#define AIC26_CMD_READ BIT(15)
#define AIC26_CMD_WRITE ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>control_get_rate(dev_cfg->mclk_dev, dev_cfg->mclk_name,
&cfg->mclk_freq);
if (ret < 0) {
LOG_ERR("MCLK clock source freq acquire fail: %d", ret);
}
}
LOG_DBG("MCLK %u Hz Sampling Rate: %u Hz", cfg->mclk_freq, i2s->frame_clk_freq);
/* use pll div table to get all values */
rate = i2s... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>(0)
#define HPX_ANA_VOL_DEFAULT (0)
#define HPX_ANA_VOL_MIN (127)
#define HPX_ANA_VOL_MUTE (HPX_ANA_VOL_MIN | ~HPX_ANA_VOL_ENABLE)
#define HPX_ANA_VOL_LOW_THRESH (105)
#define HPX_ANA_VOL_FLOOR (144)
#define HPL_DRV_GAIN_CTRL_ADDR (struct reg_addr){1, 40}
#define HPR_DRV_GAIN_CTRL_ADDR (struct reg_addr)... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|> LOG_INF("PCM Rate: %u Filter B PRB P10 selected",
cfg->i2s.frame_clk_freq);
} else {
proc_blk = PRB_P25_DECIMATION_A;
LOG_INF("PCM Rate: %u Filter A PRB P25 selected",
cfg->i2s.frame_clk_freq);
}
codec_write_reg(dev, PROC_BLK_SEL_ADDR, PROC_BLK_SEL(proc_blk));
}
static enum osr_multiple ... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright (c) 2019 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_DRIVERS_AUDIO_TLV320DAC310X_H_
#define ZEPHYR_DRIVERS_AUDIO_TLV320DAC310X_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Register addresses */
#define PAGE_CONTROL_ADDR 0
/* Register addresses {page, address} and ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/audio/codec.h>
#include <zephyr/devicetree/clocks.h>
#include <zephyr/logging/log.h>
LOG_MODULE_... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_CODEC_WM8904_H_
#define ZEPHYR_INCLUDE_CODEC_WM8904_H_
/*******************************************************************************
* Definitions
**********************************************************... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <zephyr/device.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/audio/codec.h>
#include <zephyr/devicetree/clocks.h>
#include <zephyr/logging/log.h>
LOG_MODULE... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>62_REGVAL_IN_VOL(vu, mute, zc, vol) \
((vu & 0b1) << 8 | (mute & 0b1) << 7 | (zc & 0b1) << 6 | (vol & 0b000111111))
#define WM8962_REGMASK_IN_VU 0b100000000
#define WM8962_REGMASK_IN_MUTE 0b010000000
#define WM8962_REGMASK_IN_ZC 0b001000000
#de... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright (c) 2024-2025 Chen Xingyu <hi@xingrz.me>
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT gpio_7_segment
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/auxdisplay.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(au... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2022-2023 Jamie McCrae
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/drivers/auxdisplay.h>
#include <zephyr/internal/syscall_handler.h>
static inline int z_vrfy_auxdisplay_display_on(const struct device *dev)
{
K_OOPS(K_SYSCALL_DRIVER_AUXDISPLAY(dev, display_on));
... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Jamie McCrae
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT hit_hd44780
#include <string.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/auxdisplay.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/pm/device.h>
#inclu... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2022-2023 Jamie McCrae
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT noritake_itron
#include <string.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/auxdisplay.h>
#include <zephyr/drivers/gpio.h>
#includ<|fim_suffix|>/
if (... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>AY_ITRON_ */
<|fim_prefix|>/*
* Copyright (c) 2022-2023 Jamie McCrae
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef H_AUXDISPLAY_ITRON_
#define H_<|fim_middle|>AUXDISPLAY_ITRON_
#define AUXDISPLAY_ITRON_BRIGHTNESS_MIN 1
#define AUXDISPLAY_ITRON_BRIGHTNESS_MAX 8
#define AUXDISPLAY_ITRON_CHARACTE... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2015 Intel Corporation
* Copyright (c) 2022 Nordic Semiconductor ASA
* Copyright (c) 2022-2023 Jamie McCrae
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT jhd_jhd1313
#include <string.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>v->data;
const uint16_t cols = config->panel_config.capabilities.columns;
int ret = 0;
uint16_t pattern;
uint8_t position;
for (uint16_t i = 0; i < len; i++) {
/*
* Symbols only exist between digits, so no need to process the
* first character for symbol.
*/
if (i != 0 && auxdisplay_nxp... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|> \
.rows = DT_INST_PROP(n, rows), \
.mode = 0, \
.brightness.minimum = PT6314_BRIGHTNESS_MIN, \
.brightness.maximum = PT6314_BRIGHTNESS_MAX, \
... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Jan Henke <Jan.Henke@taujhe.de>
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT sparkfun_serlcd
#include <stdlib.h>
#include <string.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/auxdispl... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>, \
.letters_upper_rotated_180 = \
(ARRAY_SIZE(letters_upper_rotated_180) == 26U) \
? letters_upper_rotated_180 : NULL, \
.letters_lower = (ARRAY_SIZE(letters_lower) == 26U) \
? letters_lower : NULL, \
.letters_lower_rotated_180 = \
(ARRAY_SIZE(let... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* TM1637 7-segment display driver
* Copyright (c) 2025 Siratul Islam
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT titanmec_tm1637
#include <zephyr/kernel.h>
#<|fim_suffix|>ties, sizeof(*cap));
return 0;
}
/* Device initialization */
static int tm1637_initialize(const struct d... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>
&bbram_emul_driver_api);
DT_INST_FOREACH_STATUS_OKAY(BBRAM_INIT);
<|fim_prefix|>/*
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT zephyr_bbram_emul
#include <zephyr/drivers/bbram.h>
#include <string.h>
#include <zephyr/logging/log.h>
LOG_MODULE_... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>, size_t *size)
{
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
K_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
return z_impl_bbram_get_size(dev, size);
}
#include <zephyr/syscalls/bbram_get_size_mrsh.c>
static inline int z_vrfy_bbram_read(const struct device *dev, size_t offset,
size_... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright (c) 2021 Google Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT ite_it8xxx2_bbram
#include <errno.h>
#include <zephyr/drivers/bbram.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/util.h>
#ifndef CONFIG_BBRAM_IT8XXX2_EMUL
#include <chip_chipregs.h>
#else
/* Emulation ... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright (c) 2024 Google Inc
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/devicetree.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/emul_bbram.h>
#include "it8xxx2.h"
#define DT_DRV_COMPAT ite_it8xxx2_bbram
struct bbram_it8xxx2_emul_config {
const struct device *dev;
};
#define... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2025 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Read and Write access to offset ranges 0x2A(42)-0x31(49) and 0xAA(170)-0xB1(177)
* are lockable through BIOS setting. To access the memory in those offsets,
* disable the Lock in BIOS through following steps... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023, Nordic Se<|fim_suffix|> (MICROCHIP_MCP7940N_SRAM_OFFSET + offset + i),
buffer[i]);
if (rc != 0) {
goto finish;
}
++i;
}
finish:
k_mutex_unlock(&data->lock);
return rc;
}
static DEVICE_API(bbram, microchip_mcp7940n_bbram_api) = {
.get_size = microchip... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright 2024 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT microchip_mcp7940n
#include <zephyr/device.h>
#include <zephyr/drivers/emul.h>
#include <zephyr/drivers/emul_bbram.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/i2c_emul.h>
#include <zephyr/logging/log.h>
L... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>cx_check_standby_power,
#endif /* CONFIG_BBRAM_NPCX_EX */
.check_power = bbram_npcx_check_power,
.get_size = bbram_npcx_get_size,
.read = bbram_npcx_read,
.write = bbram_npcx_write,
};
#define BBRAM_INIT(inst) \
BBRAM_NPCX_DEC... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>t8_t *buffer)
{
const struct bbram_npcx_config *config = GET_CONFIG(target);
if (offset + count > config->size) {
return -ERANGE;
}
bytecpy(((uint8_t *)config->base_addr + offset), buffer, count);
return 0;
}
static int npcx_emul_backend_get_data(const struct emul *target, size_t offset, size_t ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* SPDX-FileCopyrightText: 2026 Basalte bv
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT nxp_imx_snvs_gpr
#include <errno.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/bbram.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util.h>
#includ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>T;
}
/* The bbram in RTS5912 only accepts word-access.
* Read it as a word, then split it into bytes.
*/
for (int i = 0; i < size;) {
word = *(uint32_t *)(config->base + ROUND_DOWN((offset + i), 4));
start_offset = (offset + i) % 4;
bytes_to_read = MIN(4 - start_offset, size - i);
memcpy(&... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2022 Google Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <string.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/bbram.h>
#include <zephyr/kernel.h>
#include <zephyr/shell/shell.h>
#include <zephyr/sys/util.h>
/* Buffer is only needed for... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>turn 0;
}
#define BBRAM_INIT(inst) \
static const struct bbram_stm32_config bbram_cfg_##inst = { \
.parent = DEVICE_DT_GET(DT_INST_PARENT(inst)), \
.base_addr ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2021 Microchip Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT microchip_xec_bbram
#include <zephyr/drivers/bbram.h>
#include <errno.h>
#include <soc.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(bbram, CONFIG_BBRAM_LOG_... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>dif
#endif /* INCLUDE_ZEPHYR_DRIVERS_BBRAM_IT8XXX2_H_ */
<|fim_prefix|>/*
* Copyright (c) 2024 Google Inc
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef INCLUDE_ZEPHYR_DRIVERS_BBRAM_IT8XXX2_H_
#define INCLUDE_ZEPHYR_DRIVERS_BBRAM_IT8XXX2_H_
#include <stdint.h>
#include <zephyr/devicetree.h>
/** ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>register base address */
uintptr_t status_reg_addr;
};
#ifdef CONFIG_BBRAM_NPCX_EMUL
#define BBRAM_NPCX_DECL_CONFIG(inst) \
static uint8_t bbram_npcx_emul_buffer_##inst[DT_INST_REG_SIZE_BY_NAME(inst, memory)]; \
static uint8_t bbram_np... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2025 Siratul Islam
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT zephyr_biometrics_emul
#include <zephyr/device.h>
#include <zephyr/drivers/biometrics.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <string.h>
LOG_MODULE_REGISTER(biometri... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>RIC_ATTR_ENROLLMENT_QUALITY:
data->enroll_quality = val;
ret = 0;
break;
case BIOMETRIC_ATTR_SECURITY_LEVEL:
if (val < 1 || val > 10) {
ret = -EINVAL;
break;
}
data->security_level = val;
ret = 0;
break;
case BIOMETRIC_ATTR_TIMEOUT_MS:
if (val > GT5X_MAX_TIMEOUT_MS) {
ret = ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>s;
uint16_t template_size;
};
/* Driver runtime data */
struct gt5x_data {
const struct device *dev;
struct k_mutex lock;
struct k_spinlock irq_lock;
struct k_sem uart_tx_sem;
struct k_sem uart_rx_sem;
struct gt5x_packet tx_pkt;
struct gt5x_packet rx_pkt;
volatile uint16_t rx_expected;
volat... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>te)val;
return 0;
}
shell_error(sh, "Unknown attribute: %s", arg);
return -EINVAL;
}
static int cmd_biometric_info(const struct shell *sh, size_t argc, char **argv)
{
const struct device *dev;
struct biometric_capabilities caps;
int ret;
dev = shell_device_get_binding(argv[1]);
if (!dev) {
... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* SPDX-License-Identifier: Apache-2.0
* Copyright (c) 2025 Siratul Islam
*/
#define DT_DRV_COMPAT zhiantec_zfm_x0
#include <zephyr/kern<|fim_suffix|> void zfm_x0_uart_callback(const struct device *uart_dev, void *user_data)
{
struct zfm_x0_data *data = user_data;
uart_irq_update(uart_dev);
if... | fim | zephyrproject-rtos/zephyr | c |
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright (c) 2025 Siratul Islam
*/
#ifndef ZEPHYR_DRIVERS_BIOMETRICS_BIOMETRICS_ZFM_X0_H_
#define ZEPHYR_DRIVERS_BIOMETRICS_BIOMETRICS_ZFM_X0_H_
#include <zephyr/drivers/uart.h>
#include <zephyr/drivers/biometrics.h>
/* Protocol constants */
#define ZFM_X0_START_CODE ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Ambiq Micro Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @brief Ambiq Apollox Blue SoC extended driver for SPI based HCI.
*/
#define DT_DRV_COMPAT ambiq_bt_hci_spi
#include <zephyr/init.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/drivers/gpio.h>
#include... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Ambiq Micro Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @brief Header file of Ambiq Apollox Blue SoC extended driver
* for SPI based HCI.
*/
#ifndef ZEPHYR_DRIVERS_BLUETOOTH_HCI_APOLLOX_BLUE_H_
#define ZEPHYR_DRIVERS_BLUETOOTH_HCI_APOLLOX_BLUE_H_
#ifdef __cpluspl... | fim | zephyrproject-rtos/zephyr | c |
/* h4.c - H:4 UART based Bluetooth driver */
/*
* Copyright (c) 2015-2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <stddef.h>
#include <zephyr/kernel.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/init.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>_req);
h5_send(dev, conf_req, HCI_3WIRE_LINK_PKT, sizeof(conf_req));
} else if (!memcmp(buf->data, conf_req, 2)) {
/*
* The Host sends Config Response messages without a
* Configuration Field.
*/
h5_send(dev, conf_rsp, HCI_3WIRE_LINK_PKT, sizeof(conf_rsp));
/* Then send Config R... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Ambiq Micro Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @brief Ambiq SPI based Bluetooth HCI driver.
*/
#define DT_DRV_COMPAT ambiq_bt_hci_spi
#include <zephyr/init.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/blue... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2026, Realtek Semiconductor Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <string.h>
#include <zephyr/bluetooth/buf.h>
#include <zephyr/drivers/bluetooth.h>
#include <zephyr/logging/log.h>
#include "rtl_bt_hci.h"
LOG_MODULE_REGISTER(bt_driver... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright The Zephyr Project Contributors
*
* SPDX-License-Identifier: Apache-2.0
*
* HCI driver for Bouffalo Lab on-chip BLE controllers.
*
* The controller is a precompiled binary blob communicating via an on-chip
* HCI interface (bt_onchiphci_send / bt_onchiphci_interface_init). This
* dr... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>e DA1453x from reset */
err = gpio_pin_configure_dt(&bt_reset, GPIO_OUTPUT_INACTIVE);
if (err) {
return err;
}
/* Wait for the DA1453x to boot */
k_sleep(K_MSEC(DT_INST_PROP(0, boot_duration_ms)));
/* Drain bytes */
while (h4 && uart_fifo_read(h4, &c, 1)) {
continue;
}
#endif /* DT_INST_NODE... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>EL_STACK_SIZEOF(rng_thread_stack),
rng_thread, NULL, NULL, NULL,
K_PRIO_COOP(CONFIG_BT_RX_PRIO),
0, K_NO_WAIT);
k_thread_name_set(tid, "bt_rng_thread");
cmac_enable();
irq_enable(CMAC2SYS_IRQn);
return 0;
}
#ifdef CONFIG_BT_HCI_HOST
static int bt_da1469x_close(const struc... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_vs.h>
#include <zephyr/init.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/version.h>
#include <zephyr/drivers/bluetooth.... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>vendor_specific_command(uint16_t opcode, uint8_t param_len, uint8_t *param_buf,
wiced_bt_dev_vendor_specific_command_complete_cback_t cback)
{
/*
* This function is using only by btstack-integration asset
* for enable LPM.
*/
struct net_buf *buf = NULL;
/* Allocate a HCI command buffer... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>M_SIZE + 4096)
#define PSOC6_BLESS_OP_SET_PUBLIC_ADDR BT_OP(BT_OGF_VS, 0x1a0)
static K_SEM_DEFINE(psoc6_bless_rx_sem, 0, 1);
static K_SEM_DEFINE(psoc6_bless_operation_sem, 1, 1);
static K_KERNEL_STACK_DEFINE(psoc6_bless_rx_thread_stack, CONFIG_BT_RX_STACK_SIZE);
static struct k_thread psoc6_bless_rx_thr... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|> \
BT_DT_HCI_DRIVER_CONFIG_INST_GET(inst); \
DEVICE_DT_INST_DEFINE(inst, bt_nxp_init, NULL, &hci_data_##inst, &hci_config_##inst, \
POST_KERNEL, CONFIG_BT_HCI_INIT_PRIORITY, &drv)
/* Only one instance supported rig... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright 2024-2026 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <stddef.h>
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/init.h>
#include <zephyr/drivers/uart.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright (c) 2026 Realtek Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "hci/hci_common.h"
#include "hci/hci_if_zephyr.h"
#include "hci/hci_transport.h"
#include "hci_platform.h"
#include <zephyr/drivers/bluetooth.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTE... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2015-2016 Intel Corporation
* Copyright (c) 2025 SiFli Technologies(Nanjing) Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT sifli_sf32lb_mailbox
#include <errno.h>
#include <stddef.h>
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/arch... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Antmicro <www.antmicro.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/drivers/bluetooth.h>
#include <zephyr/kernel.h>
#include <sl_btctrl_linklayer.h>
#include <sl_hci_common_transport.h>
#include <sl_rail_util_compatible_pa.h>
#include <sl_rail.h>
#include ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2024 Silicon Laboratories Inc.
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/bluetooth.h>
#define DT_DRV_COMPAT silabs_siwx91x_bt_hci
#define LOG_LEVEL CONFIG_BT_HCI_DRIVER_LOG_LEVEL
#include <zephyr/logging/log.h>
LOG_MODULE_REGIS... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/* hci_spi_st.c - STMicroelectronics HCI SPI Bluetooth driver */
/*
* Copyright (c) 2017 Linaro Ltd.
* Copyright (c) 2024 STMicroelectronics
*
* SPDX-License-Identifier: Apache-2.0
*/
#if defined(CONFIG_DT_HAS_ST_HCI_SPI_V1_ENABLED)
#define DT_DRV_COMPAT st_hci_spi_v1
#elif defined(CONFIG_DT_HAS_S... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>1] & 0x0F) << 8) + hci_buffer[0];
data_len = (hci_buffer[3] << 8) + hci_buffer[2];
pdu = hci_buffer + 4;
pb_flag = (hci_buffer[1] >> 4) & 0x3;
bc_flag = (hci_buffer[1] >> 6) & 0x3;
hci_tx_acl_data(connection_handle, pb_flag, bc_flag, data_len, pdu);
break;
}
#if defined(CONFIG_BT_ISO)
case B... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/* hci_stm32wba.c - HCI driver for stm32wba */
/*
* Copyright (c) 2022, Telink Semiconductor (Shanghai) Co., Ltd.
* Copyright (c) 2023 STMicroelectronics
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <zephyr/sys/util.h>
#include <zephyr/bluetooth/buf.h>
#include <zeph... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Cypress Semiconductor Corporation (an Infineon company) or
* an affiliate of Cypress Semiconductor Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @brief Implements a Bluetooth HCI (Host Controller Interface) UART driver
* extension for Infineon Bluetooth cont... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2019 Nordic Semiconductor ASA
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zep... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>48_Enable();
while (!LL_RCC_HSI48_IsReady()) {
}
#endif /* !STM32_HSI48_ENABLED */
err = clock_control_on(clk, (clock_control_subsys_t) &clk_cfg[0]);
if (err < 0) {
LOG_ERR("Could not enable IPCC clock");
return err;
}
/* Take BLE out of reset */
ipcc_reset();
transport_init();
/* Device... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2023 Pawel Osypiuk <pawelosyp@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <soc.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <nrf53_cpunet_mgmt.h>
#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h>
#include <hal/nrf_s... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/* spi.c - SPI based Bluetooth driver */
#define DT_DRV_COMPAT zephyr_bt_hci_spi
/*
* Copyright (c) 2017 Linaro Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/drivers/gpio.h>
#include <zephyr/init.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/sys/byteorder.h>
#include <zephy... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>_sco_hdr *sco = (const struct bt_hci_sco_hdr *)hdr;
/* Data_Total_Length */
payload_len = sco->len;
header_len += BT_HCI_SCO_HDR_SIZE;
break;
}
case BT_HCI_H4_EVT: {
if (buf_len < header_len + BT_HCI_EVT_HDR_SIZE) {
return 0;
}
const struct bt_hci_evt_hdr *evt = (const struct bt_hci_ev... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|> close(fd);
return err;
}
return fd;
}
int user_chan_unix_connect(char socket_path[])
{
int fd;
struct sockaddr_un addr;
size_t socket_path_size = strlen(socket_path);
if (socket_path_size >= sizeof(addr.sun_path)) {
nsi_print_error_and_exit("Unix socket path too long (%zu>=%zu)\n",
so... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>);
int user_chan_socket_open(unsigned short bt_dev_index);
int user_chan_net_connect(char ip_addr[], unsigned int port);
int user_chan_unix_connect(char socket_path[]);
#ifdef __cplusplus
}
#endif
#endif /* DRIVERS_BLUETOOTH_HCI_USERCHAN_BOTTOM_H */
<|fim_prefix|>/**
* Copyright (c) 2025 Nordic Semicon... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2026 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include <stdint.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/bluetooth/buf.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/kernel.h>
#include <zephyr/net_buf.h>
#in... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>ain while another is active evicts the
* previous one (and logs a warning) and the evicted chain's remaining fragments
* may leak into the host. This eviction is a fail-safe that prevents the tracker
* from getting permanently stuck on a chain whose terminator never arrives.
*
* Call this before the ... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>fier: Apache-2.0
*/
static inline void bt_uart_drain(const struct device *dev)
{
uint8_t c;
while (uart_fifo_read(dev, &c, 1)) {
continue;
}
}
<|fim_prefix|>/* util.h - Common helpers for Bluet<|fim_middle|>ooth drivers */
/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identi<|endo... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright (c) 2026 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT gpio_buzzer
#include <zephyr/drivers/buzzer.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(buzzer_gpio, CONFIG_BUZZER_LO... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2026 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT pwm_buzzer
#include <zephyr/drivers/buzzer.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(buzzer_pwm, CONFI... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2024 Andes Technology Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <zephyr/arch/riscv/csr.h>
#include <zephyr/drivers/cache.h>
#include <zephyr/logging/log.h>
#include <andes_csr.h>
LOG_MODULE_REGISTER(cache_an... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>che_cfg.version > 15);
}
static ALWAYS_INLINE void nds_l2_cache_wait_status(uint8_t hart_id)
{
uint32_t status;
do {
status = sys_read32(L2C_CCTLST(hart_id));
status >>= hart_id * l2_cache_cfg.status_shift;
status &= BIT_MASK(4);
} while (status == 1);
}
static ALWAYS_INLINE int nds_l2_cache_... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2022 ASPEED Technology Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/syscon.h>
#include <zephyr/sys/barrier.h>
/*
* cache area control: each bit controls 32KB cache area
* 1: cacheable
* 0: no-cache
*
* bit[0]: 1st 32KB fr... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>ile uint32_t *)(cache_cfg.base + L1C_CONFIG_OFFSET)) = tmp;
__asm__ volatile (".rept 4 ; nop ; .endr");
while ((*((volatile uint32_t *)(cache_cfg.base + L1C_CONFIG_OFFSET))
& L1C_FLUSH_DONE_MSK) == 0 && timeout > 0) {
clock_bflb_settle();
clock_bflb_settle();
timeout--;
}
if (!timeout) {
r... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2026 Espressif Systems (Shangha<|fim_suffix|>ret == ESP_ERR_NOT_SUPPORTED) ? 0 : -EIO;
}
<|fim_middle|>i) Co., Ltd.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/cache.h>
#include <esp_cache.h>
#include <esp_err.h>
static inline siz... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2020 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/cache.h>
#include <zephyr/internal/syscall_handler.h>
static inline int z_vrfy_sys_cache_data_flush_range(void *addr, size_t size)
{
K_OOPS(K_SYSCALL_MEMORY_WRITE(addr, size));
return z_impl_sys_... | fim | zephyrproject-rtos/zephyr | c |
<|fim_prefix|>/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/cache.h>
#include <zephyr/sys/barrier.h>
#include <hal/nrf_cache.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(cache_nrfx, CONFIG_CACHE_LOG_LEVEL);
... | fim | zephyrproject-rtos/zephyr | c |
/*
* Copyright 2025-2026 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/cache.h>
#include <zephyr/logging/log.h>
#include <fsl_cache.h>
#if defined(CONFIG_DCACHE)
static inline bool cache_data_is_enabled(void)
{
return (LMEM->PSCCR & LMEM_PSCCR_ENCACHE_MASK) !=... | fim | zephyrproject-rtos/zephyr | c |
<|fim_suffix|>_t size)
{
ARG_UNUSED(addr);
ARG_UNUSED(size);
return -ENOTSUP;
}
<|fim_prefix|>/*
* Copyright 2026 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/cache.h>
#include <zephyr/logging/log.h>
#include <fsl_cache.h>
void cache_instr_enable(void)
{
L... | fim | zephyrproject-rtos/zephyr | c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.