123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- #include "main.h"
- void HAL_MspInit(void)
- {
-
-
- __HAL_RCC_SYSCFG_CLK_ENABLE();
- __HAL_RCC_PWR_CLK_ENABLE();
-
-
-
- }
- void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
- {
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- if(hadc->Instance==ADC1)
- {
-
-
-
- __HAL_RCC_ADC1_CLK_ENABLE();
- __HAL_RCC_GPIOA_CLK_ENABLE();
-
- GPIO_InitStruct.Pin = GPIO_PIN_4;
- GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
-
-
- }
- }
- void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
- {
- if(hadc->Instance==ADC1)
- {
-
-
-
- __HAL_RCC_ADC1_CLK_DISABLE();
-
- HAL_GPIO_DeInit(GPIOA, GPIO_PIN_4);
-
-
- }
- }
|