2
0
Fork 0
geforkt von trocache/RefKEIL

Renamed adcdriver, added base struct

Dieser Commit ist enthalten in:
Yohan Boujon 2023-03-22 17:01:14 +01:00
Ursprung d015a139e1
Commit 271f6ee4d7
5 geänderte Dateien mit 13 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -1 +0,0 @@
#include "adc.h"

Datei anzeigen

@ -1,5 +0,0 @@
#ifndef ADCDRIVER_H
#define ADCDRIVER_H
#include "stm32f10x.h"
#endif

Datei anzeigen

@ -0,0 +1 @@
#include "adcdriver.h"

Datei anzeigen

@ -0,0 +1,10 @@
#ifndef ADCDRIVER_H
#define ADCDRIVER_H
#include "stm32f10x.h"
typedef struct
{
GPIO_TypeDef * ADC; //ADC 1 or 2
} MyADC_Struct_TypeDef;
#endif

Datei anzeigen

@ -15,8 +15,8 @@ int main (void)
MyGPIO_Init(&led);
MyGPIO_Init(&adc);
RCC->CFGR |= (0x2<<ADCPRE); // ADC Prescaler : divided by 6 -> 72MHz to 12MHz
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN;
RCC->CFGR |= RCC_CFGR_ADCPRE_1;// ADC Prescaler : divided by 6 -> 72MHz to 12MHz
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN; //We activate the clock first
//ADC1->CR1 |= (0x0<<24); //Resolution 12bit -> 00