mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
commit
0a1ed58454
6 changed files with 13 additions and 7 deletions
|
@ -24,7 +24,7 @@ CONFIG_SCHEMA = cv.All(
|
||||||
).extend(
|
).extend(
|
||||||
{
|
{
|
||||||
cv.GenerateID(CONF_DALLAS_ID): cv.use_id(DallasComponent),
|
cv.GenerateID(CONF_DALLAS_ID): cv.use_id(DallasComponent),
|
||||||
cv.Optional(CONF_ADDRESS): cv.hex_int,
|
cv.Optional(CONF_ADDRESS): cv.hex_uint64_t,
|
||||||
cv.Optional(CONF_INDEX): cv.positive_int,
|
cv.Optional(CONF_INDEX): cv.positive_int,
|
||||||
cv.Optional(CONF_RESOLUTION, default=12): cv.int_range(min=9, max=12),
|
cv.Optional(CONF_RESOLUTION, default=12): cv.int_range(min=9, max=12),
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,9 @@ CONFIG_SCHEMA = cv.All(
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
cg.add(rp2040_ns.setup_preferences())
|
cg.add(rp2040_ns.setup_preferences())
|
||||||
|
|
||||||
|
# Allow LDF to properly discover dependency including those in preprocessor
|
||||||
|
# conditionals
|
||||||
|
cg.add_platformio_option("lib_ldf_mode", "chain+")
|
||||||
cg.add_platformio_option("board", config[CONF_BOARD])
|
cg.add_platformio_option("board", config[CONF_BOARD])
|
||||||
cg.add_build_flag("-DUSE_RP2040")
|
cg.add_build_flag("-DUSE_RP2040")
|
||||||
cg.add_define("ESPHOME_BOARD", config[CONF_BOARD])
|
cg.add_define("ESPHOME_BOARD", config[CONF_BOARD])
|
||||||
|
|
|
@ -351,6 +351,7 @@ class SPIClient {
|
||||||
: bit_order_(bit_order), mode_(mode), data_rate_(data_rate) {}
|
: bit_order_(bit_order), mode_(mode), data_rate_(data_rate) {}
|
||||||
|
|
||||||
virtual void spi_setup() {
|
virtual void spi_setup() {
|
||||||
|
esph_log_d("spi_device", "mode %u, data_rate %ukHz", (unsigned) this->mode_, (unsigned) (this->data_rate_ / 1000));
|
||||||
this->delegate_ = this->parent_->register_device(this, this->mode_, this->bit_order_, this->data_rate_, this->cs_);
|
this->delegate_ = this->parent_->register_device(this, this->mode_, this->bit_order_, this->data_rate_, this->cs_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,10 +399,7 @@ class SPIDevice : public SPIClient {
|
||||||
|
|
||||||
void set_data_rate(uint32_t data_rate) { this->data_rate_ = data_rate; }
|
void set_data_rate(uint32_t data_rate) { this->data_rate_ = data_rate; }
|
||||||
|
|
||||||
void set_bit_order(SPIBitOrder order) {
|
void set_bit_order(SPIBitOrder order) { this->bit_order_ = order; }
|
||||||
this->bit_order_ = order;
|
|
||||||
esph_log_d("spi.h", "bit order set to %d", order);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_mode(SPIMode mode) { this->mode_ = mode; }
|
void set_mode(SPIMode mode) { this->mode_ = mode; }
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,11 @@ class SPIDelegateHw : public SPIDelegate {
|
||||||
void begin_transaction() override {
|
void begin_transaction() override {
|
||||||
#ifdef USE_RP2040
|
#ifdef USE_RP2040
|
||||||
SPISettings const settings(this->data_rate_, static_cast<BitOrder>(this->bit_order_), this->mode_);
|
SPISettings const settings(this->data_rate_, static_cast<BitOrder>(this->bit_order_), this->mode_);
|
||||||
|
#elif defined(ESP8266)
|
||||||
|
// Arduino ESP8266 library has mangled values for SPI modes :-(
|
||||||
|
auto mode = (this->mode_ & 0x01) + ((this->mode_ & 0x02) << 3);
|
||||||
|
ESP_LOGV(TAG, "8266 mangled SPI mode 0x%X", mode);
|
||||||
|
SPISettings const settings(this->data_rate_, this->bit_order_, mode);
|
||||||
#else
|
#else
|
||||||
SPISettings const settings(this->data_rate_, this->bit_order_, this->mode_);
|
SPISettings const settings(this->data_rate_, this->bit_order_, this->mode_);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2023.9.0b2"
|
__version__ = "2023.9.0b3"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
VALID_SUBSTITUTIONS_CHARACTERS = (
|
VALID_SUBSTITUTIONS_CHARACTERS = (
|
||||||
|
|
|
@ -11,7 +11,7 @@ esptool==4.6.2
|
||||||
click==8.1.7
|
click==8.1.7
|
||||||
esphome-dashboard==20230904.0
|
esphome-dashboard==20230904.0
|
||||||
aioesphomeapi==15.0.0
|
aioesphomeapi==15.0.0
|
||||||
zeroconf==0.108.0
|
zeroconf==0.112.0
|
||||||
|
|
||||||
# esp-idf requires this, but doesn't bundle it by default
|
# esp-idf requires this, but doesn't bundle it by default
|
||||||
# https://github.com/espressif/esp-idf/blob/220590d599e134d7a5e7f1e683cc4550349ffbf8/requirements.txt#L24
|
# https://github.com/espressif/esp-idf/blob/220590d599e134d7a5e7f1e683cc4550349ffbf8/requirements.txt#L24
|
||||||
|
|
Loading…
Reference in a new issue