last update: 2025/04
評価版emWin GUIのデモサンプル(画面作成ツール:AppWizard、直接APIプログラム)
開発環境/IDE:SEGGER Embedded Studio (GCC)
【開発環境無償評価版ダウンロード】
GUI | AppWizard, emWin BASE + AntiAliasing, Bitmap Converter, Font Converter, Memory Devices, Simulation, Widgets, Window Manager, GUIDRV_Lin |
---|
リリースプログラムの「RSK-RZA1H」フォルダを、開発環境インストール済みのユーザーパソコンのローカルドライブにコピーします。Windowsインストーラは不要です。
[Workspace] ├ RSK-RZA1H ├ Demo_800x480 ...... emWin GUIデモサンプルフォルダ ├ Simulation ...... Visual Studio環境で確認できるemWinシミュレータプロジェクト ├ Target ........... RSK RZ/A1H評価ボード用BSP、emWin GUIライブラリ、RTOS
Demo_800x480 ├ AppWizard .......... AppWizard画面設計ツールから作成した各種デモサンプル └ emWinAPI ............ emWin APIプログラミングで作成した各種デモサンプル
Target ├ Application .......... アプリケーションエントリハンドラ ├ BSP ................. ハードウエア依存設定、起動ごの初期化、ドライバ ├ GUI ................. emWin GUI関連のヘッダ、評価版ライブラリ、 ├ コンフィグレーション設定、システム依存設定 ├ OS ................. embOS RTOSの評価版ライブラリ ├ License.txt .......... 評価版ライブラリの利用条件 └ Start.emProject ..... Embedded Studio環境用プロジェクト
SEGGER Embedded Studio for ARM(統合開発環境)の無償評価版は以下URLからダウンロード可能です。
https://www.segger.com/downloads/embedded-studio/
対応ホスト環境:Windows、Linux、macOS
※ emWinシミュレータ環境でGUIアプリケーションの動作確認を行う場合は、Visual Studioツールをインストールしてください。
Target └ BSP └ R7S72100_RSK_RZA1H └ Setup ├ System ........... RZ/A1マイコンデバイスの各種ドライバ(ルネサス様作成) ├ ARM_Startup.s ......... Arm CPUリセット・例外ハンドラ処理 ├ SEGGER_ARM_Startup.s .... コンパイラ・ツール依存の初期化処理 ├ BSP.c ................ ボード上のLEDインターフェースのドライバ ├ BSP_UART.c ............. ボード上のUART2(CN18)インターフェースドライバ ├ RTOSInit_R7S72100.c .... embOSカーネル初期化、システムタイマハンドラ ├ OS_Error.c ............ OSエラーのコールバック処理 ├ R7S72100_RAM.icf ...... Debugビルド構成のリンカーマップ設定 └ R7S72100_Flash.icf ..... Releaseビルド構成のリンカーマップ設定
PLL初期化設定ファイル:RTOSInit_R7S72100.c(__low_level_init)
メインクロック:13.33MHz
CPUクロック:399.9MHz(13.33MHz x 30)
画像処理クロック:133.3MHz
MMUテーブルの定義・設定内容は「RTOSInit_R7S72100.c」ファイルの__low_level_init()関数をご参照ください。L2キャッシュ、命令キャッシュ、データキャッシュを有効に設定しています。
ROM | 0x18000000 ~ 0x1BFFFFFF(QSPIフラッシュ領域) |
RAM | 0x60020000 ~ 0x609FFFFF(内蔵SRAM) |
※ 本パッケージのサンプルプログラムはすべて内部SRAMだけで動かせます。外部SDRAMのバスインターフェースは使用していません。
Target └ GUI ├ FS ......... ファイルシステムインターフェース(未使用) ├ Lib ........ emWin GUI関連のヘッダ、評価版ライブラリ(libGUI_rza1h_trial.a) ├ OS ......... emWin RTOSインターフェースドライバ └ Setup └ R7S72100_Renesas_RSK_RZA1H ├ GUIConf.c ......... GUIランタイムコンフィグレーション設定ファイル ├ GUIConf.h ......... GUIビルドコンフィグレーション設定ファイル ├ LCDConf.c ......... LCDドライバ設定ファイル ├ LCDConf.h ......... LCDドライバ関連のヘッダ定義 ├ PIDConf.c ......... タッチパネルドライバインターフェース └ PIDConf.h ......... タッチパネルドライバ関連のヘッダ定義
emWinプログラムのバージョン:emWin V6.48
emWinコンポーネント(評価版ライブラリに含む):emWin PROパッケージ(フルカラーサポート、タッチパネルサポート、AntiAliasing、Memory devices、Window Manager、Widgets、GUIDRV_Linドライバ)、マルチタッチサポート
emWin画面の設計は以下の2つの方法があります。
評価版のemWin開発支援ツール(AppWizard、BmpCvt、FontCvtDemo、Bin2C)は以下URLからダウンロード可能です。
https://www.segger.com/downloads/emwin/
AppWizardツール、Font変換、ビットマップ変換ツールは評価ボード環境での評価目的のご利用は無償ですが、製品開発の場合は商用利用ライセンスが必要です。
評価版emWinライブラリは以下のコンフィグレーション設定でビルドしています。
設定ファイル:GUIConf.h ※設定内容の変更はできません。
#if DEBUG #ifndef GUI_DEBUG_LEVEL #define GUI_DEBUG_LEVEL 4 // Default for debug builds #endif #else #ifndef GUI_DEBUG_LEVEL #define GUI_DEBUG_LEVEL 0 // Default for release builds #endif #endif #define GUI_NUM_LAYERS (16) // Maximum number of available layers #define GUI_OS (1) // Compile with multitasking support #define GUI_SUPPORT_TOUCH (1) // Support touchscreen #define GUI_SUPPORT_MOUSE (1) // Support a mouse #define GUI_SUPPORT_UNICODE (1) // Support mixed ASCII/UNICODE strings #define GUI_WINSUPPORT (1) // Window manager package available #define GUI_SUPPORT_MEMDEV (1) // Memory devices available #define GUI_SUPPORT_AA (1) // Anti aliasing available #define WM_SUPPORT_STATIC_MEMDEV (1) // Static memory devices available
emWinの内部処理、メモリデバイス機能、ウインドウマネジャ実行に専用メモリプールが必要です。本デモサンプルプロジェクトではemWin用4MByteサイズのメモリブロックを使用します。
設定ファイル:GUIConf.c
#define GUI_NUMBYTES (0x400000) // 4MB void GUI_X_Config(void) { // 32 bit aligned memory area static U32 aMemory[GUI_NUMBYTES / 4]; // Assign memory to emWin GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES); //
LCDドライバ設定ファイル:LCDConf.c
カラー設定(BPP):32、16(デフォルト)
// // Color depth // #define BITS_PER_PIXEL 16 // Allowed values: 16, 32
emWinのGUIDRVドライバ設定:
カラー設定値に合わせて「GUIDRV_LIN_16」または「GUIDRV_LIN_32」ドライバを設定します。
#if (BITS_PER_PIXEL == 32) #define COLOR_CONVERSION GUICC_M8888I #define DISPLAY_DRIVER GUIDRV_LIN_32 #else #define COLOR_CONVERSION GUICC_M565 #define DISPLAY_DRIVER GUIDRV_LIN_16 #endif void LCD_X_Config(void) { // // Set display driver and color conversion for 1st layer // GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0); //
LCDドライバが使用するメモリリソース:
画面のちらつき防止のためにビデオバッファを2つ使用します。
ビデオメモリサイズ(Byte) = 2 x 800 x 480 x (LCD_BITSPERPIXEL / 8)
16bitカラーモードの場合は、ビデオメモリに約 1.5MByte(=2 x 800 x 480 x 16/8) RAMを使用します。32bitカラーモードの場合は、ビデオメモリに約 3MByte RAMが必要です。
タッチパネルドライバ設定ファイル:PIDConf.c
専用タスクを使用してタッチパネルの入力データ(I2C通信)を読み出してemWinのタッチイベントハンドラに情報を送ります。タッチパネルドライバはマルチタッチイベント(5ポイントまで)に対応していますので、ピンチによる拡大縮小などユーザジェスチャーもサポートします。
「RSK-RZA1H」評価ボードのハードウエア仕様はオンラインユーザマニュアル資料をご参照ください。
ボードの電源コネクタ「CN5」から電源(+5V DC、PWR_SEL 2-3にジャンパー設定)を供給します。
QSPIフラッシュからブートするようにボード上のSW6 DIPスイッチを設定します。
MD_BOOT0(SW6-1) | 「OFF」側に設定 |
---|---|
MD_BOOT1(SW6-2) | 「ON」側に設定 |
MD_BOOT2(SW6-3) | 「OFF」側に設定 |
ボード上のCN14(ARM JTAG20)またはCN13(CoreSight 20)コネクタにJ-Linkデバッグプローブを接続します。CN14(ARM JTAG20)コネクタにはJ-Link付属のフラット20-Pinリボンケーブルで接続できますが、CN13(CoreSight 20)コネクタの場合はJ-Link用19-Pin変換アダプタが必要です。
CN44(50Pin)コネクタにRSKキットのLCD液晶パネル(800x480ピクセル)を接続します。
emWin ユーザガイド(オンライン):
※Google Chrome等でオンライン翻訳機能をご利用になると便利です。
https://www.segger.com/doc/UM03001_emWin.html
AppWizard ツールユーザガイド(オンライン):
https://www.segger.com/doc/UM03003_AppWizard.html
emWin Wiki / Knowledge Base:
https://kb.segger.com/emWin
emWin API Example Samples:
https://kb.segger.com/emWin_Examples
emWin・AppWizard機能使用方法、チュートリアルビデオ:
https://www.segger.com/videos/#emwin
SEGGER's Friendly License (SFL), January 16th 2020 For non-commercial use or for evaluation purposes, you - regardless whether you are an individual person or a legal entity - are welcome to use the software free of charge under this license. Any other use of the software is considered commercial use, for which a commercial-use license must be obtained from SEGGER. DEFINITIONS "Non-commercial use" means using the software for teaching, learning, studying, or projects that do not have a commercial background. If the software is used for products or services intended to be sold, the use is considered to be commercial. "Evaluation" means you are trying out the software for possible future use. While the length of this time period is up to you, once it becomes a standard part of your workflow we no longer consider it evaluation. DISCLAIMER OF WARRANTY When using the software under this license, you accept that it is provided on an "as is" basis, without warranty of any kind. LIMITATION OF LIABILITY When using the software under this license, you accept that SEGGER is not liable for any damages arising out of the use of or inability to use the software. 3RD-PARTY SOFTWARE AND LICENSES More information about 3rd-party components, if any, included in the software and the licenses that these components are under can be found in the file doc/license/3rd-party.txt after installation of the software. RESTRICTIONS You may not: (a) decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code of the software, (b) redistribute, encumber, sell, rent, lease, sublicense, or otherwise transfer rights in the software, (c) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels of the software. REVOCATION SEGGER reserves the right to revoke the right to use the software granted by this license on a case-by-case basis. In this unlikely event, SEGGER will provide the revocation notice in writing, allowing an adequate notice period. APPLICABLE LAW, VENUE German Law (with the exception of its rules for Conflicts of Law) applies. Sole venue is Monheim/Rhein. (c) 2020 - 2021 SEGGER Microcontroller GmbH www.segger.com info@segger.com