mtk平台mmi培训资料(中文)
MTK软件培训课程(三)MTK驱动架构分析精品PPT课件

GDI和pixtel_UI的关系
GDI的实现
使用GDI_HANDLE,gdi_handle来操作 GDI对象,GDI的对象可以是layer,gif, jpeg等。 GDI函数返回一个GDI_RESULT GDI函数使用互斥来保护,进入GDI函数 时调用GDI_ENTER_CRITICAL_SECTION()退 出函数时调用GDI_EXIT_CRITICAL_SECTION()
Media Task线程从med_create开始创建,其实 med_create函数只是将入口地址传递给库里的 函数,由里面的函数来创建线程。
Med_create中传入了以下的函数:
med_task_main,
/* 线程入口,消息泵 */
med_init,/*源自初始化 ,指定空间分配*/NULL,
设置当前活动模块,通过stack_set_active_module_id 分发消息,通过消息号,找到对应的消息处理函数,
使用med_main函数。程序里面有很大的一个消息索 引 释放返回消息数据内存区域,free_ilm
Media Task消息
从med_maincam_main相应的消息处 理函数,这时从MDI发过来的一个消息 才被识别,并进入相应的消息处理函数。 这时,我们回过头来再来看我们前面在 MDI章节所分析的Preview实现的例子, 会更清晰一些。 原来的例子:Preview实现
Media Task
Media Task模块分成4个部分:
Camera Audio Image Video
Media Task
Media Task模块有以下的作用:
MTK培训文档

