eren-terzioglu opened a new pull request, #16674:
URL: https://github.com/apache/nuttx/pull/16674

   ## Summary
   PWM (LEDC) was not working properly due to miscalculation of clock 
internals. This PR fixes this issue and enables another features of PWM(LEDC) 
like clock selection, clock division options.
   <!-- This field should contain a summary of the changes. It will be 
pre-filled with the commit's message and descriptions. Adjust it accordingly -->
   
   * xtensa/espressif: Change LEDC implementation to common for Xtensa based 
Espressif chips
   
   Change LEDC implementation to common one for esp32[-s2|-s3]
   
   
   ## Impact
   <!-- Please fill the following sections with YES/NO and provide a brief 
explanation -->
   
   Impact on user: No, older configs can work properly
   <!-- Does it impact user's applications? How? -->
   
   Impact on build: No, build steps and configs will be the same
   <!-- Does it impact on building NuttX? How? (please describe the required 
changes on the build system) -->
   
   Impact on hardware: Yes, esp32s2/s3 PWM (LEDC) has more capabilities
   <!-- Does it impact a specific hardware supported by NuttX? -->
   
   Impact on documentation: No
   <!-- Does it impact the existing documentation? Please provide additional 
documentation to reflect that -->
   
   Impact on security: No
   <!-- Does it impact NuttX's security? -->
   
   Impact on compatibility: No, old configs will work fine
   <!-- Does it impact compatibility between previous and current versions? Is 
this a breaking change? -->
   
   ## Testing
   <!-- Please provide all the testing procedure. Consider that upstream 
reviewers should be able to reproduce the same testing performed internally -->
   
   ### Building
   <!-- Provide how to build the test for each SoC being tested -->
   
   Configs used to build:
   
   ```
   esp32s2-saola-1:pwm
   esp32s3-devkit:pwm
   ```
   
   Commands to build:
   
   ```
   make distclean; ./tools/configure.sh esp32s2-saola-1:pwm; make -j; make 
download ESPTOOL_PORT=/dev/ttyUSB0 ESPTOOL_BAUD=921600 ESPTOOL_BINDIR=../esp-bin
   ```
   
   ### Running
   <!-- Provide how to run the test for each SoC being tested -->
   
   `pwm` example used to test it with connecting pwm pin (`GPIO-2`) to logic 
analyzer. Commands I used:
   
   ```
   nsh> pwm
   pwm_main: starting output with frequency: 100 duty: 00007fff
   pwm_main: stopping output
   nsh> pwm -f 10
   pwm_main: starting output with frequency: 10 duty: 00007fff
   pwm_main: stopping output
   nsh> pwm -f 10000
   pwm_main: starting output with frequency: 10000 duty: 00007fff
   pwm_main: stopping output
   nsh> pwm -f 100 -d 30
   pwm_main: starting output with frequency: 100 duty: 0000b333
   pwm_main: stopping output
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to