LEDC with open drain outputs
Posted: Wed Mar 31, 2021 8:17 am
What is the best practice to set open drain output ( GPIO_MODE_OUTPUT_OD ) on an LEDC channel ?
Using ESP-IDF framework and trying to set it before or after configure the cledc hannel with "ledc_channel_config()" does not work.
for example after configuration of ledc channel
Doing the same using the Arduino command "pinMode()" function works:
Since I do not want to use Arduino framework, how should I set it within ESP-IDF framework ?
mfG
winfried
Using ESP-IDF framework and trying to set it before or after configure the cledc hannel with "ledc_channel_config()" does not work.
for example after configuration of ledc channel
Code: Select all
#include <driver/ledc.h>
#include <driver/gpio.h>
...
ledc_channel.pin = pin;
ledc_channel_config(&ledc_channel);
gpio_set_direction(pin, GPIO_MODE_OUTPUT_OD);
...
Code: Select all
#include "Arduino.h"
...
ledc_channel.pin = pin;
ledc_channel_config(&ledc_channel);
pinMode(pwm[j].pin,OUTPUT_OPEN_DRAIN);
mfG
winfried