Beispiel #1
0
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
{

  if(hadc->Instance==ADC1)
  {
  /* USER CODE BEGIN ADC1_MspDeInit 0 */

  /* USER CODE END ADC1_MspDeInit 0 */
    /* Peripheral clock disable */
    __ADC1_CLK_DISABLE();
  
    /**ADC1 GPIO Configuration    
    PC4     ------> ADC1_IN14
    PC5     ------> ADC1_IN15 
    */
    HAL_GPIO_DeInit(GPIOC, GPIO_PIN_4|GPIO_PIN_5);

    /* Peripheral DMA DeInit*/
    HAL_DMA_DeInit(hadc->DMA_Handle);
  /* USER CODE BEGIN ADC1_MspDeInit 1 */

  /* USER CODE END ADC1_MspDeInit 1 */
  }
  else if(hadc->Instance==ADC2)
  {
  /* USER CODE BEGIN ADC2_MspDeInit 0 */

  /* USER CODE END ADC2_MspDeInit 0 */
    /* Peripheral clock disable */
    __ADC2_CLK_DISABLE();
  
    /**ADC2 GPIO Configuration    
    PB0     ------> ADC2_IN8
    PB1     ------> ADC2_IN9 
    */
    HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0|GPIO_PIN_1);

  /* USER CODE BEGIN ADC2_MspDeInit 1 */

  /* USER CODE END ADC2_MspDeInit 1 */
  }
} 
Beispiel #2
0
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
{

    if (hadc->Instance == ADC1)
    {
        /* USER CODE BEGIN ADC1_MspDeInit 0 */

        /* USER CODE END ADC1_MspDeInit 0 */
        /* Peripheral clock disable */
        __ADC1_CLK_DISABLE();

        /**ADC1 GPIO Configuration    
         PA7     ------> ADC1_IN7
         PC4     ------> ADC1_IN14
         PC5     ------> ADC1_IN15 
         */
        HAL_GPIO_DeInit(GYRO_TEMP_GPIO_Port, GYRO_TEMP_Pin);

        HAL_GPIO_DeInit(GPIOC, GYRO_RATE_Pin | VBAT_Pin);

        /* Peripheral DMA DeInit*/
        HAL_DMA_DeInit(hadc->DMA_Handle);

        /* Peripheral interrupt Deinit*/
        /* USER CODE BEGIN ADC1:ADC_IRQn disable */
        /**
         * Uncomment the line below to disable the "ADC_IRQn" interrupt
         * Be aware, disabling shared interrupt may affect other IPs
         */
        /* HAL_NVIC_DisableIRQ(ADC_IRQn); */
        /* USER CODE END ADC1:ADC_IRQn disable */

        /* USER CODE BEGIN ADC1_MspDeInit 1 */

        /* USER CODE END ADC1_MspDeInit 1 */
    }
    else if (hadc->Instance == ADC2)
    {
        /* USER CODE BEGIN ADC2_MspDeInit 0 */

        /* USER CODE END ADC2_MspDeInit 0 */
        /* Peripheral clock disable */
        __ADC2_CLK_DISABLE();

        /**ADC2 GPIO Configuration    
         PC0     ------> ADC2_IN10
         PC1     ------> ADC2_IN11
         PC3     ------> ADC2_IN13
         PA4     ------> ADC2_IN4
         PA5     ------> ADC2_IN5
         PA6     ------> ADC2_IN6 
         */
        HAL_GPIO_DeInit(GPIOC,
        GPIO_PIN_0 | R_FRONT_RX_Pin | LINE_SENSOR_R1_Pin);

        HAL_GPIO_DeInit(GPIOA,
        LINE_SENSOR_L1_Pin | L_DIAG_RX_Pin | L_FRONT_RX_Pin);

        /* Peripheral interrupt Deinit*/
        /* USER CODE BEGIN ADC2:ADC_IRQn disable */
        /**
         * Uncomment the line below to disable the "ADC_IRQn" interrupt
         * Be aware, disabling shared interrupt may affect other IPs
         */
        /* HAL_NVIC_DisableIRQ(ADC_IRQn); */
        /* USER CODE END ADC2:ADC_IRQn disable */

        /* USER CODE BEGIN ADC2_MspDeInit 1 */

        /* USER CODE END ADC2_MspDeInit 1 */
    }
    else if (hadc->Instance == ADC3)
    {
        /* USER CODE BEGIN ADC3_MspDeInit 0 */

        /* USER CODE END ADC3_MspDeInit 0 */
        /* Peripheral clock disable */
        __ADC3_CLK_DISABLE();

        /**ADC3 GPIO Configuration    
         PC0     ------> ADC3_IN10
         PC2     ------> ADC3_IN12
         PA1     ------> ADC3_IN1
         PA3     ------> ADC3_IN3 
         */
        HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0 | LINE_SENSOR_R2_Pin);

        HAL_GPIO_DeInit(GPIOA, LINE_SENSOR_F_Pin | LINE_SENSOR_L2_Pin);

        /* Peripheral interrupt Deinit*/
        /* USER CODE BEGIN ADC3:ADC_IRQn disable */
        /**
         * Uncomment the line below to disable the "ADC_IRQn" interrupt
         * Be aware, disabling shared interrupt may affect other IPs
         */
        /* HAL_NVIC_DisableIRQ(ADC_IRQn); */
        /* USER CODE END ADC3:ADC_IRQn disable */

        /* USER CODE BEGIN ADC3_MspDeInit 1 */

        /* USER CODE END ADC3_MspDeInit 1 */
    }
}