Man Machine InterfaceAgendaMTK Software ArchitectureMTK MMI ArchitectureExample to Write an Application Third Party SoftwareToolQ&AMTK Software ArchitectureMTK Software ArchitectureSoftware ArchitectureKAL and OSLDate TypeTask ManagementSoftware ArchitectureSoftware Architecture –abbreviationsRMI: Remote MMI, i.e., PC side, which uses AT commands to communicate with Protocol stack.L4: The adaptation layer between MMI/AT and protocol stack.L4A: Layer 4 Adaptation to translate primitives sent from upper layers to function calls.L4C: Layer 4 Controller, coordinates all L4 modules to serve upper layers.ATCI: AT Command Interpreter.UEM: User Equipments module used to abstract basic device drivers like keypad, LED, GPIO.PHB: Phone Book management.SMU: Security Management (SIM, STK).CSM: Call Service Management (bearer capability handling, CSD/FAX service, CC, SS).RAC: Registration Access Control (GSM/GPRS registration management,PLMN list/selection, RSSI report)SMSAL: SMS Application Layer (message storage, MO/MT messages, CB).TCM: Terminal Context Management (PDP context profiles, context activate/deactivate, relay of packet data), interface to PPP/TCPIP/SNDCP.ENG: Engineer Mode to log information.KAL (Kernel Abstraction Layer)Target Real TimeOperating System GSMHandset Software GSMHandset SoftwareKernel Abstraction Layer (KAL)Target Real Time Operating SystemXTest/DebugFacilitiesPortabilityCommon design philosophyTest/Debug facilitiesEasier code integrationKAL ServicesKALServicesTest / Logging / Simulation facilities Exception handling Resource / MemorymanagementTask management /communication /synchronizationTimer ControlTask-ATask-BReference:KAL_ProgrammingGuide_20041005.pdfSystemServiceUserManual_20050527.pdfOSLNucleus,or other RTOSKALOSLPC simulator –simulate the OSL services on Win32 to facilitate development and debugging MMI task on PC.N.B.to ensure all programs within MMI task can run correctly on PC, use of OSL APIs is MUST.Data TypesGeneral data types:Kal_non_specific_general_types.hKAL specific data types and functions’prototypes: Kal_release.hOSL specific data types used within MMI Tasks: PixtelDataTypes.hTask Management & Identificationmodule_type and task_indx_typeDefined in “Stack_config.h”Used to define index of all modules and all tasksmod_task_g[RPS_TOTAL_STACK_MODULES]Defined in “syscomp_config.c”Used to map MODULE-ID to TASK-IDsys_comp_config_tbl[RPS_TOTAL_STACK_TASKS + 1]Defined in “syscomp_config.c”Used to define information of all tasks, e.g., task’s name, task queue’s name, priority, size of external/internal queue, task creation function, whether to use internal ram.custom_comp_config_tbl[MAX_CUSTOM_TASKS]Used for customer defined modules or tasks.task_info_g[RPS_TOTAL_STACK_TASKS + 1]Global array containing component task information, which will be filled in while callingstack_init_comp_info().module_info_g[MAX_MULTIMOD_TASK_NUM]Global array containing component task information, which will be filled in while callingstack_init_module_info().Task RoutinesTask CommunicationApp_ltlcom.hData structure ofmassage used for inter-layer communicationApp_ltlcom.h Data structure of massage used for inter-layer communication Stack_ltlcom.hMacro and API used to send/free messagesStack_ltlcom.h Macro and API used to send/free messagesTo allocate memory from shared memory pool.Ctrl_buff_pool.hDefine size and number of control buffer (memory pool)To allocate memory from shared memory pool.Ctrl_buff_pool.h Define size and number of control buffer (memory pool)To initialize specificmodule’s parameter pointer and peer buffer pointer before use it. (module_ilm_g [module_id])To initialize specific module’s parameter pointer and peer buffer pointer before use it. (module_ilm_g [module_id])Send message to other taskSend message to other taskTo receive message from external queueTo receive message from external queue To receive message from internal queueTo receive message from internal queue QueueGprot.hUsage of OSL send/receive internal/ external msg.QueueGprot.h Usage of OSL send/receive internal/ external msg.MTK MMI ArchitectureMTK MMI ArchitectureMMI Task structureMMI and L4 Communication MMI Architecture¾FrameworkProvides OS abstractionEvent HandlersHistory ManagerNVRAM AccessFile System Management ¾UI, ResourceMMI DirectoriesTask structureTask struct(sys_comp_config_tbl ):typedef struct {kal_char *comp_name_ptr;kal_char *comp_qname_ptr;kal_uint32 comp_priority;//3-255kal_uint16 comp_stack_size;kal_uint8 comp_ext_qsize;kal_uint8 comp_int_qsize;kal_create_func_ptr comp_create_func;kal_bool comp_internal_ram_stack;} comptask_info_struct;KAL_FALSEmmi_create 100304096TASK_PRIORITY_MMI“MMI Q”"MMI"MMI TaskLayer 4 AdapterExample:MOD_MMI--->MOD_L4Cmmi_frm_sms_send_message( )PRT_MSG_ID_MMI_SMS_SEND_MSG_REQ---------------------------------L4a_callback.cl4a_recv_msg_ft[MSG_ID_MMI_MESSAGE_SUM]_call_MSG_ID_MMI_SMS_SEND_MSG_REQ_( )---------------------------------MOD_L4C--->MOD_SMSALl4c_sms_exe_post_msg_req( )MSG_ID_L4CSMSAL_SEND_REQMMI and L4 Communication(1/3)How To CommunicateSend/Receive messages thru the message Queue .#define OslMsgSendExtQueue msg_send_ext_queue #define OslReceiveMsgExtQ receive_msg_ext_q SetProtocolEventHandler(FuncCB, msg_id);Communication Datatypedef struct ilm_struct{oslModuleType oslSrcId; // Source module ID.oslModuleType oslDestId; // Destination module ID.oslMsgType oslSapId; // service access point.oslMsgType oslMsgId; // message name ID.oslParaType *oslDataPtr; //local parameter bufferoslPeerParaPtr *oslPeerBuffPtr; //peer buffer pointer } ilm_struct;MOD_MMI, MOD_L4C, MMI_L4C_SAP, MSG_ID_XXX, local_para_ptr, peer_buf_ptr, MMIL4CQueueHow to listen a message from MMI Queue: From task create and entry a message loop.OslReadCircularQ(&Message);OslReceiveMsgExtQ(mmi_qid, &mmi_message);How to write a message to MMI Circular Queue: When NVRAM receive other messages.OslWriteCircularQ(&ilm_ptr);How to receive a message from L4C: Register a response message callback.SetProtocolEventHandler(FuncCB, msg_id);How to send a message to L4C:Step1: Construct a local parameter buffer.Step2: Assign required values into local parameter buffer.Step3: Send out the message to the L4C module.OslMsgSendExtQueue(&Message);Message Info = Header info + Data info Local parameter Header info:#define LOCAL_PARA_HDR \kal_uint8ref_count; \kal_uint16msg_len;peer buffer parameter Header info :#define PEER_BUFF_HDR \kal_uint16pdu_len; \kal_uint8ref_count; \kal_uint8 pb_resvered; \kal_uint16free_header_space; \kal_uint16free_tail_space;Local parameter:Header info + Data info:Ex: typedef struct{LOCAL_PARA_HDRkal_uint8volume_type;kal_uint8volume_level;} mmi_eq_set_volume_req_struct;How To Create Local Parameter:Dynamic to allocate memory buffer:OslConstructDataPtr(sizeof(mmi_at_alarm_query_res_req_struct); When to Free Local Parameter:While L4 receive the information, after finishing to process themessage, L4 task will automatically free this buffer.OslFreeDataPtr(sizeof(mmi_at_alarm_query_res_req_struct);Peer buffer parameter:Header info + Data infoEx: typedef struct{PEER_BUFF_HDRvoid *ptr;} mmi_example;How To Create Peer Buffer Parameter: Dynamic to allocate memory buffer:Ps: The MMI did not use this buffer to communicate with L4.construct_peer_buff(pdu_len, header_len, tail_len, direction); When will Free Peer Buffer:While receive the information, after finishing to process the message, L4 task will automatically free this buffer.free_peer_buff(peer_buff);Example –Set VolumeSet a volume request:void SetVolumeLevelReq(volume_type_enum volume_type,U8 volume_level){MYQUEUE Message;mmi_eq_set_volume_req_struct*setVolumeLevelReq;Message.oslMsgId= MSG_ID_MMI_EQ_SET_VOLUME_REQ;//Message ID, reference the l4a.h filesetVolumeLevelReq= OslConstructDataPtr(sizeof(mmi_eq_set_volume_req_struct));//Create local parameter buffersetVolumeLevelReq->volume_type = volume_type;setVolumeLevelReq->volume_level = volume_level;Message.oslDataPtr= (oslParaType*)setVolumeLevelReq; //Local parameter buffer Message.oslPeerBuffPtr= NULL; //Peer parameter bufferMessage.oslSrcId=MOD_MMI; //Send from Source moduleMessage.oslDestId=MOD_L4C; //Send to destination moduleOslMsgSendExtQueue(&Message); //Send to L4 task}MMI Architecture...HandlerFrameworkEvent HandlerFile System ManagementNVRAM AccessOSL WrapperHistory ManagerMMI QueueL4QueueLayer 4 / Network SimulatorUI LayerApplication...Call ManagerInstant MessageVideo CalendarFile ManagerCamera Alarm Function ListCategory ScreensTimer FuncRequest TimerRegister HandlerImageFont ThemeGraphics LibraryGDIInterface Operating System (Nucleus)R e s o u r c e T a b l eKeyPixtel InterfaceCore Functionality Provided by FrameworkOSL wrapper : make MMI code adaptive QueueTimerManagement of event handlerScreen management –History mechanismNVRAM accessFile system managementProvides OS abstractionProvides OS abstractionProvides wrappers to all operating system dependent calls to be made by the application.Queue¾QueueGprot.hTimer¾WrapperGprot.h¾MMIFrameworkComponents.pdfQueueExternal queue(Inter-task queue, mod to mod(In the diff task)) Reseive message:OslReceiveMsgExtQ(receive_msg_ext_q)Send message:OslMsgSendExtQueue(msg_send_ext_queue) Implement: mcu\adaptation\src\stack_ltlcom.cInternal queue(Intra-task queue, mod to mod(In the same task)) Reseive message:receive_msg_int_qSend message:msg_send_int_queueImplement: mcu\adaptation\src\stack_ltlcom.cCircular queue(MMI only, default size 30)Reseive message (From MMI Task):OslReadCircularQSend message (For NVRAM Access):OslWriteCircularQImplement: mcu\plutommi\MMI\Framework\Osl\OslSrc\Queue.cTimer Usage for MMI AppsStack TimerKAL serviceskal _XXX_timer () …Event Schedulerevshed _XXX_event () …L4StartTimer ()L4StopTimer () …OslStartSoftTimer ()OslStopSoftTimer () …MMI AppsEventGprot.h EventGprot.h StartTimer ()StopTimer () …StartMyTimer ()StopMyTimer () …WrapperGprot.h WrapperGprot.h WrapperGprot.hWrapperGprot.h WIN32OslIntStartSoftTimer ()OslIntStopSoftTimer () …L4Dr.hL4Dr.h event_shed.hevent_shed.h stack_timer.h stack_timer.h stack_XXX_timer () …kal_release.hkal_release.hEvent HandlersEvent HandlersRegisters and executes application call backs for various eventsProtocol events¾the basic event¾Indicate by unique protocol event IDKey events¾One kind of protocol eventHighlight events¾Man-made event, base on key event¾Associated with hint infoFramework Layer Layer4/NS MSGSet handlerApplication LayerSet handlerExcClearclearExcprotocolEventHandlereventID entryFuncPtrFigure. Protocol Event HandlerSet Event Handler:void SetProtocolEventHandler(PsFuncPtr funcPtr, U16 eventID){protocolEventHandler[countOfProtocolEvent].eventID= eventID;protocolEventHandler[countOfProtocolEvent].entryFuncPtr= funcPtr;}Execute Event Handler:void ExecuteCurrProtocolHandler(U16 eventID,void* MsgStruct,intmod_src, void* peerBuf){PsExtPeerFuncPtr currFuncPtr=(PsExtPeerFuncPtr)protocolEventHandler[count].entryFuncPtr;(*currFuncPtr)(MsgStruct, mod_src, peerBuf);}Event ID:Seeplutommi\mmi\AsyncEvents\AsyncEventsInc\ProtocolEvent s.hkey downKey repeatLong press key up TYPE CODELayer 4 / NSFramework LayerApplication LayerMSGExcExcExcSet key handlerprotocolEventHandlereventIDentryFuncPtr L4KeyHandleSet key handlerClearClearFigure. Key Event HandlerKey Press Event:Set Key Event Handler:void SetKeyHandler(FuncPtr funcPtr, U16 keyCode, U16 keyType){currKeyFuncPtrs[keyCode][keyType] = funcPtr;}Execute Key Event Handler:void ExecuteCurrKeyHandler(S16 keyCode, S16 keyType){(*currKeyFuncPtrs[keyCode][keyType])}KEY_REPEATKEY_LONG_PRESS KEY_EVENT_UP KEY_EVENT_DOWN KEY TYPEKEY_ENDKEY_SENDKEY_RIGHT _ARROWKEY_WAP | KEY_ENTER |KEY_IPKEY_DOWN_ARROWKEY_LEFT _ARROW KEY_RSKKEY_UP_ARROW KEY_POUNDKEY_0KEY_STARKEY_9KEY_8KEY_7KEY_6KEY_5KEY_4KEY_3KEY_2KEY_1KEY_CLEARKEY_LSKKEY CODEKEY_QUICK_ACS |KEY_CAMERAKEY_VOL_DOWNKEY_VOL_UP L4C QueueSend Key Press MsgProtocol Stack/L4MMI keypad bufApp ScreenRead Key Press MsgCall Event HandlerKey press events flow[keyCode, keyType][keyCode, keyType]ExecuteCurrKeyHandlerRefer files:Keypad_def.c, Kbd_table.hHighlight EventsFigure. Highlight HandlerLayer 4 / NSFramework LayerMSGApplication Layer — Main MenuCategory ScreenBusiness Logicstandard_animated_matrix_highlight_handler_type2ExecuteCurrHiliteHandler_Exthighlight_mainmenu_phonebookRegisterHighlightHandlerregister_fixed_matrix_highlight_handler SetHiliteHandlerMMI_list_highlight_handlerExecute handlerMMI_matrix_highlight_handler MMI_circular_3D_highlight_handlerFunction Entry maxHiliteInfoMMI_fixed_list_menu Menu Control Block MMI_fixed_matrix_menuprotocolEventHandlerL4KeyHandleeventIDentryFuncPtr key downKey repeatLong press key up TYPE CODEHistory ManagerHistory ManagerHelps application maintain screen flow and store intermediate data.typedef struct_historyNode{U16 scrnID;FuncPtr entryFuncPtr;U8 *inputBuffer;U8 *guiBuffer;} historyNode;Structure of history nodeScreen ID -of screen to be savedEntry Function Pointer –to redraw the screenInput Buffer –to save running text data for this screenGUI Buffer –to save UI related information for this screenHistory mechanismEntry new screen function: {EntryNewScreen():ClearAllInterruptEventHandler AddHistory()Entry Function Screen ID Gui Buffer OldExitFunction()ClearAllKeyHandler()Draw screenRegister new key handler}Go back history function:{EntryFunctiondecrement //Delete top screen}Please refer to “EntryNewScreen”Screen History Idle ScreenScreen 1Screen 2Top Screen:Entry Function Screen ID History BufferOther Data History buffer Event Handler Screen ID Exit Function Entry Function Curr Screen Other DataGui buffer Event Handler Screen ID Exit Function Entry Function New Screen delete SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP);History API ListEntryNewScreenU16 newscrnIDFuncPtr newExitHandlerFuncPtr newEntryHandler: NULL, if do not want add the new screen to history later void *peerBufAddHistory50Max capacity of history stack isOther APIDelete nodes from historyDelete ‘N’nodes from historyGo back ‘N’nodes in historyRetrieve history for a screenRetrieve input buffer for screenRetrieve UI buffer for screenDetail please refer to : \plutommi\MMI\Framework\History\HistoryInc\HistoryDef.hNVRAM AccessNVRAM AccessProvides wrappers for data storage and retrieval of data from NVRAM.Value¾ReadValue(nId,pBuffer,nDataType,pError);¾WriteValue(nId,pBuffer,nDataType,pError);Record¾WriteRecord(nFileId,nRecordId,pBuffer,nBufferSize,pError);¾ReadRecord(nFileId,nRecordId,pBuffer,nBufferSize,pError);NVRAM_Configuration_Guide_User.pdfNVRAM_Configuration_Guide_User.pdfFile System ManagementFile System ManagementProvides wrappers for data storage and retrieval of data from File SystemAPI¾Int FS_Open(const WCHAR * FileName, UINT Flag);¾int FS_Close(FS_HANDLE FileHandle);¾int FS_Read(FS_HANDLE FileHandle, void * DataPtr, UINT Length, UINT * Read);¾int FS_Write(FS_HANDLE FileHandle, void * DataPtr, UINT Length, UINT *Written);¾int FS_Seek(FS_HANDLE FileHandle, int Offset, int Whence);¾int FS_Delete(const WCHAR * FileName);¾int FS_GetFileSize(FS_HANDLE FileHandle, UINT * Size);FileSystem_Document_20050216_W05.09.pdfFileSystem_Document_20050216_W05.09.pdfUICategory ScreenCategory FunctionsThe category layer consists of a set of functions that an applicationcan use to define its User Interface.Each Category screen contains the following functions:Function to enter (display)Function to exitFunction to get the size of HistoryFunction to get the HistoryMMI ResourceImage, Audio, Strings, Fonts, Themes, Menu Tree.Category screen mechanismEvery category screen has a set of functions :ShowCategoryXXXScreen¾Register event handler ¾Pre-process UI element ¾Call redraw functionRedrawCategoryXXXScreen¾Draw screen using GDI functionsExitCategoryXXXScreen¾Reset function pointer¾Other operation depend on vary screensGetCategoryXXXHistorySize¾Be used to return the size of gui buffer & input bufferGetCategoryXXXHistory¾Be used to return the data of gui buffer & input bufferGetCategoryXXXData¾Be used to return input bufferExample: GetCategory157Data, GetCategory200Historyset_list_menu_category_history, get_list_menu_category_historyExample:void ShowCategory1Screen (STRING_ID Title,IMAGE_ID TitleIcon,STRING_ID LSKLabel,IMAGE_ID LSKIcon,STRING_ID RSKLabel,IMAGE_ID RSKIcon,INT NumberOfItems,STRING_ID*ListOfItems,BYTE*HistoryBuffer );Screen examplecategory3screencategory1screen category2screen ……ExitCategoryXXXScreen RedrawCategoryXXXScreen GetCategoryXXX1HistorySizeGetCategoryXXXHistory ShowCategoryXXXScreen ……CategoryXXX screen Category ScreenShowCategoryXXXScreen:{Init XXXScreen data;RedrawCategoryXXXScreen;}RedrawCategoryXXXScreen:{draw_title();show_fixed_list();show_left_softkey();show_right_softkey();}pixtel_UI_show_imagepixtel_UI_fill_rectangleCommon Screen:MMI ResourcesImages Audio Strings Fonts ThemesMenu TreeBMP PBM GIF JPEG MPEGimy midi mmf mp3mp4English S.Chinese T.Chinese Thai Arabic …8x913x1415x16ASCII Graphic 13x1411x1223x2415x16128x128128x160176x22096x64C 64x96C MMI Resources (1/5 :classification)Color SchemeButton Scrollbar Edit Icons Foreground BackgroundUI ObjectsImageList Text Font Main-menuSub-menuPhonebookSettings MessagesProfiles GamesCall HistoryServices Organizer MultimediaTitleStringStep 1: add string to ref_list.txtStep 2: add string ID to ENUM associated with appStep 3: using macro ADD_APPLICATION_STRING2Step 4: S8* my_string = GetString(MY_STR_ID);Using APP_BASE to guarantee the uniqueness of string ID ImageStep 1: put images in the folder assigned to appStep 2: add image ID to ENUM associated with appStep 3: using macro ADD_APPLICATION_STRING2Step 4: using image ID directly as parameterUsing APP_BASE to guarantee the uniqueness of image IDMenuParent menuUnique menu item IDHilite function and LSK handlerAssociated with screenAudioSkin LayoutAudio playerCalculatorFMRadioTheme Fonts TOOLS:MCT, MCU\tools\AudioResGen TOOLS:MCT, MCU\tools\AudioResGenMMI Resource (4/5 : Macro)ADD_APPLICATION_STRING2(STR_CAL_MONTH,"M","Chinese month");String ID, Value, DescriptionADD_APPLICATION_IMAGE2(IMG_CAL_ON,CUST_IMG_BASE_PATH"\\\ \EmptyImage.bmp","Icon for On Button.");Image ID, Path, DescriptionADD_APPLICATION_MENUITEM((MENU_CAL_TYPE, /* Menu ID */ORGANIZER_CALENDER_MENU, /* Parent ID*/1, /* Child number*/MENU_ID_CHILD_1, /* Child ID */SHOW, /* Hide or show*/NONMOVEABLE, /* Move attribute*/DISP_LIST, /* Display attribute*/CAL_STRING_LUNAR, /* String ID*/0)); /* ICON ID*/MMI Resource (5/5)World Clock Map Skin LayouterTheme Generator Audio Generator Font Merger,Font Splitter,Font Viewer,Font Customizer Preview Verify ImageMCT TOOL Mcu\tools\AudioResGen\*.*resource_audio.c resource_audio.h resource_audio.obj Audio City_Database.txt, City_Database_Coord.txt,Map, ref_list.txtplutommi\Customer\Images\PLUTO176X220\MainLCD\Video plutommi\Customer\Images\PLUTO176X220\MainLCD\FMRadio plutommi\Customer\Images\PLUTO128X160\MainLCD\Camera plutommi\Customer\Images\ProjectName\MainLCD\AudioPlayer New or old XXX.thm filepluto_large.bdf pluto_medium.bdf Pluto_small.bdf …….IDs: mcu\plutommi\mmi\AppXXX_dir\inc\AppXXXDef.hPopulate:mcu\plutommi\Customer\Res_MMI\Res_AppXXX.c String files : Mcu\\plutommi\Customer\CustResource\ref_list.txt IDs: mcu\plutommi\mmi\AppXXX_dir\inc\AppXXXDef.hPopulate:mcu\plutommi\Customer\Res_MMI\Res_AppXXX.cImage files : Mcu\plutommi\Customer\Images\IDs: mcu\plutommi\mmi\AppXXX_dir\inc\AppXXXDef.hPopulate:mcu\plutommi\Customer\Res_MMI\Res_AppXXX.cPRIMAL FILEStandaloneRes.cgui_wrapper.c CustMiscData.c resource_world_clock_city.c resource_video_skins.c resource_fmradio_skins.c resource_camera_skins.c resource_audply_skins.c themecomponents.h, ThemeRes.cresource_font_jtbl.c FontType.c FontRes.c,L_1_Large.h,L_1_Medium.h……CustMenuRes.c resource_str_jtbl.c CustStrMap.c CustStrRes.c resource_image_jtbl.c CustImgMap.c CustImgRes.c,custimgdatahw.h SOURCE FILEStandaloneRes.objgui_wrapper.obj resource_video_skins.obj resource_world_clock_city.obj resource_fmradio_skins.obj resource_camera_skins.objresource_font_jtbl.objFontType.obj resource_str_jtbl.objCustStrMap.obj resource_image_jtbl.obj CustImgMap.obj CustMiscData.objOtherresource_audply_skins.obj App ResourceThemeRes.objThemesFontRes.objFontsCustMenuTree_Out.c CustMenuTreeID_Out.cCustMenuRes.obj Menusenum_list.hCustResList_out.txtCustStrRes.objStringsCustImgRes.objImagesTEMPORARY FILECOMPONENTCLASS。
MTK平台软件开发过程介绍课件

题培训) CPU硬件资源配置工具:DrvTool(专题培训) IMEI及序列号写入工具:SN_Station
4
DAYO Mobile Confidential 2023/12/22
MTK开发基本环境及工具
2
DAYO Mobile Confidential 2023/12/22
MTK平台软件开发所需的基本环境
ARM编译环境:ADS1.2.1(ARM Developer Suite 1.2.1)
模拟器编译环境:Microsoft Visual C++ 6.0 运行编译命令需要Perl语言支持,需要安装
30
连接手机
设置串口参数
DAYO Mobile Confidential 2023/12/22
点击连接按钮,如想保留上次LOG信息,请取消“Clear when connect”
31
设置过滤条件
DAYO Mobile Confidential 2023/12/22
因LOG信息很多,可通过设置过滤条件只获取指定模块的LOG信息
codegen_modis
打开 modis\modis.dsw文件使用VC进行编译(Rebuild all) 或者使用命令行方式直接进行分布式编译:
Buildconsole .\modis\modis.dsw /MAKE “Modis – WIN32 Debug” /REBUILD
12
模拟器如何运行
加载手机软件常见问题
Q:红条完成后,蓝条不跑,弹出错误信息
A:检查是否所使用的FlashTool不支持手机所用的Flash型号,如 是,则需要更换FlashTool版本
MTK_MMI教程

