mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 22:26:36 +00:00
[inkplate6] Require 240mhz cpu frequency (#9356)
This commit is contained in:
parent
2510b5ffb5
commit
fde5f88192
@ -1,6 +1,7 @@
|
|||||||
from esphome import pins
|
from esphome import pins
|
||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import display, i2c
|
from esphome.components import display, i2c
|
||||||
|
from esphome.components.esp32 import CONF_CPU_FREQUENCY
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_FULL_UPDATE_EVERY,
|
CONF_FULL_UPDATE_EVERY,
|
||||||
@ -13,7 +14,9 @@ from esphome.const import (
|
|||||||
CONF_PAGES,
|
CONF_PAGES,
|
||||||
CONF_TRANSFORM,
|
CONF_TRANSFORM,
|
||||||
CONF_WAKEUP_PIN,
|
CONF_WAKEUP_PIN,
|
||||||
|
PLATFORM_ESP32,
|
||||||
)
|
)
|
||||||
|
import esphome.final_validate as fv
|
||||||
|
|
||||||
DEPENDENCIES = ["i2c", "esp32"]
|
DEPENDENCIES = ["i2c", "esp32"]
|
||||||
AUTO_LOAD = ["psram"]
|
AUTO_LOAD = ["psram"]
|
||||||
@ -120,6 +123,18 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _validate_cpu_frequency(config):
|
||||||
|
esp32_config = fv.full_config.get()[PLATFORM_ESP32]
|
||||||
|
if esp32_config[CONF_CPU_FREQUENCY] != "240MHZ":
|
||||||
|
raise cv.Invalid(
|
||||||
|
"Inkplate requires 240MHz CPU frequency (set in esp32 component)"
|
||||||
|
)
|
||||||
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
FINAL_VALIDATE_SCHEMA = _validate_cpu_frequency
|
||||||
|
|
||||||
|
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
var = cg.new_Pvariable(config[CONF_ID])
|
var = cg.new_Pvariable(config[CONF_ID])
|
||||||
|
|
||||||
|
@ -3,6 +3,9 @@ i2c:
|
|||||||
scl: 16
|
scl: 16
|
||||||
sda: 17
|
sda: 17
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
cpu_frequency: 240MHz
|
||||||
|
|
||||||
display:
|
display:
|
||||||
- platform: inkplate6
|
- platform: inkplate6
|
||||||
id: inkplate_display
|
id: inkplate_display
|
||||||
|
Loading…
x
Reference in New Issue
Block a user