- 收藏
- 点赞
- 分享
- 举报
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
-
2016-03-20 06:44:39
-
2008-09-28 20:04:26
-
2013-11-18 10:09:30
-
2013-08-25 11:37:15
-
2013-08-25 19:30:11
-
2013-12-14 11:40:23
-
2013-11-30 12:43:16
-
2014-10-21 15:23:19
-
2020-11-22 18:52:46
-
2013-11-29 22:23:19
-
372012-11-29 20:59:20
-
5SS928的emmc有32GB,bootargs设置使用16GB,但是为啥能用的只有rootfs的大小
-
33SS928怎样烧写ubuntu系统
-
10ToolPlatform下载rootfs提示网络失败
-
10谁有GK7205V500的SDK
-
5Hi3516CV610 烧录不进去
-
10Hi3559AV100 芯片硬解码h265编码格式的视频时出现视频播放错误,解码错误信息 s32PackErr:码流有错
-
5海思SS928 / SD3403的sample_venc.c摄像头编码Demo中,采集到的摄像头的YUV数据在哪个相关的函数中?
-
5海鸥派openEuler无法启动网卡,连接WIFI存在问题
-
66有没有ISP相关的巨佬帮忙看看SS928对接IMX347的图像问题
-
50求助hi3559与FPGA通过SLVS-EC接口对接问题
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明