如果没有找到图片文件,手机显示的时候是一个红色的* 添加图片时,注意路径用 4 杠
在 NVRam 中增加成员: 需要增加 ID,指出每块大小,以及总的块数 和缺省值。 每块大小最好为偶数。 修改下面的文件: Nvram_user_defs.h: ID, 大小,个数 NVRAMEnum.h Nvram_user_config.c custom_nvram_editor_data_item.h
添加源文件路径: plutommi.lis 添加完毕,这些文件就可参与编译了。
添加开关: 开关真是个好东西。依靠它,可以将没有价值的功能瞬间屏蔽,又可以将我们需要但又搁置的功能瞬间启 用。能者上,不能者下,多么类似于社会法则。 添加开关 在 make 文件夹下面的 .mak 文件里面。 注意事项: 有人喜欢模仿 MTK 原做法,在 .mak 文件里面使用一个开关管住另外一个开关。那么两个开关不要同名, 否则开关起不了关闭的作用。
编译后,在 plutommi\Customer\CustResource 下面 会生成新的 CustStrMap.c 和 CustStrRes.c 这两个文件中就包含了新增的 string 资源
添加图片: 1. GlobalDefs.h 中增加 ID 2. population.c 中将 ID 和 string 关联 3. 增加图片到解压后的包里,增加完毕,应打包。plutommi\Customer\Images\PLUTO176X220
录下的文件都是 Res_*.*文件,是各个 AP 或模块的资源配置文件,包含菜单、图片、 字符串资源的配置; 注意: Cust*.*文件是资源编译生成的,不能手动修改。 2). 编译方法: 进入..\plutommi\Customer 目录,执行 remakeResource.bat 批处理文件。 编译成功会生成一些 Cust*.*文件在\plutommi\Customer\CustResource 目录下,编译代码时再编译这些文件; 编译失败到 build 目录下查看 log 文件à res_gen.txt,可看到出错信息。 3). 当我们改变了资源,想在 PC 模拟上看到修改效果时,也需要先执行Байду номын сангаас上的资源编译命令, 再在 VC 环境下 build 一下资源,就可以看到效果了。 2. 代码的编译: 有如下的编译命令: make custom=xxx gprs new make custom=xxx gprs update
MMI customer training(Hart& troubleshooting)

