ADC已完成
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "initial.h"
|
||||
#include "systick.h"
|
||||
#include <stdint.h>
|
||||
|
||||
extern u16 adc_value[7];
|
||||
|
||||
/*!
|
||||
\brief configure the DMA peripheral
|
||||
@@ -78,7 +80,6 @@ void adc_config(void) {
|
||||
|
||||
/* 使能ADC接口 */
|
||||
adc_enable(ADC0);
|
||||
delay_1ms(1);
|
||||
/* ADC校准 */
|
||||
adc_calibration_enable(ADC0);
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ void rcu_config(void);
|
||||
void adc_config(void);
|
||||
void dma_config(void);
|
||||
|
||||
static volatile uint32_t timer_delay_count = 0; // volatile 很重要!
|
||||
int fputc(int ch, FILE *f); // 声明fputc函数以重载标准库实现
|
||||
|
||||
u8 tle5210b_init(void);
|
||||
|
||||
@@ -34,6 +34,8 @@ OF SUCH DAMAGE.
|
||||
|
||||
#include "gd32c10x.h"
|
||||
#include "systick.h"
|
||||
#include "initial.h"
|
||||
#include <cstdio>
|
||||
|
||||
volatile static uint32_t delay;
|
||||
|
||||
@@ -80,4 +82,4 @@ void delay_decrement(void)
|
||||
if (0U != delay){
|
||||
delay--;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,8 @@ void delay_1ms(uint32_t count);
|
||||
/* delay decrement */
|
||||
void delay_decrement(void);
|
||||
|
||||
void timer_delay_ms(uint32_t ms);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user