questions + read adc3
This commit is contained in:
14
Core/Src/isrs.cpp
Normal file
14
Core/Src/isrs.cpp
Normal 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);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user