XMC — 16 位并口 LCD + 触摸
固件库: AT32F403A_407_Firmware_Library V2.2.2
芯片: AT32
源文件: AT32/AT32F403A_407_Firmware_Library_V2.2.2/project/at_start_f403a/examples/xmc/lcd_touch_16bit/src/main.c
功能简介
本示例演示外部存储控制器。XMC/EXMC 可以连接并口 LCD、NAND Flash、SRAM 等外部总线设备,实现高速数据传输。
完整代码
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
31
32
|
#include "at32f403a_407_board.h"
#include "at32f403a_407_clock.h"
#include "xmc_lcd.h"
#include "touch.h"
int main(void)
{
touch_struct = &touch_dev_struct;
lcd_struct = &lcd_dev_struct;
system_clock_config();
at32_board_init();
/* get system clock */
crm_clocks_freq_get(&crm_clocks_freq_struct);
/* turn led2/led3/led4 on */
at32_led_on(LED2);
at32_led_on(LED3);
at32_led_on(LED4);
lcd_struct->lcd_init();
point_color = GREEN;
lcd_struct->lcd_clear(point_color);
touch_struct->init();
while(1)
{
touch_struct->touch_scan();
}
}
|
代码讲解
系统时钟初始化:配置 MCU 的主频和时钟树。不同芯片的时钟配置不同,一般由工具生成。
板级初始化:初始化开发板上的 LED、按键等基础外设。