Micro Motion Confidential Page 15
故障诊断部分
变送器 核心处理器 传感器
Micro Motion Confidential Page 16
故障诊断部分
质量流量计的组成 -- 流量计系统部件
T系列传感器和分体安装的2700变送器
T系列传感器和一体安装的2700变送器
90° 外壳和显示可以 90° 旋转360 360° 旋转360° .
Micro Motion Confidential Page 25
故障诊断部分
变送器故障诊断--面板操作 (LDO) 变送器故障诊断
“Operations” 菜单:
– Mass Flow(质量流量) – Mass Total(质量总量) • Reset,Start,Stop,Exit(复位,启动,停止,退出) – Volume Flow(体积流量) – Volume Total(体积总量) • Reset,Start,Stop,Exit (复位,启动,停止,退出) – Density(密度) – Temperature(温度) – 其它参数!
手操器部分 1700/2700变送器与HART手操器的连接注意事项
回路电阻必须满足250~600欧姆 回路中电压正常,一般为24vDC 手操器内安装有该仪表的DDI文件 手操器连接无正负极之分 375手操器插口要放到“H”标记的位置
Micro Motion Confidential Page 5
手操器部分 HART手操器与1700/2700的通讯菜单
Micro Motion Confidential Page 26
故障诊断部分
变送器故障诊断--面板操作 (LDO) 变送器故障诊断
MTK平台射频培训解读

