Title | SIM908 Embedded AT Application Note V1 01 |
---|---|
Author | Pandian Nano |
Pages | 72 |
File Size | 471.4 KB |
File Type | |
Total Downloads | 155 |
Total Views | 347 |
Download SIM908 Embedded AT Application Note V1 01 PDF
SIM908_Embedded AT® Application Note V1.01
Smart Machine Smart Decision
Document Title:
SIM908_Embedded AT® Application Note
Version:
V1.01
Date:
2012-02-13
Status:
Release
Document Control ID:
SIM908_Embedded AT® Application Note_V1.01
General Notes SIMCom offers this information as a service to its customers, to support application and engineering efforts that use the products designed by SIMCom. The information provided is based upon requirements specifically provided to SIMCom by the customers. SIMCom has not undertaken any independent search for additional relevant information, including any information that may be in the customer’s possession. Furthermore, system validation of this product designed by SIMCom within a larger electronic system remains the responsibility of the customer or the customer’s system integrator. All specifications supplied herein are subject to change. Copyright This document contains proprietary technical information which is the property of Shanghai SIMCom Wireless Solutions Ltd, copying of this document and giving it to others and the using or communication of the contents thereof, are forbidden without express authority. Offenders are liable to the payment of damages. All rights reserved in the event of grant of a patent or the registration of a utility model or design. All specification supplied herein are subject to change without notice at any time. Copyright © Shanghai SIMCom Wireless Solutions Ltd. 2012
SIM908_Embedded AT®_Application Note_V1.01
1
2/13/2012
Smart Machine Smart Decision
CONTENTS 1 Introduction....................................................................................................................................7 1.1 Purpose ...............................................................................................................................7 1.2 Coding style ........................................................................................................................7 1.3 References...........................................................................................................................7 1.4 Glossary ..............................................................................................................................7 1.5 Abbreviations ......................................................................................................................7 2 Description.....................................................................................................................................9 2.1 Software Architecture..........................................................................................................9 2.1.1 Software Organization..............................................................................................9 2.2.2 Resource Supplied by SIMCom.............................................................................10 2.2.3 Software Supplied by SIMCom .............................................................................10 2.2 Minimum Embedded Application Code............................................................................10 2.3 fl_entry() ...........................................................................................................................11 2.4 Embedded AT Memory resources .....................................................................................11 3 EVENT ........................................................................................................................................11 3.1 EVENT Type.....................................................................................................................11 3.1.1 FlEventType ...........................................................................................................11 3.1.2 EVENT_INTR .......................................................................................................12 3.1.3 EVENT_KEY ........................................................................................................12 3.1.4 EVENT_UARTDATA............................................................................................12 3.1.5 EVENT_MODEMDATA .......................................................................................12 3.1.6 EVENT_TIMER ....................................................................................................13 3.1.7 EVENT_SERIALSTATUS ....................................................................................13 3.1.8 EVENT_SOCKET .................................................................................................13 3.1.9 EVENT_GPS_DATA .............................................................................................13 3.1.10 EVENT_GPS_NMEA_DATA .............................................................................13 3.1.11 Example................................................................................................................13 3.2 EVENT Data .....................................................................................................................14 3.2.1 EventData...............................................................................................................14 3.2.2 TIMER_EVT..........................................................................................................14 3.2.3 KEY_EVT..............................................................................................................14 3.2.4 UARTDATA_EVT .................................................................................................15 3.2.5MODEMDATA_EVT .............................................................................................15 3.2.6 INTR_EVT.............................................................................................................16 3.2.7 SERIALSTATUS_EVT..........................................................................................16 3.2.8 SOCKETEVENT_EVT .........................................................................................17 3.2.9 GPSDATA_EVT ....................................................................................................18 3.2.10 GPSNMEADATA_EVT.......................................................................................19 3.3 Examples...........................................................................................................................20 4 API ...............................................................................................................................................21 4.1 Data Types.........................................................................................................................21 SIM908_Embedded AT®_Application Note_V1.01
2
2/13/2012
Smart Machine Smart Decision
4.2 System API........................................................................................................................21 4.2.1 eat1_02GetEvent ....................................................................................................21 4.2.2 ebdat4_01GetMemory............................................................................................22 4.2.3 ebdat4_02FreeMemory ..........................................................................................22 4.2.4 ebdat4_03Reset ......................................................................................................23 4.2.5 ebdat4_04Wdtkick .................................................................................................23 4.2.6 ebdat4_05PowerDown ...........................................................................................23 4.2.7 eat1_09UpdateEmbeddedAp..................................................................................23 4.2.8 ebdat6_17DisablePowerOffKey.............................................................................24 4.2.9 ebdat6_18EnablePowerOffKey..............................................................................24 4.3 FLASH API.......................................................................................................................24 4.3.1 ebdat3_05FlashGetLen ..........................................................................................24 4.3.2 ebdat3_06FlashDelete ............................................................................................25 4.3.3 ebdat3_07FlashGetFreeSize...................................................................................25 4.3.4 ebdat3_03FlashWriteData ......................................................................................25 4.3.5 ebdat3_04FlashReadData.......................................................................................26 4.3.6 ebdat3_08FlashFileRead ........................................................................................26 4.3.7 ebdat3_09FlashFileWrite .......................................................................................27 4.3.8 ebdat3_10FlashFileDelete......................................................................................28 4.3.9 ebdat3_11FlashFileGetLen ....................................................................................28 4.4 Periphery API....................................................................................................................28 4.4.1 Module Pins ...........................................................................................................28 4.4.2 Periphery functions ................................................................................................29 4.4.3 Periphery-SPI .........................................................................................................31 4.4.5 Periphery interrupt .................................................................................................33 4.4.6 Periphery square wave ...........................................................................................34 4.4.7 Periphery-Buzzer....................................................................................................36 4.4.8 Periphery-GPIO .....................................................................................................37 4.4.9 Periphery-Keypad ..................................................................................................38 4.5 Audio API..........................................................................................................................39 4.5.1 ebdat10_01PlayContinousAudio............................................................................39 4.5.2 ebdat10_02StopContinousAudio ...........................................................................39 4.5.3 ebdat10_03PlaySingleAudio..................................................................................39 4.5.4 ebdat10_04PlaySingleAudioFromFile ...................................................................40 4.5.5 AUDIO TRACKS ..................................................................................................40 4.6 TIMER API .......................................................................................................................42 4.6.1 Timer structure .......................................................................................................42 4.6.2 ebdat8_01StartTimer ..............................................................................................42 4.6.3 ebdat8_02StopTimer ..............................................................................................43 4.6.4 ebdat8_04SecondToTicks ......................................................................................43 4.6.5 ebdat8_05MillisecondToTicks ...............................................................................43 4.6.6 ebdat8_03GetRelativeTime....................................................................................44 4.6.7 ebdat8_06GetSystemTime .....................................................................................44 SIM908_Embedded AT®_Application Note_V1.01
3
2/13/2012
Smart Machine Smart Decision
4.6.8 ebdat8_08GetSystemTickCounter..........................................................................45 4.7 FCM API ...........................................................................................................................46 4.7.1 ebdat9_01SendToModem.......................................................................................47 4.7.2 ebdat9_02SendToSerialPort ...................................................................................47 4.7.3 ebdat9_03SetModemdataToFL ..............................................................................47 4.7.4 The ebdat9_04SetUartdataToFL function ..............................................................48 4.7.5 ebdat9_05GetSerialPortTxStatus ...........................................................................48 4.7.6 ebdat6_23GetRTSPinLevel....................................................................................48 4.7.7 ebdat9_09ChangeMainUartBaudRate....................................................................49 4.7.8 ebdat9_10GetMainUartBaudRate ..........................................................................49 4.7.9 ebdat9_11ChangeMainUartDataFormat.................................................................49 4.7.10 ebdat9_12GetMainUartDataFormat.....................................................................50 4.7.11 ebdat9_13ChangeMainUartFlowControl .............................................................51 4.7.12 ebdat9_14GetMainUartFlowControl ...................................................................51 4.7.13 ebdat9_15SubscribeURC .....................................................................................51 4.7.14 ebdat9_16UnSubscribeURC ................................................................................52 4.7.15 ebdat9_17GetURCNum .......................................................................................52 4.7.16 ebdat9_19SubscribeATCommand........................................................................53 4.7.17 ebdat9_20UnsubscribeATCommand....................................................................53 4.8 Debug API.........................................................................................................................54 4.8.1 ebdat7_00EnterDebugMode...................................................................................54 4.8.2 ebdat7_01DebugTrace ...........................................................................................54 4.8.3 ebdat7_02DebugUartSend .....................................................................................54 4.9 Standard Library API ........................................................................................................55 4.9.1 Standard input/output functions .............................................................................55 4.9.2 ebdat4_10strRemoveCRLF....................................................................................55 4.9.3 ebdat4_11strGetParameterString............................................................................56 4.9.4 ebdat6_17DisablePowerOffKey.............................................................................56 4.9.5 ebdat6_18EnablePowerOffKey..............................................................................56 4.9.6 ebdat4_15ExitOutOfSleepMode ............................................................................57 4.9.7 ebdat4_17EnterSleepMode ....................................................................................57 4.10 SOCKET API ..................................................................................................................57 4.10.1 ebdat11_10GprsActive.........................................................................................57 4.10.2 ebdat11_15GprsDeactive .....................................................................................58 4.10.3 ebdat11_20SocketConnect ...................................................................................58 4.10.4 ebdat11_25SocketClose .......................................................................................59 4.10.5 ebdat11_30SocketSend ........................................................................................59 4.10.6 ebdat11_35SocketRecv ........................................................................................60 4.10.7 ebdat11_45SocketTcpServerSet ...........................................................................61 4.11 GPS API ..........................................................................................................................61 4.12 Error Codes .....................................................................................................................63 4.13 Updating Embedded Application ....................................................................................63 5 AT+CRWP...................................................................................................................................66 SIM908_Embedded AT®_Application Note_V1.01
4
2/13/2012
Smart Machine Smart Decision
Appendix A: SIMCom module pins ...............................................................................................67 Appendix B: Example.....................................................................................................................68
SIM908_Embedded AT®_Application Note_V1.01
5
2/13/2012
Smart Machine Smart Decision
Revision history Revision
Date
Description of change
Author
1.01
2012-02-13
Initial
Chenyang
SIM908_Embedded AT®_Application Note_V1.01
6
2/13/2012
Smart Machine Smart Decision
1 Introduction 1.1 Purpose Based on ARM926EJ_S core, SIM908 runs at 156 MHz, and has redundant MIPS to run programs other than telecommunication protocols. Embedded AT is for fully utilizing SIM908 resources, providing interfaces to move some external MCU functions into itself, so as to save customer’s cost. The programming idea of Embedded AT is to think from MCU side and to be consistent with the MCU programming style.
1.2 Coding style The function name of EMBEDDED AT consists of two parts, one is the file name index part, and the other is the function number of the file. For example, “ebdat4_01GetMemory”, 4 is the file name index part, and 01 is the function number of the file. It is very easy for the user or the SIMCom developers to trace problems this way.
1.3 References Document: SIM908_AT Command Manual_V1.02
1.4 Glossary
Glossary
Description
Embedded Application API
Software interfaces developed by SIMCom and open to licensed embedded application developers. The APIs include audio API, FCM API, flash API, system API, periphery API, STDLIB API, timer API and debug API
Embedded Application
User created application that utilizes Embedded API functions to interact with SIMCom core software, only to run on a SIMCom product
SIMCom Core System
The Core system released by SIMCom, which includes the core binary file and SIMCom library
EVENT
Capitalized EVENT notion used in this document represents specified system EVENT in embedded application. See Chapter 3 EVENT for EVENT definition
1.5 Abbreviations Abbreviation
Description
API
Application Programming Interface
CPU
Central Processing Unit
FCM