2 #if defined(ARDUINO_ARCH_RENESAS)
3 #include "AudioTools/CoreAudio/AudioPWM/PWMAudioBase.h"
4 #include "AudioTools/CoreAudio/AudioTimer/AudioTimer.h"
10 class PWMDriverRenesas;
15 using 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;
82 for (
int j = 0; j < audio_config.
channels; j++) {
83 LOGD(
"Processing channel %d", j);
84 auto gpio = audio_config.pins()[j];
85 PwmOut* pin =
new PwmOut(gpio);
86 LOGI(
"PWM Pin: %d", gpio);
87 pin->begin(20000.0f, 0.0f);
95 virtual int maxChannels() {
return PIN_PWM_COUNT; };
105 pins[channel]->pulse_perc(value);
111 if (accessAudioPWM !=
nullptr) {
119 for (
int j = 1; j < 5; j++) {