芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

飞芯科技-芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

芯片复制stm32f103zet6的简易计算器源码

代码如下:

  1. 芯片复制#include "led.h"
  2. 芯片复制#include "delay.h"
  3. 芯片复制#include "key.h"
  4. #include "sys.h"
  5. #include "lcd.h"
  6. #include "usart.h"     
  7. #include "24cxx.h"
  8. #include "w25qxx.h"
  9. #include "touch.h"



  10. int aa = 0;

  11. //清空屏幕并在右上角显示"RST"
  12. void Load_Drow_Dialog(void)
  13. {
  14.     LCD_Clear(WHITE);    //清屏   
  15.      POINT_COLOR=BLUE;    //设置字体为蓝色
  16.     LCD_ShowString(lcddev.width-24,0,200,16,16,"RST");//显示清屏区域
  17.   POINT_COLOR=RED;    //设置画笔蓝色
  18. }
  19. ////////////////////////////////////////////////////////////////////////////////
  20. //电容触摸屏专有部分
  21. //画水平线
  22. //x0,y0:坐标
  23. //len:线长度
  24. //color:颜色
  25. void gui_draw_hline(u16 x0,u16 y0,u16 len,u16 color)
  26. {
  27.     if(len==0)return;
  28.     LCD_Fill(x0,y0,x0+len-1,y0,color);   
  29. }
  30. //画实心圆
  31. //x0,y0:坐标
  32. //r:半径
  33. //color:颜色
  34. void gui_fill_circle(u16 x0,u16 y0,u16 r,u16 color)
  35. {                                             
  36.     u32 i;
  37.     u32 imax = ((u32)r*707)/1000+1;
  38.     u32 sqmax = (u32)r*(u32)r+(u32)r/2;
  39.     u32 x=r;
  40.     gui_draw_hline(x0-r,y0,2*r,color);
  41.     for (i=1;i<=imax;i++)
  42.     {
  43.         if ((i*i+x*x)>sqmax)// draw lines from outside  
  44.         {
  45.              if (x>imax)
  46.             {
  47.                 gui_draw_hline (x0-i+1,y0+x,2*(i-1),color);
  48.                 gui_draw_hline (x0-i+1,y0-x,2*(i-1),color);
  49.             }
  50.             x--;
  51.         }
  52.         // draw lines from inside (center)  
  53.         gui_draw_hline(x0-x,y0+i,2*x,color);
  54.         gui_draw_hline(x0-x,y0-i,2*x,color);
  55.     }
  56. }  
  57. //两个数之差的绝对值
  58. //x1,x2:需取差值的两个数
  59. //返回值:|x1-x2|
  60. u16 my_abs(u16 x1,u16 x2)
  61. {            
  62.     if(x1>x2)return x1-x2;
  63.     else return x2-x1;
  64. }  
  65. //画一条粗线
  66. //(x1,y1),(x2,y2):线条的起始坐标
  67. //size:线条的粗细程度
  68. //color:线条的颜色
  69. void lcd_draw_bline(u16 x1, u16 y1, u16 x2, u16 y2,u8 size,u16 color)
  70. {
  71.     u16 t;
  72.     int xerr=0,yerr=0,delta_x,delta_y,distance;
  73.     int incx,incy,uRow,uCol;
  74.     if(x1<size|| x2<size||y1<size|| y2<size)return;
  75.     delta_x=x2-x1; //计算坐标增量
  76.     delta_y=y2-y1;
  77.     uRow=x1;
  78.     uCol=y1;
  79.     if(delta_x>0)incx=1; //设置单步方向
  80.     else if(delta_x==0)incx=0;//垂直线
  81.     else {incx=-1;delta_x=-delta_x;}
  82.     if(delta_y>0)incy=1;
  83.     else if(delta_y==0)incy=0;//水平线
  84.     else{incy=-1;delta_y=-delta_y;}
  85.     if( delta_x>delta_y)distance=delta_x; //选取基本增量坐标轴
  86.     else distance=delta_y;
  87.     for(t=0;t<=distance+1;t++ )//画线输出
  88.     {  
  89.         gui_fill_circle(uRow,uCol,size,color);//画点
  90.         xerr+=delta_x ;
  91.         yerr+=delta_y ;
  92.         if(xerr>distance)
  93.         {
  94.             xerr-=distance;
  95.             uRow+=incx;
  96.         }
  97.         if(yerr>distance)
  98.         {
  99.             yerr-=distance;
  100.             uCol+=incy;
  101.         }
  102.     }  
  103. }   



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.feixindz.com
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信