main.c
来自「博创2410的实验代码」· C语言 代码 · 共 33 行
C
33 行
#include "inc/macro.h"
#include "inc/KeyBoard.h"
#include <string.h>
#include <stdio.h>
#include "inc/Uart.h"
#include "inc/lcd.h"
#include "inc/reg2410.h"
#include "inc/iic.h"
#include "inc/uhal.h"
#include "inc/lib.h"
#pragma import(__use_no_semihosting_swi) // ensure no functions that use semihosting
int main(void)
{ U8 key;
ARMTargetInit(); // do target (uHAL based ARM system) initialisation //
Key_init();//键盘初始化
while(1)
{key=GetKey();//获得键盘映射值
Led_IIC_init(); //LED IIC初始化,设置2410为主发送模式
hudelay(100); //延迟
IIC_Write(0x70, 0x0d, 0); //数码管全部熄灭
IIC_Write(0x70, 0x10, key); //数码管显示键盘号
hudelay(2000);
Key_init_restor(); //初始化IIC,设置IIC模式
hudelay(100);
}
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?