Summary of Contents for Nuvoton NuMicro M2351 Series
Page 1
The information described in this document is the exclusive intellectual property of Nuvoton Technology Corporation and shall not be reproduced without permission from Nuvoton. Nuvoton is providing this document only for reference purposes of NuMicro microcontroller based system design. Nuvoton assumes no responsibility for errors or omissions.
GUI for any application that operates with a graphical display. Nuvoton provides emWin GUI library for free with the M2351 series microcontroller (MCU) supporting up to 320x240 (16 bpp) resolution. The emWin platform can be implemented on HMI for industrial, machines, appliances, etc.
M2351 emWin 2.6 Tools (ThirdParty\emWin\Tool) BmpCvtNuvoton.exe The Bitmap Converter is designed for converting common image file formats like BMP, PNG or GIF into the desired emWin bitmap format. emWinPlayer.exe This tool can show the previously created emWin Movie File (EMF) on a Computer with a Windows operating system.
M2351 emWin 3 emWin Sample Code There are two emWin sample code in the M2351 BSP SampleCode\NuMaker directory: emWin_GUIDemo: utilizes the emWin library to demonstrate widgets feature; emWin_SimpleDemo: utilizes the emWin library to demonstrate interactive feature. 3.1 Project Structure The following uses emWin_SimpleDemo as a sample to explain the emWin project structure in BSP.
M2351 emWin The project contains two targets: emWin_SimpleDemo_ILI9341: use ILI9341 touch panel; emWin_SimpleDemo_ST7735: use ST7735 touch panel. User can switch between different targets using the pull down menu marked in the red rectangle shown below. 3.2 System Initialization The system initialization code is located in main function, including peripheral clock preparation, multi- function pin configuration, and UART debug port setting.
Page 8
M2351 emWin timer is configured to keep track of time elapsed. int main(void) // Init System, IP clock and multi-function I/O _SYS_Init(); // Init UART to 115200-8n1 for print message UART_Open(UART0, 115200); // Enable Timer0 clock and select Timer0 clock source CLK_EnableModuleClock(TMR0_MODULE);...
M2351 emWin 3.5 Download and Run Press Ctrl + F5 to download the application and start a debug session or click start/stop debug session icon as shown below. After entering debug session, press F5 to start code execution. The following figure shows the application halts in main() function after starting a debug session.
Page 11
M2351 emWin conversion result can be affected by power noise, mechanical misalignment, etc. To overcome this issue, the tslib supports calibration function, and the calibration parameter is stored in APROM offset 0x0007F800. The touch resolution and the APROM offset store calibration parameters in the M2351TouchPanel.h.
M2351 emWin 4 emWin GUIBuilder 4.1 Create Widget Segger provides a Windows tool GUIBuilder to create application with drag and drop interface. The tool is located under the ThirdParty\emWin\Tool\ directory. This tool can generate a file named FramewinDLG.c for the widget of target application. Please refer to chapter 20 of UM03001_emWin5.pdf for the usage of GUIBuilder.
Page 14
M2351 emWin hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, “2351”); value = 2351; // USER START (Optionally insert additional code for further widget initialization) // USER END break; case WM_NOTIFY_PARENT: = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; switch(Id) case ID_BUTTON_0: // Notifications sent by '+ 1' switch(NCode) case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message)
M2351 emWin 5 Change Display Panel 5.1 emWin Display Configuration emWin declares display panel resolution LCDConf.c under ThirdParty\emWin\Config\ directory. The resolution is different from the touch panel resolution defined in the M2351TouchPanel.h. This is because the panel is a portrait display and data is swapped before output for a landscape view by LCD driver IC.
Page 16
M2351 emWin using the EBI interface. For systems connecting display with the SPI or I C interface, spi.c or i2c.c needs to be added to the project. Oct. 18, 2018 Page 16 of 18 Rev 1.00...
Page 17
M2351 emWin Revision History Date Revision Description 2018.10.18 1.00 Initially issued. Oct. 18, 2018 Page 17 of 18 Rev 1.00...
Page 18
All Insecure Usage shall be made at customer’s risk, and in the event that third parties lay claims to Nuvoton as a result of customer’s Insecure Usage, customer shall indemnify the damages and liabilities thus incurred by Nuvoton.
Need help?
Do you have a question about the NuMicro M2351 Series and is the answer not in the manual?
Questions and answers