mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-06 18:37:34 +00:00
Added DMA support for ADC
This commit is contained in:
@@ -17,6 +17,17 @@ namespace sta
|
||||
HAL_ADC_Start(handle_);
|
||||
}
|
||||
|
||||
void STM32ADC::startDMA(uint32_t * buffer, size_t length)
|
||||
{
|
||||
STA_ASSERT(buffer != nullptr);
|
||||
STA_ASSERT(length != 0);
|
||||
STA_ASSERT(handle_->DMA_Handle != nullptr);
|
||||
|
||||
HAL_StatusTypeDef res = HAL_ADC_Start_DMA(handle_, buffer, length);
|
||||
|
||||
STA_ASSERT(res == HAL_OK);
|
||||
}
|
||||
|
||||
void STM32ADC::poll(uint32_t timeout)
|
||||
{
|
||||
HAL_StatusTypeDef res = HAL_ADC_PollForConversion(handle_, timeout);
|
||||
|
Reference in New Issue
Block a user