1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-13 14:18:14 +00:00

nrf52 i2c

This commit is contained in:
Tomasz Duda 2025-02-24 19:54:23 +01:00
parent 15de58a60f
commit 1951dececf
4 changed files with 9 additions and 8 deletions

View File

@ -2,6 +2,7 @@ from esphome import pins
import esphome.codegen as cg
from esphome.components import zephyr
from esphome.components.zephyr import zephyr_add_overlay, zephyr_add_prj_conf
from esphome.components.zephyr.const import KEY_ZEPHYR
import esphome.config_validation as cv
from esphome.const import (
CONF_ADDRESS,
@ -40,7 +41,7 @@ def _bus_declare_type(value):
return cv.declare_id(ArduinoI2CBus)(value)
if CORE.using_esp_idf:
return cv.declare_id(IDFI2CBus)(value)
if CORE.using_zephyr:
if CORE.target_framework == KEY_ZEPHYR:
return cv.declare_id(ZephyrI2CBus)(value)
raise NotImplementedError
@ -80,7 +81,7 @@ async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
if CORE.using_zephyr:
if CORE.target_framework == KEY_ZEPHYR:
zephyr_add_prj_conf("I2C", True)
zephyr_add_overlay(
f"""

View File

@ -1,8 +1,3 @@
external_components:
- source: github://pr#7049
components: [nrf52, zephyr]
refresh: always
i2c:
sda: P1.04
scl: P1.06

View File

@ -1,6 +1,6 @@
external_components:
- source: github://pr#7049
components: [nrf52, zephyr]
components: [nrf52, zephyr, logger]
refresh: always
esphome:

View File

@ -1,3 +1,8 @@
external_components:
- source: github://pr#7049
components: [nrf52, zephyr, logger]
refresh: always
esphome:
name: componenttestnrf52
friendly_name: $component_name