您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 电子设计/PCB > ARM9教程DSP教程FPGA教程CPLD教程8A软硬件设计0229
第1页共7页ARM9教程DSP教程FPGA教程CPLD教程8A多核软硬件系统设计第一部分原理图1.1SMS.SchDocSetCLK_BRDto50MHzSRAM0_ESRAM0_A[17..0]SRAM0_WSRAM0_OESRAM0_UBSAMSUNGK6R4016V1D-TC10SRAM0_D[15..0]SRAM0_LBCLK_IRST_IUARTTFTSRAM_MEM1SRAM_MEM0BUTTONSU_SMS_SystemSMS_System.OpenBusSRAM1_ESRAM1_A[17..0]SRAM1_WSRAM1_OESRAM1_UBSAMSUNGK6R4016V1D-TC10SRAM1_D[15..0]SRAM1_LBDAU_TFT_MDAU_TFT_POLDAU_TFT_STHDAU_TFT_STVDAU_TFT_DISP_ONDAU_TFT_BLIGHTDAU_TFT_MUXDAU_TFT_RED[4..0]DAU_TFT_GREEN[5..0]DAU_TFT_BLUE[4..0]DAU_TFT_CL[3..1]D[15..0]A[17..0]CEWEOEUBLBD[15..0]A[17..0]CEWEOEUBLBRED[4..0]GREEN[5..0]BLUE[4..0]CL[3..1]DISP_ONMPOLSTHSTVVCCTXDRXDCTSRTSGSM_RXDGSM_TXDGNDGPS_TROGPS_BINOGPS_BINIGPS_TRIGSM_DTRPWR_ONLEDS[7..0]GSM_RIGSM_DSRGSM_DCDGSM_RTSGSM_STATGSM_ON_OFFSW_USER0U1INVI0I1I2I3I4I5[2..0]O[7..0]U2BUS_JSPAO[7..0]PAI[7..0]I0I1I2[5..0]O[7..0]U3BUS_JSGNDGNDGSM_STATGSM_STATSW_USER4CLKDELAY[7..0]INITU5FPGA_STARTUP8VCCCLK_BRDTEST_BUTTONU4OR2SThisProjectsdemonstratestheuseofMODEMservice.ThisdesignrequiresPB07.03第2页共7页1.2SMS_System.OpenBusIOMEMSRAMTFT01UARTBUTTONS第3页共7页1.3main.c/*************************************************************************|*|*VERSIONCONTROL:$Version$$Date$|*|*|*INPACKAGE:SMSengineMain|*|*COPYRIGHT:Copyright(c)2008,PurPer|*|*DESCRIPTION:SMSmodule,readincommingmessagesand|*processthem...|**/#includestdlib.h#includestdio.h#includestring.h#includetime.h#includedevices.h#includemodem.h//Modemcommunication#includesms.h//SMSmessagehandling#includegraphics.h#includetextdisplay.h#defineSMSC_INTERNATIONAL0x91#defineMDM_PINCODE\0000\posix_devctl_textdisplay_impl_ttextio;graphics_t*graph;//Interfacetographicsservices第4页共7页modem_t*modem;voidwelcome(void){if(!modem_send_init(modem)){printf(\nToturnONGSMmoduleonPB07,\n);printf(holdSW1buttonfor1secondor\n);printf(untiltheLEDSundertheSW\nbuttonsflashup.\n);printf(\n);}while(!modem_send_init(modem));}voidinit(void){graph=graphics_open(GRAPHICS_1);//InstalldevicespecificfunctionsthroughPOSIXdevicecontrolposix_devctl(fileno(stdout),DEVCTL_TEXTDISPLAY_IMPL,(void*)&textio,sizeof(textio),NULL);}/*********************************************************************************FUNCTION:main**DESCRIPTION:waitforsomeonetocall,askhim/herforapassword;*playawavefileafteravalidpassword.*第5页共7页*/intmain(intargc,char*argv[]){inti=0;intmem_location;charpdu_message[SMS_MSG_SIZE];charnew_message[SMS_MSG_SIZE];smsg_tsms_message;init();//Initializemodemprintf(\nInitializingModem...\n);modem=modem_open(MODEM_1);welcome();if(!modem_echo_off(modem))i=2;if(!modem_enter_pin(modem,MDM_PINCODE))i=3;if(!modem_set_pdu_mode(modem))i=4;if(i==0){printf(\nModemreadytoreceivemessages...\n);do{mem_location=modem_get_sms(modem,pdu_message);if(mem_location){sms_pdu_decode(pdu_message,&sms_message);printf(time:%s\nfrom:%s(type%2.2x)\ndata:'%s'\n,sms_message.timestamp,sms_message.from,第6页共7页sms_message.addr_type,sms_message.message);if(sms_message.addr_type==SMSC_INTERNATIONAL){sprintf(new_message,NB2Recvd:%s,sms_message.message);sms_pdu_encode(new_message,sms_message.from,pdu_message);modem_send_sms(modem,pdu_message);}modem_remove_sms_message(modem,mem_location);}}while(1);}printf(Errorcode:%d\n,i);returni;}第7页共7页1.4SMS.SwPlalform
本文标题:ARM9教程DSP教程FPGA教程CPLD教程8A软硬件设计0229
链接地址:https://www.777doc.com/doc-50765 .html