GSM900 4类功率等级移动台 Power LEV 5 发射机输出 功率dBm 33 功率容限 ±2dB DCS1800 1类功率等级移动台 Power LEV 0 发射机输出 功率dBm 30 功率容限 ±2dB
6~15
16~19
基带处理器对射频控制信号包括:LB_TX(当GSM发射突发脉冲来的时候为 高电平),HB_TX(当DCS/PCS发射突发脉冲来的时候为高电平) PA_EN(PA使 能信号),BANDSW_DCS(PA GSM/DCS/PCS放大器频段选择信号。 )
8
五、射频电路元器件识别
天线主馈点 射频连接器
850、900接收滤波器
11
26MHZ的校准原理:
1)、让手机进入META模式,从.cfg文件中读取DACmin、DACmax,并计算出对应 delta Fmin和delta Fmax。 2)、计算出相应的斜率slope,并检查slop是否在正常范围内。 3)、如果slop在正常范围内,将频率设为26M并算出DAC值,在此DAC附近变化, 找出最小的delta F和对应的DAC,并检查此DAC是否在正常范围内。 4)、如果DAC在正常范围内,将DAC和slope写入NV
GSM850、900接 收
4
2、接收滤波电路
接收滤波电路用于频段预选,从天线接收到的众多频率分量中,选择所需要的GSM频段信号, 同时滤除带外非GSM系统杂散信号,滤波器采用我们公司目前常用的表面声波滤波器 SAW。
1930~1990
1805~1880
925~960
5
3、射频功放电路
PA使能 发射频段选择
13
MTK从入门到精通(第5章+MTK开发平台搭建)

