fdcavalcanti commented on issue #14816:
URL: https://github.com/apache/nuttx/issues/14816#issuecomment-2562545648

   Hi @shizacat. That's would be a nice contribution!
   
   To accomplish this, you need to use other similar features as example. Since 
you are using Xtensa, take a look at `arch/xtensa/src/common/espressif` and use 
those as reference. RMT, QEncoder, PCNT, MCPWM are all good HAL-based features 
that you can use as example.
   
   Looking at the `adc_oneshot.c` and comparing to the features I mentioned, 
you will see we don't use the `adc_oneshot.c` directly. We only use the HAL 
functions (such as `adc_oneshot_hal_setup()`, `adc_oneshot_hal_convert()`) 
available, and we implement the content of `adc_oneshot.c` in the NuttX way.
   
   A similar question was asked regarding power management a couple of months 
ago. @tmedicci answered this on [this 
thread](https://lists.apache.org/thread/1jdrr2j13523y2m2ls4bdm0f0gbnk1vd).
   Please take a look at the start where the HAL is discussed.
   
   You will see that we use a specific branch of the `esp-hal-3rdparty` 
repository. In there, `portENTER_CRITICAL` and `portENTER_CRITICAL_SAFE` are 
dealt with using little maneuvers such as `#ifdef __NuttX__` to support the 
proper functions. See 
[this](https://github.com/espressif/esp-hal-3rdparty/blob/release/v5.1.c/components/esp_phy/src/phy_init.c)
 on line 28 as example.
   
   Please take a look at the links I showed and use one of the features as an 
example.
   Feel free to share any other questions here.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to