daniel-p-carvalho opened a new pull request, #20441:
URL: https://github.com/apache/nuttx/pull/20441

   ## Summary
   
   Add `CONFIG_STM32_DAC_LL_OPS` support to the common STM32 DAC driver 
(`stm32_dac_m3m4_v1`). This provides low-level operations (`stm32_dac_ops_s`) 
and helper macros (`DAC_ENABLE`, `DAC_WRITE_DRO`, `DAC_START_DMA`, 
`DAC_STOP_DMA`, `DAC_DUMP_REGS`), aligning `stm32_dac_m3m4_v1` with the 
existing architecture in `stm32l4` and `stm32h7`.
   
   This enables high-speed / real-time control applications (e.g. digital power 
conversion, inverters, HRTIM synchronization, and function generators) to 
operate the DAC peripheral directly without char driver VFS overhead.
   
   ## Impact
   
   - **New Feature:** Added `llops` table and interface definitions in 
`stm32_dac_m3m4_v1.h` and `stm32_dac_m3m4_v1.c`.
   - **Compatibility:** Backward compatible. Only active when 
`CONFIG_STM32_DAC_LL_OPS=y`.
   - **User / Build:** No changes to existing configurations unless 
`CONFIG_STM32_DAC_LL_OPS` is selected.
   
   ## Testing
   
   - **Host:** Linux x86_64
   - **Toolchain:** `arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1`
   - **Target Hardware:** STMicroelectronics Nucleo-G431KB (STM32G431KB, 
Cortex-M4)
   - **Configuration:** `nucleo-g431kb:comp` with DAC character driver & LL ops 
enabled.
   - **Verification:**
     - `./tools/nxstyle` clean (0 errors)
     - `./tools/checkpatch.sh -m -g HEAD` clean (0 errors)
     - Hardware run in NSH:
   
   ```text
   nsh> comp test
   Running comparator test on /dev/comp0...
     1. Initial output state: 0
     2. ANIOC_COMP_DISABLE: OK
     3. Output state when disabled: 0
     4. ANIOC_COMP_ENABLE: OK
     5. Output state when enabled: 0
   Comparator test PASSED on /dev/comp0
   
   === Comparator Ramp Test ===
     COMP device : /dev/comp0
     DAC device  : /dev/dac5
     Sweep range : 0 -> 4095 (step 100, delay 5 ms)
   
        DAC=   0 (~   0 mV) | COMP output: 1
        DAC= 500 (~ 402 mV) | COMP output: 1
        DAC=1000 (~ 805 mV) | COMP output: 1
     -> [TRIP EVENT #1] DAC=1300 (~1047 mV) | COMP output: 1 -> 0
        DAC=1500 (~1208 mV) | COMP output: 0
        DAC=2000 (~1611 mV) | COMP output: 0
        DAC=2500 (~2014 mV) | COMP output: 0
        DAC=3000 (~2417 mV) | COMP output: 0
        DAC=3500 (~2820 mV) | COMP output: 0
        DAC=4000 (~3223 mV) | COMP output: 0
   
   === Test Summary ===
   SUCCESS: Detected 1 comparator transition(s)!
   ```
   


-- 
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