第五章:MTK开发平台搭建导读:前面几章,我们一直都在讲一些MTK的背景知识,试图让大家对MTK有个感性的认识,当你对即将要向大家学习的MTK开发有个大概的了解之后,再来研究里面的一些细节,对你接下来的学习肯定是大有益处。
从这一章开始,我们将慢慢地向大家铺开MTK开发实战方面的内容,让大家尽快步入MTK开发的殿堂,也就是我们所说的“入门”。
好了,言归正传,我们把话题切换到平台搭建上来。
古人云:君欲行其事,必先利其器,那么学习MTK也一样,必须要有好的工具来辅助我们学习,辅助我们开发,工具选好了,选对了,让我们接下来的学习和工作事半功倍。
本章我们将详细的介绍MTK开发平台的搭建过程,首先是介绍MTK 开发平台所需的资源和工具,以及获得这些资源的方式,接下来介绍如何正确安装和配置相应的软件工具,并告诉读者如何检测环境搭建是否成功,然后我们重点介绍了Source Insight软件,并介绍如何把代码加载到Source Insight软件当中,接着,文章还给出了分布式编译的原理,在MTK开发中引入分布式编译的意义,以及如何搭建自己的分布式编译系统,最后对整章做了一下总结。
因为本章是学习接下来知识的基础,所以希望读者能认真阅读。
如果遇到问题,也可以到我们的iMTKoo论坛()来发帖询问,我们的版主会尽快的给予解答。
需掌握的内容:1.了解MTK开发平台所需的各种软件。
2.掌握开发平台的搭建过程。
3.掌握如何应用MTK工具检测开发平台是否搭建成功。
4.了解各种第三方软件在我们的编译过程中扮演的角色。
5.了解各种官方软件的作用。
6.掌握分布式编译的原理以及分布式编译系统的搭建。
5.1 MTK开发所需的资源和工具在进行MTK开发平台搭建的讲解之前,笔者觉得有必要对这些软件做一些简单的介绍,让大家大致了解,这些软件在我们平台中的作用。
然后我们还将告知大家如何去获取这些软件,以及对这些软件版本的要求,这一点非常的重要,我这里做一次强调,平台搭建中所需的软件版本,并不是越新越好,请使用我们推荐的版本,否则可能会出现各种编译错误。
MTK入门基础

