###################################################
-all: libstm32f4.a $(PROJ_NAME).elf fft_test.elf dac_ut.elf dac_play.elf
+all: libstm32f4.a $(PROJ_NAME).elf fft_test.elf dac_ut.elf dac_play.elf adc_ut.elf
dl/$(PERIPHLIBZIP):
mkdir -p dl
dac_play.elf: $(DAC_PLAY_SRCS)
$(CC) $(CFLAGS) -O0 $^ -o $@ $(LIBPATHS) $(LIBS)
+ADC_UT_SRCS=\
+gdb_stdio.c \
+src/stm32f4_adc.c \
+src/system_stm32f4xx.c \
+src/startup_stm32f4xx.s \
+src/init.c
+
+adc_ut.elf: $(ADC_UT_SRCS)
+ $(CC) $(CFLAGS) -O0 $^ -o $@ $(LIBPATHS) $(LIBS)
+
clean:
rm -f *.o
rm -f *.elf
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_OCInitTypeDef TIM_OCInitStructure;
+unsigned short uhADCxConvertedValue;
+
static void ADC_Config(void);
void Timer1Config();
static void TIM_Config(void);
int main(void) {
+ /* check ADC value changes with GND and VCC sampled */
+ /* look for 17kHz (ish) on timer pins */
+
ADC_Config();
+ Timer1Config();
+
+ /* todo: that start up cmd here */
+
+ while(1) {
+ printf("ADC; %d\n", uhADCxConvertedValue);
+ }
+
}
/**
/* ADC3 regular channel7 configuration *************************************/
ADC_RegularChannelConfig(ADCx, ADC_CHANNEL, 1, ADC_SampleTime_3Cycles);
- /* Enable DMA request after last transfer (Single-ADC mode) */
+ /* Enable DMA request after last transfer (Single-ADC mode) */
ADC_DMARequestAfterLastTransferCmd(ADCx, ENABLE);
/* Enable ADC3 DMA */