1
0

questions + read adc3

This commit is contained in:
2023-12-12 13:58:11 +01:00
parent 2b9655cdce
commit 01c5606a09
9 changed files with 102 additions and 4 deletions

View File

@ -55,6 +55,7 @@ void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void ADC_IRQHandler(void);
void TIM6_DAC_IRQHandler(void);
void LTDC_IRQHandler(void);
void DMA2D_IRQHandler(void);

14
Core/Src/isrs.cpp Normal file
View File

@ -0,0 +1,14 @@
/*
* isrs.cpp
*
* Created on: Dec 12, 2023
* Author: remi.heredero
*/
#include "stm32f7xx_hal.h"
extern "C" void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef * hadc) {
volatile uint32_t value = HAL_ADC_GetValue(hadc);
}

View File

@ -144,8 +144,13 @@ int main(void)
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
while (1) {
HAL_ADC_Start_IT(&hadc3);
HAL_Delay(2000);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */

View File

@ -116,6 +116,9 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(ARDUINO_A0_GPIO_Port, &GPIO_InitStruct);
/* ADC3 interrupt Init */
HAL_NVIC_SetPriority(ADC_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(ADC_IRQn);
/* USER CODE BEGIN ADC3_MspInit 1 */
/* USER CODE END ADC3_MspInit 1 */
@ -152,6 +155,8 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
HAL_GPIO_DeInit(ARDUINO_A0_GPIO_Port, ARDUINO_A0_Pin);
/* ADC3 interrupt DeInit */
HAL_NVIC_DisableIRQ(ADC_IRQn);
/* USER CODE BEGIN ADC3_MspDeInit 1 */
/* USER CODE END ADC3_MspDeInit 1 */

View File

@ -55,6 +55,7 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
extern ADC_HandleTypeDef hadc3;
extern DMA2D_HandleTypeDef hdma2d;
extern LTDC_HandleTypeDef hltdc;
extern TIM_HandleTypeDef htim6;
@ -201,6 +202,20 @@ void SysTick_Handler(void)
/* please refer to the startup file (startup_stm32f7xx.s). */
/******************************************************************************/
/**
* @brief This function handles ADC1, ADC2 and ADC3 global interrupts.
*/
void ADC_IRQHandler(void)
{
/* USER CODE BEGIN ADC_IRQn 0 */
/* USER CODE END ADC_IRQn 0 */
HAL_ADC_IRQHandler(&hadc3);
/* USER CODE BEGIN ADC_IRQn 1 */
/* USER CODE END ADC_IRQn 1 */
}
/**
* @brief This function handles TIM6 global interrupt, DAC1 and DAC2 underrun error interrupts.
*/