Voilier/Drivers/Sources/Driver_ADC.c
2023-03-22 16:33:46 +01:00

23 lines
449 B
C

#include "Driver_ADC.h"
void MyADC_Base_Init(MyADC_Struct_TypeDef * ADC){
RCC->CFGR |= RCC_CFGR_ADCPRE_DIV6; //Division par 6 de la clock (72MHz) pour l'ADC (14MHz max)
if(ADC->ADC == ADC1){
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN; //Enable Clock ADC1
ADC1->CR2= ADC_CR2_ADON; //Enable ADC1
ADC1->SQR1&= ADC_SQR1_L;
ADC1->SQR3|= 8;
}else{
}
}
void MyADC_Base_Start(ADC_TypeDef * ADC){
}
void MyADC_Base_Stop(ADC_TypeDef * ADC){
}