rename folder

This commit is contained in:
2023-12-17 20:31:18 +01:00
parent 9ee2ee5864
commit 90b58c7e4d
76 changed files with 0 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
```yaml
# example configuration:
empty_spi_component:
id: empty_spi_component_1
cs_pin: D8
spi:
clk_pin: D5
miso_pin: D6
```
@@ -0,0 +1,18 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi
from esphome.const import CONF_ID
DEPENDENCIES = ['spi']
empty_spi_component_ns = cg.esphome_ns.namespace('empty_spi_component')
EmptySPIComponent = empty_spi_component_ns.class_('EmptySPIComponent', cg.Component, spi.SPIDevice)
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(EmptySPIComponent)
}).extend(cv.COMPONENT_SCHEMA).extend(spi.spi_device_schema(cs_pin_required=True))
def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield cg.register_component(var, config)
yield spi.register_spi_device(var, config)
@@ -0,0 +1,22 @@
#include "esphome/core/log.h"
#include "empty_spi_component.h"
namespace esphome {
namespace empty_spi_component {
static const char *TAG = "empty_spi_component.component";
void EmptySPIComponent::setup() {
}
void EmptySPIComponent::loop() {
}
void EmptySPIComponent::dump_config(){
ESP_LOGCONFIG(TAG, "Empty SPI component");
}
} // namespace empty_spi_component
} // namespace esphome
@@ -0,0 +1,20 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/components/spi/spi.h"
namespace esphome {
namespace empty_spi_component {
class EmptySPIComponent : public Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST,spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING,spi::DATA_RATE_1KHZ> {
public:
void setup() override;
void loop() override;
void dump_config() override;
};
} // namespace empty_spi_component
} // namespace esphome