MTK培训
- 格式:docx
- 大小:16.35 KB
- 文档页数:2
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平台mmi培训资料(中文)2021-06-0621:48本文具体讲明了如何建设一个自定义列表窗体模板。
原理局部请参见?MTK平台(1)——如何添加一个窗体模板?。
最终实现的是一个字典输进界面。
布局为:该模板不包含业务逻辑,仅提供页面显示和InputBox框输进事件后的ListBox的Redraw事件的注册,以及全然的输进法设置、清空后的返回函数。
一、添加用户自定义列表模板的过程〔一〕在g_categories_controls_map[]中参加:,{MMI_CATEGORY_CUSTOM_LIST,(U8*)custom_define_list,(s16*)coordinate_c ustom_list,NULL}constU8custom_define_list[]={5,DM_BASE_LAYER_START,DM_SCR_BG,DM_BASE_CONTROL_SET1,DM_SINGLELINE_INPUTBOX1,DM_LIST1};constS16coordinate_custom_list[]={DM_FULL_SCREEN_COORDINATE_FLAG,DM_CUSTOM_DEFINE_INPUTBOX, //需要定义DM_CUSTOM_DEFINE_LIST //需要定义};〔二〕在dm_get_coordinates〔〕函数中参加://设定列表位置和大小〔不要不记得全局变量MMI_custom_Listbox_x等的定义〕elseif(*UICtrlAccessPtr_p==DM_CUSTOM_DEFINE_LIST){dm_coordinate_info->s16X=MMI_custom_Listbox_x;dm_coordinate_info->s16Y=MMI_custom_Listbox_y; dm_coordi nate_info->s16Width=MMI_custom_Listbox_width; dm_coordinate_info-> s16Height=MMI_custom_Listbox_height;dm_coordinate_info->Flags=DM_NO_FLAGS;UICtrlAccessPtr_p++;}//设定输进框位置和大小elseif(*UICtrlAccessPtr_p==DM_CUSTOM_DEFINE_INPUTBOX){dm_coordinate_info->s16X=MMI_custom_inputbox_x;dm_coordinate_info->s16Y=MMI_custom_inputbox_y;dm_coordinate_info->s16Width=MMI_custom_inputbox_width;dm_coordinate_info->s16Height=MMI_custom_inputbox_height; dm_coo rdinate_info->Flags=DM_SINGLE_LINE_INPUTBOX_SPECIFIC_HEIGHT;UICtrlAccessPtr_p++;}〔三〕在Wgui_category.c中定义模板显示函数voidShowCategoryCustomListScreen(U8*title,U16title_icon,U16left_softkey,U16left_softkey_icon,U16right_softkey,U16right_softkey_icon,S32number_of_items,U8**list_of_items,U16*list_of_icons,S32flags,S32highlighted_item,U8*history_buffer){/*----------------------------------------------------------------*//*LocalVariables*//*----------------------------------------------------------------*/dm_data_structdm_data;S32i;U8h_flag;/*----------------------------------------------------------------*//*CodeBody*//*----------------------------------------------------------------*/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);//CreateListcreate_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){fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.high lighted_item);}else{fixed_list_goto_item_no_redraw(highlighted_item);}//CreateInputboxmemset(custom_single_input_buffer,0,100);pfnUnicodeStrcpy(custom_single_input_buffer,L"CustomCategory");=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();} /*endofShowCategory353Screen*/voidCustomList_virtual_keypad_callback(void){#ifdefined(__MMI_TOUCH_SCREEN__)mmi_pen_editor_clear_and_show_virtual_keyboard_area();#endifgui_show_transparent_image(0,200,GetImage(IMG_H_SELECT_LEFT),0); }voidExitCategoryCustomListScreen(){wgui_close_singleline_inputbox();}〔四〕在singleline_inputbox_multitap_input〔〕函数中添加用户处理key_0~key_9的按键事件的函数:void(*singleline_inputbox_custom_input_callback)(void)=UI_dummy_funct ion;voidsingleline_inputbox_multitap_input(UI_character_typec){/*----------------------------------------------------------------*//*LocalVariables*//*----------------------------------------------------------------*//*----------------------------------------------------------------*//*CodeBody*//*----------------------------------------------------------------*/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_si ngleline_inputbox.text)&&(MMI_singleline_inputbox.text_length>=(MMI_sing leline_inputbox.available_length-ENCODING_LENGTH))){return;}}gui_single_line_input_box_insert_multitap_character(&MMI_single line_inputbox,c);redraw_singleline_inputbox();singleline_inputbox_input_callback();singleline_inputbox_custom_input_callback();}〔五〕Wgui_Category.c中添加用户事件定义接口//右键事件注册voidSetCategoryCustomListRightSoftkeyFunction(void(*f)(void)){wgui_singleline_inputbox_RSK_function=f;}//key_0到key_9按下时的事件注册externvoid(*singleline_inputbox_custom_input_callback)(void); voidSetCategoryCustomListNumKeyFunction(void(*f)(void)){singleline_inputbox_custom_input_callback=f;}//设置InputBox大小voidSetCustomList_Inputbox_Size(S32p_x,S32p_y,S32p_width,S32p_height) {MMI_custom_inputbox_x=p_x;MMI_custom_inputbox_y=p_y;MMI_custom_inputbox_width=p_width;MMI_custom_inputbox_height=p_height;}//设置ListBox大小voidSetCustomList_Listbox_Size(S32p_x,S32p_y,S32p_width,S32p_height) {MMI_custom_Listbox_x=p_x;MMI_custom_Listbox_y=p_y;MMI_custom_Listbox_width=p_width;MMI_custom_Listbox_height=p_height;}二、自定义列表模板的使用方法1、调用SetCustomList_Inputbox_Size和SetCustomList_Listbox_Size设置列表框和输进框的大小。
MTK入门培训教程MTK入门培训教程 (1)一、搭建MTK环境 (1)1、安装ARM Developer Suite (ADS) version 1.2 (1)2、安装perl解释器 (1)3、安装VC6.0 (2)4、下载线驱动: (2)5、下载软件 (2)二、安装MTK使用工具 (2)1、代码编辑软件 (2)2、代码比较工具 (2)3、reflist.txt编辑软件 (2)三、软件使用方法 (2)1、Flash_Tool (2)四、MTK工程初步上手 (3)1、编译方法: (3)2、模拟器的使用: (3)3、如何在MTK上添加一个菜单和图片: (3)4,如何在MTK上创建一个新的application (5)五、入门可以参考的文档有以下: (5)一、搭建MTK环境1、安装ARM Developer Suite (ADS) version 1.2路径:mtk环境工具\konka_ads12\ads12安装步骤:双击setup.exe进行安装,按照提示进行安装。
安装结束后程序要求导入序列号,选择导入序列号文件,找到mtk环境工具\konka_ads12\ads12\CRACK,导入LICENSE.DA T 即可完成安装。
2、安装perl解释器路径:mtk环境工具\ActivePerl-5.6.1.626-MSWin32-x86-multi-thread.msi安装步骤:双击可执行文件按照提示完成安装。
3、安装VC6.0路径:mtk环境工具\vc_setup\vc6安装步骤:双击setup.exe安装提示安装即可。
安装完后将mfc patch中的文件拷入system32目录中。
4、下载线驱动:路径:mtk环境工具\6219B_USB_Line_Driver 2.0.1.1 (Recommend)prolific安装步骤:将下载线插入USB口中,弹出驱动安装窗口,安装提示将目录定位在上面得路径中按照提示安装即可。
、|!_一个人总要走陌生的路,看陌生的风景,听陌生的歌,然后在某个不经意的瞬间,你会发现,原本费尽心机想要忘记的事情真的就这么忘记了..MTK手机驱动培训资料【驱动部门的主要任务】驱动部门的主要任务是调试软件,让软件在硬件上顺利的跑起来。
其中包括各个具体的器件的调试以及一些和底层相关的问题,以及其他不属于mmi部分的问题。
具体的包括:1、LCD的调试:一般LCD厂商在提供样品的时候,都会提供给初始化代码,服务更好的还会提供进入和退出SLEEP的代码,如果厂商不提供的话,就只有看着文档自己写了。
我们的工作一般是调节显示效果以及和厂商沟通,还有就是把厂商给的代码整合进程序里面去。
Lcd驱动程序相关的文件主要包括lcd.c,lcd_sw.h以及lcd_sw_inc.h。
调节LCD的驱动程序,最先要在lcd_sw_inc.h中修改lcd的尺寸,就是LCD_WIDTH 和LCD_HEIGHT,如果有小屏的话还要定义下面的小屏的lcd的尺寸。
然后,根据硬件的设计修改lcd_sw.h中的宏,来确定lcd是使用8位的还是16位的接口,比如使用16位的lcd接口,就定义宏MAIN_LCD_16BIT_MODE。
最后,移植厂商给的初始化代码进入到初始化函数里,还有进入和退出Sleep状态。
进入和退出Sleep状态要求重新进入Sleep状态后屏幕能正常的显示,退出Sleep状态要求LCD 的耗电小于0.1ma。
如果是CSTN的屏幕,那么还有一个对比度的参数需要设定。
有2个对比度的值,一个是在初始化函数中写进去的一个值,还有一个是在nvram_user_config.c中的结构NVRAM_EF_CUST_HW_LEVEL_TBL_DEFAULT中定义。
2、GPIO的设定:GPIO就是General purpose IO pin的意思,是一些能用做一般的功能控制的IO引脚。
MTK 芯片的引脚一般有四个功能选项,可以通过寄存器来控制各个引脚的功能,一般功能0就是表示这个引脚用做GPIO。
课程目标
1、了解MTK平台及开发环境,掌握开发MTK 平台必须的软件工具;
2、
2、掌握MTK平台的整体架构,了解MTK 各层的协调关系;
3、掌握MTK MMI层的开发流程,能够进行MMI层项目设计与开发;
4、掌握MTK真机烧制过程;
5、掌握MTK 驱动层的开发流程,能够进行MTK 驱动开发。
6、掌握MTK多媒体编程。
本课程同样适用于希望掌握MTK开发技术,为未来业务转型奠定基础的企业技术团队。
课程大纲(MTK 6225 最新版,支持双卡双待,双声道音频输出,130像素的Camera,2009最新版,支持C语言和Java语言两种方式的开发)赠送MTK 6225平台最新版的源代码!
初级:MTK基础与MMI开发授课阶段培训内容第一阶段MTK平台介绍MTK平台环境搭建MTK 平台工具介绍MTK芯片平台原型软件编译及工程源程序介绍;MTK 主芯片MT6225详解MTK工程的创建MTK的特性设置MTK工程如何编译MTK调试技巧精通软件开发和编译过程;MTK芯片和移植--软件如何在不同手机之间移植(“对接”、“搬家”),实施步骤,应注意的事项?MTK MMI使用详解MMI 的框架和架构详解手机开发模块脚本编译器详解MTK AT命令介绍MTK 资源产生工具介绍MTK 界面开发说明
第二阶段MTK 整体架构的讲解MTK 的开关机流程MTK 通信机制改变编译参数/宏定义来实现手机配置的改变或设定;MTK UI 资源介绍设计字符串资源概括介绍UI结构/架构、各种预定义的标准UI 控件/组件(包括各种对话框/提示框),它们在哪里?重点讲解典型组件的使用。
Image如何显示?屏幕和各组件之间是否存在一种如J2ME那样的容器/管理关系(append、delete、size,...)?如何在屏幕上进行低级绘画(类似JAVA中的Canvas + Graphics),低级API在哪里?Image如何显示?举例说明之。
自定义UI程序的开发流程和实现方法(以AudioPlayer为例)。
第三阶段设计图片资源设计播放器等的皮肤更换资源文件实现新的手机界面文件系统--MTK文件系统,和PC文件系统编程的比较对照,编程实例添加功能菜单设计独特风格的界面
第四阶段MTK MMI层介绍剖析MTK MMI主任务系统讲解MTK功能模块如何开发辅助工具实现手机新功能技巧详解讲解模块示例的实现机制短信模块照相机模块项目开发实践
补充:Java开发(由于本平台为6225最新版,不仅可以用C语言开发,还可以用Java开发,因此补充相关知识)1.开发软件eclipse的使用及调试详解2.J2ME资源详解 3.J2ME环境构建详解 4.MTK MMI使用详解5.MMI的框架和架构详解6.手机开发模块脚本编译器详解7.MTK AT命令介绍8.MTK 资源产生工具介绍9.MTK 界面开发说明10.怎样编写第一个面向MTK平台的Java程序,怎样在平台上运行该程序11.详细讲解Java程序的各个组成部分实验: 1.俄罗斯方块实验原理,开发详细步骤,及源代码相关重点、难点的讲解 2.网络传输实验原理,开发详细步骤,及源代码相关重点、难点的讲解 3.视频网络应用原理,开发详细步骤,及源代码相关重点、难点的讲解 4. 安防监控原理,开发详细步骤,及源代码相关重点、难点的讲解 5.Java串口通讯实验原理,开发详细步骤,及源代码相关重点、难点的讲解 6.短信收发实验原理,开发详细步骤,及源代码相关重点、难点的讲解7. ADC实验原理,开发详细步骤,及源代码相关重点、难点的讲解8. 条码实验原理,开发详细步骤,及源代码相关重点、难点的讲解9. GPIO 口实验原理,开发详细步骤,及源代码相关重点、难点的讲解10.并口通讯实验原理,开发详细步骤,及源代码相关重点、难点的讲解11.图片浏览实验原理,开发详细步骤,及源代码相关重点、难点的讲解
高级:MTK高级应用与驱动开发授课阶段培训内容
第一阶段MTK 驱动层介绍MTK 硬件资源介绍如何根据硬件资源开发一台特性MTK手机MTK芯片平台软件调试MTK 外设驱动如何调试开发MTK 基带讲解MTK 电源管理芯片讲解利用MTK辅助工具实现手机新功能
第二阶段MTK Flash 讲解MTK 键盘讲解MTK T卡讲解MTK LCD 讲解MTK 触摸屏讲解修改源程序实现复杂的功能更改或增加;
第三阶段MTK 摄像头讲解MTK 播放器讲解MTK 音频部分讲解MTK 录象机讲解修改NVRAM 数据来改变手机的功能/性能;多媒体编程---图形与图像,音频和视频处理,多媒体编程实例。
第四阶段MTK 射频讲解MTK 蓝牙讲解MTK 充电部分讲解MTK 待机讲解MTK NVRAM讲解新功能模块的开发项目开发实践补充:Java开发(由于本平台为6225最新版,不仅可以用C语言开发,还可以用Java 开发,因此补充相关知识)1.MTK 6225平台,Java开发的高级技巧详解 2.软件调试的高级技巧实验:1.射频卡的硬件开发及Java版相关软件开发详解 2.摄像头硬件开发及Java版相关软件开发详解。