- 收藏
- 点赞
- 分享
- 举报
SIM900+STM32+MP3+3.2寸LCD原理图SCH
[code]下面是我打电话的程序
include "gprs.h"
include "LCD_Drive.h"
include "usart.h"
include "Touch.h"
extern void Delay_Ms(uint16_t time);
extern void Delay_Us(uint16_t time);
extern void Refreshes_Screen(void);
void gprs_delay(void)
{
unsigned int x,y;
for(x = 0;x<100;x++)
for(y = 500; y>0;y--);
}
void GPRS_init(void)
{
unsigned char buf[256];
printf("AT\r\n");
GSM_getstr(buf);
gprs_delay();
printf("ATE0\r\n");
GSM_getstr(buf);
gprs_delay();
printf("AT+CGMI\r\n"); //厂家信
GSM_getstr(buf);
gprs_delay();
printf("AT+CGMM\r\n"); //获得模块标识
GSM_getstr(buf);
gprs_delay();
printf("AT+CGMR\r\n"); //获得改订的软件版
GSM_getstr(buf);
gprs_delay();
printf("AT+CGSN\r\n");//获得GSM模块的IMEI(国际移动设备标识)序列号
GSM_getstr(buf);
gprs_delay();
printf("AT+CIMI\r\n");//获得IMSI
GSM_getstr(buf);
Disp_LCDString((240-sizeof("GPRS_INIT->OK")8)/2,0,"GPRS_INIT->OK");
if(buf[0] == 'O')
gprs_delay();
}
unsigned char GPRS_GETNUM(void)
{
unsigned char buf[256],num = 0;
printf("拨号开始!!!");//获得IMSI
while(1)
{
if(Pen_Point.Key_Sta==Key_Down)//触摸屏被按下
{
Pen_Int_Set(0); //关闭中断
do
{
Convert_Pos();
Pen_Point.Key_Sta=Key_Up;
if((Pen_Point.X0>=11) && (Pen_Point.X0 <= 73) && (Pen_Point.Y0>=53)&&(Pen_Point.Y0<=91))
{
buf[num] = '1';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=89) && (Pen_Point.X0 <= 154) && (Pen_Point.Y0>=53)&&(Pen_Point.Y0<=91))
{
buf[num] = '2';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=170) && (Pen_Point.X0 <= 231) && (Pen_Point.Y0>=53)&&(Pen_Point.Y0<=91))
{
buf[num] = '3';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=11) && (Pen_Point.X0 <= 73) && (Pen_Point.Y0>=102)&&(Pen_Point.Y0<=140))
{
buf[num] = '4';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=89) && (Pen_Point.X0 <= 154) && (Pen_Point.Y0>=102)&&(Pen_Point.Y0<=140))
{
buf[num] = '5';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=170) && (Pen_Point.X0 <= 231) && (Pen_Point.Y0>=102)&&(Pen_Point.Y0<=140))
{
buf[num] = '6';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=11) && (Pen_Point.X0 <= 73) && (Pen_Point.Y0>=151)&&(Pen_Point.Y0<=188))
{
buf[num] = '7';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=89) && (Pen_Point.X0 <= 154) && (Pen_Point.Y0>=102)&&(Pen_Point.Y0<=188))
{
buf[num] = '8';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=170) && (Pen_Point.X0 <= 231) && (Pen_Point.Y0>=102)&&(Pen_Point.Y0<=188))
{
buf[num] = '9';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=11) && (Pen_Point.X0 <= 73) && (Pen_Point.Y0>=201)&&(Pen_Point.Y0<=239))
{
buf[num] = '';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=89) && (Pen_Point.X0 <= 154) && (Pen_Point.Y0>=201)&&(Pen_Point.Y0<=239))
{
buf[num] = '0';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=170) && (Pen_Point.X0 <= 231) && (Pen_Point.Y0>=201)&&(Pen_Point.Y0<=239))
{
buf[num] = '#';
buf[num + 1]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
num++;
}
else if((Pen_Point.X0>=11) && (Pen_Point.X0 <= 73) && (Pen_Point.Y0>=249)&&(Pen_Point.Y0<=287))
{
printf("ATH\r\n");
num = 0;
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(68))/2,25,"nocall");
}
else if((Pen_Point.X0>=89) && (Pen_Point.X0 <= 154) && (Pen_Point.Y0>=249)&&(Pen_Point.Y0<=287))
{
printf("ATD%s;\r\n",buf);
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(48))/2,25,"call");
buf[0]='\0';
num = 0;
}
else if((Pen_Point.X0>=170) && (Pen_Point.X0 <= 231) && (Pen_Point.Y0>=249)&&(Pen_Point.Y0<=287))
{
num--;
buf[num]='\0';
Disp_LCDString((240-(num8))/2,25," ");
Disp_LCDString((240-(num8))/2,25,buf);
}
Delay_Ms(400);
GPIOC->ODR|=1<<5; //PC5 上拉
}while(PEN==0);//如果PEN一直有效,则一直执行
Pen_Int_Set(1);//开启中断
}
else Delay_Ms(1);
// if(Key==USER)//USER按下,则执行校准程序
// {
// Clear_LCD(BlackColor);//清屏
// Touch_Adjust(); //屏幕校准
// Save_Adjdata();
// Refreshes_Screen();
// }
}
}
[/code]
做了一套基于stm32的类似手机的小耍耍,大家如果感兴趣可以看看,本来想弄个ucos上跑个系统但是一直没有空去弄如果感兴趣可以玩玩; 给大家上点图 [attach]1273[/attach] [attach]1274[/attach]
原帖http://www.amobbs.com/forum.php?mod=viewthread&tid=5471741&extra=page%3D1%26filter%3Ddigest%26digest%3D1
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
-
2013-12-10 20:07:17
-
2013-06-27 22:34:29
-
2013-09-22 15:57:00
-
2018-10-24 16:22:36
-
2018-12-06 17:13:48
-
2013-12-23 22:13:43
-
2013-11-20 20:17:23
-
2010-06-01 23:11:38
-
2008-09-28 20:04:26
-
2016-03-20 06:44:39
-
2013-08-25 11:37:15
-
2013-11-18 10:09:30
-
2013-12-14 11:40:23
-
2013-11-30 12:43:16
-
2013-08-25 19:30:11
-
2020-11-22 18:52:46
-
2013-11-29 22:23:19
-
2014-10-21 15:23:19
-
2013-12-05 21:53:51
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明