一、树立自信心:总的来说,在MTK平台上开发软件并不是一件特别难的事情。
要树立自信心,关键是要发现自己能做出一点小的东西来,增加对它的兴趣。
刚开始你可以在屏幕上显示一个文本,然后你可以尝试去显示一个具有某种风格的窗体,接着可以试着添加一个菜单。
这些东西学会后主管会给你一些小的任务,比如去解一些小的bug,更换某个应用程序的界面图片,显示风格等。
随着你对MTK的逐步了解,你会接触越来越多的新鲜玩意,当然难度会相应增加,当然你可能并未明显察觉,只要你循序渐进,这些都是没有问题的。
当然困难肯定是有的,你可以去主动问其他的同事。
MTK是一个多线程的嵌入式开发环境,可以通过一些命令对代码进行编译,如果通过编译,就会在“(代码根目录)\build \ (工程名) \”目录下生成6个文件,分别是*.bin 文件、scat*.txt、*.elf、*.lis、*.sym、*.log 。
这些文件中前两个是我们最经常使用的,bin 文件就是我们用来下载到手机中的二进制的镜像文件,scat*.txt用于加载这个镜像文件。
我们的下载(烧写)工具是一个叫fllash tool的小软件。
如图怎样下载?1.运行Flash tool2. 选择Download Agent文件的路径:我的Flash Tool 放在F:\MTK工具\FlashTool_v3.2.0,Download Agent就在这个目录下。
3.选择scat*.txt文件4.如果红色方框内有location栏不为空,说明bin文件已经装载成功。
给手机装上电池,点击Download,然后插上烧写线即开始下载程序,当显示一个OK 的小弹出框时,表明烧写完毕,可以拔下烧写线开机了。
怎么样,是不是觉得很神奇呀?下面的东西更神奇。
需要说明一下:Download Agent文件只需要选择一次就够了,当然如果发现文件没有正确选择,重新选择正确的那个就好了。
如果你想要格式化手机的ROM,你可以在手机烧写成功后,点击Format你也可以在每次烧写的最后进行格式化动作,只需要Option菜单下的Format FAT,在弹出框中选中Auto Format FAT即可。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
/* Code Body */ /*---------------------------------------------------------------*/ gdi_layer_lock_frame_buffer(); SetupCategoryKeyHandlers(); MMI_title_string = (UI_string_type) title; MMI_title_icon = (PU8) get_image(title_icon); change_left_softkey(left_softkey, left_softkey_icon); change_right_softkey(right_softkey, right_softkey_icon); //Create List create_fixed_icontext_menuitems(); associate_fixed_icontext_list(); ShowListCategoryScreen( (UI_string_type) title, get_image(title_icon), get_string(left_softkey), get_image(left_softkey_icon), get_string(right_softkey), get_image(right_softkey_icon), number_of_items); for (i = 0; i < number_of_items; i++) { add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i])); } h_flag = set_list_menu_category_history(MMI_CATEGORY_CUSTOM_LIST, history_buffer); if (h_flag)
void singleline_inputbox_multitap_input(UI_character_type c) { /*---------------------------------------------------------------*/ /* Local Variables */ /*---------------------------------------------------------------*/ /*---------------------------------------------------------------*/ /* Code Body */ /*---------------------------------------------------------------*/ if (MMI_singleline_inputbox.flags & UI_SINGLE_LINE_INPUT_BOX_PLUS_CHARACTER_HANDLING) { if ((MMI_singleline_inputbox.text[0] == '+') && (MMI_singleline_inputbox.current_text_p == MMI_singleline_inputbox.text) && (MMI_singleline_inputbox.text_length >= (MMI_singleline_inputbox.available_length ENCODING_LENGTH))) { return; } }
DM_CUSTOM_DEFINE_INPUTBOX, 需要定义 DM_CUSTOM_DEFINE_LIST 需要定义
};
//
//
(二)在dm_get_coordinates()函数中加入: //设定列表位置和大小(不要忘记全局变量 MMI_custom_Listbox_x 等的定义)
else if( *UICtrlAccessPtr_p == DM_CUSTOM_DEFINE_LIST ) { dm_coordinate_info->s16X = MMI_custom_Listbox_x; dm_coordinate_info->s16Y = MMI_custom_Listbox_y; dm_coordinate_info>s16Width = MMI_custom_Listbox_width; dm_coordinate_info>s16Height = MMI_custom_Listbox_height; dm_coordinate_info->Flags = DM_NO_FLAGS; UICtrlAccessPtr_p ++ ; }
本文详细说明了如何建设一个自定义列表窗体模板。原理部分请参见 《MTK平台(1)——如何添加一个窗体模板》。 最终实现的是一个字典输入界面。布局为:
ห้องสมุดไป่ตู้
该模板不包含业务逻辑,仅提供页面显示和InputBox框输入事件后的 ListBox的Redraw事件的注册,以及基本的输入法设置、清空后的返回 函数。
//设定输入框位置和大小
else if( *UICtrlAccessPtr_p == DM_CUSTOM_DEFINE_INPUTBOX ) { dm_coordinate_info->s16X = MMI_custom_inputbox_x ; dm_coordinate_info->s16Y =
{
fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item } else { fixed_list_goto_item_no_redraw(highlighted_item); } //Create Inputbox memset(custom_single_input_buffer,0,100); pfnUnicodeStrcpy(custom_single_input_buffer,L"Custom Category"); wgui_setup_singleline_inputbox( 0, 0, 240, 320, custom_single_input_buffer, pfnUnicodeStrlen(custom_single_input_buffer), MMI_CATEGORY_CUSTOM_LIST, get_string(right_softkey), get_image(right_softkey_icon), INPUT_TYPE_ALPHANUMERIC_LOWERCASE| INPUT_TYPE_USE_ONLY_ENGLISH_MODES, history_buffer, 0); register_hide_multitap(wgui_hide_multitap); gdi_layer_unlock_frame_buffer(); ExitCategoryFunction = ExitCategoryCustomListScreen; dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size); dm_data.s32ScrId = (S32) GetActiveScreenId();
(三)在Wgui_category.c中定义模板显示函数
void ShowCategoryCustomListScreen( U8 *title, U16 title_icon, U16 left_softkey, U16 left_softkey_icon, U16 right_softkey, U16 right_softkey_icon, S32 number_of_items, U8 **list_of_items, U16 *list_of_icons, S32 flags, S32 highlighted_item, U8 *history_buffer) { /*---------------------------------------------------------------*/ /* Local Variables */ /*---------------------------------------------------------------*/ dm_data_struct dm_data; S32 i; U8 h_flag; /*---------------------------------------------------------------*/
一、添加用户自定义列表模板的过程 (一)在g_categories_controls_map[]中加入:
,{MMI_CATEGORY_CUSTOM_LIST,(U8*)custom_define_list, (s16*)coordinate_custom_list,NULL} const U8 custom_define_list[]= { 5, DM_BASE_LAYER_START, DM_SCR_BG, DM_BASE_CONTROL_SET1, DM_SINGLELINE_INPUTBOX1, DM_LIST1 }; const S16 coordinate_custom_list[]= { DM_FULL_SCREEN_COORDINATE_FLAG,
dm_data.s32CatId = MMI_CATEGORY_CUSTOM_LIST;
//不要忘记该常量 MMI_CATEGORY_CUSTOM_LIST的定义
dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND; //dm_data.s32flags |= DM_SHOW_VKPAD; dm_register_vkpad_callback(CustomList_virtual_keypad_callback); dm_setup_data(&dm_data); dm_redraw_category_screen(); } /* end of ShowCategory353Screen */ void CustomList_virtual_keypad_callback(void) { #if defined(__MMI_TOUCH_SCREEN__) mmi_pen_editor_clear_and_show_virtual_keyboard_area(); #endif