GD32F103 — 19-DMA ADC

GD32F103 DRG GD-1 19-DMA ADC 示例

GD32F103 — 19-DMA ADC

来源: DRG GD-1 开发板例程
源文件: GD32/drg_gd_1_gd32f103c8t6-master/19-DMA ADC/test/APP/main.c

子模块

  • Firmware
  • test

关键代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <stdio.h>
#include "systick.h"
#include "i2c.h"
#include "oled_i2c.h"
#include "rocker_driver.h"

int main(){
	systick_config();
	i2c_init();
	
	oled_init();
	oled_clear_all();

	char temp_string[20];  // ֵתΪַĽ
	
	oled_show_string(20,0, (uint8_t *)"ROCKER Test", 16);
	
	rocker_init();
	
	//ʾdestination_1destination_2
	while(1){
		// ʾҡ˵Xֵ
		sprintf(temp_string, "X  : %5d", rocker_data[0]);
		oled_show_string(1,2, (uint8_t *)temp_string, 16);

		// ʾҡ˵Yֵ
		sprintf(temp_string, "Y  : %5d", rocker_data[1]);
		oled_show_string(1,4, (uint8_t *)temp_string, 16);
	}
}
最后更新于 Sep 08, 2026 16:03 +0800
世界是你们
使用 Hugo 构建
主题 StackJimmy 设计