Please post a link to the actual display that you have bought.
Most boards are designed for PWM. If you provide a genuine Analog signal the LED transistor will be operating in its linear region. This means a higher power dissipation in the SMD transistor. e.g. J3Y on the common 1.3 inch 3.3V 7-pin blue displays.
You will probably get away with it on small 1.3 inch. But a large 3.2 inch panel will take much more current. Hence the reason for asking for a link.
Note that some boards omit the transistor. These expect you to provide external control e.g. series resistor. This is BAD for DAC pin and BAD for PWM too. Neither pin is intended for high LED currents.
Life is so much simpler when people provide a link to their display. Then we don't have to guess. We can give a straight answer.
Thank you for your reply David. I thought as an IPS screen the one I used should be a common occurrence without hardware variations. Nevertheless, here is a link to my display. It's a generic 1.33" IPS ST7789 3.3V.
@Idahowalker I do believe that ledc and PWM work as expected with an ESP32, but it won't do anything with my display, except if I hook it up to one of the DACs.
And thank you as well for your code. Mine is similar, I just used ledcSetup(0, 1000, 8) and ledcAttachPin(25, 0) - here for example pin 35 won't work.
A possible issue with using the hardware timer is when other devices use the timer without a timer designation.
Example the ESP32ServoLibrary which does not assign timers but lets the OS choose a timer. The automated timer choose done by the ESp32 starts at timer 0. If your application is also using timer 0 and ESP32Servo library is being used, the servo library messes with the timer programming. It's better to use the timers in reverse order, starting with using timer 3 and work down to timer 0.
I do not have ANY other dimming circuits to the same display as you are using and it dimms wonderfully well.
It is always wise to post a link to your display. Hardware varies. It avoids guesswork.
That particular board has a transistor U2 which is designed for PWM. It is not intended for linear operation.
Actually, the ESP32 GPIO pins can source and sink relatively high currents. Similar to AVR. Much higher than most ARM chips.
So the ESP32 will not be harmed by driving U2 in a linear fashion from the DAC. U2 will probably be ok for the 1.3 inch backlight.
I suppose that I have only used it as 100% ON or OFF. I will investigate PWM for myself. It should work just fine on that display. And be safer than using the DAC.
GPIO35 is an Analog-only pin. It should really be called GPIO at all.