Skip to content

exmaple implementation for a DMA driven ADC driver for the stm32f4 MCUs based on the LL HAL

License

Notifications You must be signed in to change notification settings

StefJar/zephyr_stm32_adc1_dma_driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

STM32F4 async ADC driver with DMA transfer

Simple ZephyrOS device driver for the stm32f4 series setting. It sets up the ADC1 + DMA2 and connects it via dma streams. The driver manages the memory of the sample buffer. The samples can be accessed via API (api->sb and api->sbN). A bit dirty but good enough as demo.

The init function inits the driver. After, convert triggers the AD conversion. This function returns when the convertion is successfully done. The close function disables the ADC driver.

Note:

The driver is designed to generate the smallest amount of CPU load. Thats why a fixed buffer is used. The DMA stream/channel is set to circular. This saves the insturctions to setup the DMA memory at every transfer.

The ADC1->DR register is 32Bit. So we need 32Bit DMA transfers.

sources:

About

exmaple implementation for a DMA driven ADC driver for the stm32f4 MCUs based on the LL HAL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages