找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2390|回复: 1
打印 上一主题 下一主题
收起左侧

stm32f1系列彩屏驱动,rc522读卡器驱动,代码比较简单,模块引脚链接代码里有备注

[复制链接]
跳转到指定楼层
楼主
ID:331133 发表于 2018-5-16 11:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
以前买过一款建议的开发板,后来又买了一块显示屏和rc522的ic卡读卡模块,我有和客户要过一些资料,然后把资料整合移植到stm32里面去。如果有和我一样的单片机初学者需要,可以一起了解学习。

单片机源程序如下:


  1. #include "system.h"
  2. #include "SysTick.h"
  3. #include "led.h"
  4. #include "usart.h"
  5. #include "tftlcd.h"
  6. #include "RC522.h"
  7. #include "stdio.h"


  8. /*******************************************************************************
  9. * 函 数 名         : main
  10. * 函数功能                   : 主函数
  11. * 输    入         : 无
  12. * 输    出         : 无
  13. *******************************************************************************/
  14. int main()
  15. {
  16.         u8 i=0;
  17.         unsigned char status;
  18.         SysTick_Init(72);
  19.         NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);  //中断优先级分组 分2组
  20.         LED_Init();
  21.         USART1_Init(9600);
  22.         RC522_Pin_Init();
  23.         TFTLCD_Init();                        //LCD初始化
  24.        
  25.         PcdReset();
  26.         PcdAntennaOff();
  27.         PcdAntennaOn();
  28. //        M500PcdConfigISOType('A');
  29.         delay_ms(1000);
  30.         delay_ms(1000);
  31.         FRONT_COLOR=BLACK;
  32.        
  33.        

  34. //        printf("hello world\n");


  35.         LCD_ShowString(10,60,tftlcd_data.width,tftlcd_data.height,24,"12345678");
  36.         LCD_ShowString(10,100,tftlcd_data.width,tftlcd_data.height,16,"Embedded systems engineer");
  37.   LCD_ShowPicture(10,180,200,240,gImage);
  38.          
  39.         while(1)
  40.         {
  41.                 i++;
  42.                 if(i%20==0)
  43.                 {
  44.                         led1=!led1;
  45.                 }
  46.                
  47.                 delay_ms(10);

  48.                          status = PcdRequest(PICC_REQALL, g_ucTempbuf);
  49.                         if (status != MI_OK)
  50.                         {
  51.                                 continue;
  52.                         }
  53.                         status = PcdAnticoll(g_ucTempbuf);//
  54.                         if (status != MI_OK)
  55.                         {    continue;    }
  56. //                        display_cardnum();
  57. //                        LCD_ShowString(10,100,tftlcd_data.width,tftlcd_data.height,16,g_ucTempbuf);
  58.                         LCD_ChangeString(g_ucTempbuf,showchar);
  59.                         LCD_ShowString(10,100,tftlcd_data.width,tftlcd_data.height,16,showchar);

  60.                        
  61.         }
  62.         return 0;
  63. }
复制代码

所有资料51hei提供下载:
FSMC和RC522驱动.zip (464.5 KB, 下载次数: 25)


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏1 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:110903 发表于 2018-8-27 10:34 | 只看该作者
多谢  分享,下载 看看
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表