2#if defined(ARDUINO_ARCH_RENESAS)
3#include "AudioTools/CoreAudio/AudioPWM/PWMAudioBase.h"
4#include "AudioTools/CoreAudio/AudioTimer/AudioTimer.h"
10class PWMDriverRenesas;
15using PWMDriver = PWMDriverRenesas;
32 for (
int j = 2; j < 13; j += 2) pwm_pins.push_back(j);
33 cfg.setPins(pwm_pins);
38 virtual void end()
override {
42 is_timer_started =
false;
45 for (
int j = 0; j < audio_config.
channels; j++) {
46 if (pins[j] !=
nullptr) {
66 if (!is_timer_started) {
68 ticker.setCallbackParameter(
this);
74 is_timer_started =
true;
86 for (
int j = 0; j < audio_config.
channels; j++) {
87 LOGD(
"Processing channel %d", j);
88 auto gpio = audio_config.pins()[j];
89 PwmOut* pin =
new PwmOut(gpio);
90 LOGI(
"PWM Pin: %d", gpio);
91 pin->begin(20000.0f, 0.0f);
99 virtual int maxChannels() {
return PIN_PWM_COUNT; };
109 pins[channel]->pulse_perc(value);
115 if (accessAudioPWM !=
nullptr) {
123 for (
int j = 1; j < 5; j++) {