mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-31 10:08:27 +02:00
Add rmt_channel to remote_transmitter and remote_receiver (#6497)
* Add rmt_channel to remote_transmitter and remote_receiver * Add codeowner * Add tests
This commit is contained in:
@@ -15,6 +15,9 @@ RemoteRMTChannel::RemoteRMTChannel(uint8_t mem_block_num) : mem_block_num_(mem_b
|
||||
next_rmt_channel = rmt_channel_t(int(next_rmt_channel) + mem_block_num);
|
||||
}
|
||||
|
||||
RemoteRMTChannel::RemoteRMTChannel(rmt_channel_t channel, uint8_t mem_block_num)
|
||||
: channel_(channel), mem_block_num_(mem_block_num) {}
|
||||
|
||||
void RemoteRMTChannel::config_rmt(rmt_config_t &rmt) {
|
||||
if (rmt_channel_t(int(this->channel_) + this->mem_block_num_) > RMT_CHANNEL_MAX) {
|
||||
this->mem_block_num_ = int(RMT_CHANNEL_MAX) - int(this->channel_);
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esphome/components/binary_sensor/binary_sensor.h"
|
||||
#include "esphome/core/automation.h"
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/automation.h"
|
||||
#include "esphome/components/binary_sensor/binary_sensor.h"
|
||||
|
||||
#ifdef USE_ESP32
|
||||
#include <driver/rmt.h>
|
||||
@@ -86,6 +86,7 @@ class RemoteComponentBase {
|
||||
class RemoteRMTChannel {
|
||||
public:
|
||||
explicit RemoteRMTChannel(uint8_t mem_block_num = 1);
|
||||
explicit RemoteRMTChannel(rmt_channel_t channel, uint8_t mem_block_num = 1);
|
||||
|
||||
void config_rmt(rmt_config_t &rmt);
|
||||
void set_clock_divider(uint8_t clock_divider) { this->clock_divider_ = clock_divider; }
|
||||
|
||||
Reference in New Issue
Block a user