You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -81,7 +81,7 @@ Potential users of Arm-2D may have different backgrounds and purposes. Whether y
81
81
-[Where to Get Started](#where-to-get-started)
82
82
-[Table of Content](#table-of-content)
83
83
-[Features](#features)
84
-
-[In this version (ver1.1.3-dev)](#in-this-version-ver113-dev)
84
+
-[In this version (ver1.1.3)](#in-this-version-ver113-dev)
85
85
-[New Features Planned in the Future](#new-features-planned-in-the-future)
86
86
-[1 Introduction](#1-introduction)
87
87
-[1.1 The Background](#11-the-background)
@@ -101,7 +101,7 @@ Potential users of Arm-2D may have different backgrounds and purposes. Whether y
101
101
102
102
## Features
103
103
104
-
### In this version (ver1.1.3-dev)
104
+
### In this version (ver1.1.3)
105
105
106
106
The Arm-2D library provides **Low-Level 2D Image Processing Services** mainly used in **Deep Embedded Display system**. The supported features include but not limited to:
This document describes how to deploy the **Arm-2D** library to your existing MDK projects. If you are not familiar with **Arm-2D**, please start from the **[README](../README.md)** first.
4
4
5
5
### Table of Contents
6
+
6
7
-[1 How to get the Arm-2D](#1-how-to-get-the-arm-2d)
7
8
-[2 How to Deploy Arm-2D](#2-how-to-deploy-arm-2d)
8
9
-[2.1 Deploy Using CMSIS-Pack in MDK](#21-deploy-using-cmsis-pack-in-mdk)
9
10
-[3 Helper Services and Extras](#3-helper-services-and-extras)
After that, you will see two files, i.e. `arm_2d_disp_adapter_0.c` and `arm_2d_disp_adapter_0.h` have been added to the project manager under the **Acceleration** group.
187
+
188
+
**IMPORTANT**: unless necessary, please do **NOT** modify the content of the `arm_2d_disp_adapter_0.c`, as new versions of Arm-2D often introduce new features to the Display Adatper Service, as long as you haven't modified anything in the `arm_2d_disp_adapter_0.c`, updating to the latest version would be an easy task nothing more than right-clicking the file in the project manager and updating to the latest version in the pop-up menu.
189
+
190
+
**You have to initalise the Display Adapter service before using it**.
191
+
192
+
Include `arm_2d_disp_adapters.h` in your c source code and add the following code to the `main()` function:
193
+
194
+
```c
195
+
#include"arm_2d_helper.h"
196
+
#include"arm_2d_disp_adapters.h"
197
+
#include"arm_2d_scenes.h"
198
+
199
+
intmain (void)
200
+
{
201
+
...
202
+
arm_irq_safe {
203
+
arm_2d_init();
204
+
}
205
+
206
+
/* initialize the display adapter 0 service */
207
+
disp_adapter0_init();
208
+
209
+
while (1) {
210
+
/* the task function of the display adapter 0 service */
211
+
disp_adapter0_task();
212
+
}
213
+
}
214
+
```
215
+
216
+
Or the thread function if you want to run Arm-2d in an RTOS environment:
217
+
218
+
```c
219
+
#include "arm_2d_helper.h"
220
+
#include "arm_2d_disp_adapters.h"
221
+
#include "arm_2d_scenes.h"
222
+
223
+
#ifndef LCD_TARGET_FPS
224
+
# define LCD_TARGET_FPS 30
225
+
#endif
226
+
227
+
__NO_RETURN
228
+
void app_2d_main_thread (void *argument)
229
+
{
230
+
arm_irq_safe {
231
+
arm_2d_init();
232
+
}
233
+
234
+
/* initialize the display adapter 0 service */
235
+
disp_adapter0_init();
236
+
237
+
while(1) {
238
+
//! retrieve the number of system ticks
239
+
uint32_t wTick = osKernelGetTickCount();
240
+
while(arm_fsm_rt_cpl != disp_adapter0_task());
241
+
242
+
//! lock frame rate
243
+
osDelayUntil(wTick + (1000 / LCD_TARGET_FPS));
244
+
}
245
+
246
+
//osThreadExit();
247
+
}
248
+
```
249
+
250
+
251
+
252
+
### 3.3 Configue the Display Adapter Service
253
+
254
+
You should configure the Display Adapter service before using it. All the configurations of a Display Adapter service are stored in the corresponding header file, e.g. `arm_2d_disp_adapter_0.h`. In MDK, all configuration work can be done through the GUI wizard, as shown in **Figure 3-3**.
255
+
256
+
**Figure 3-3 Configure the Display Adapter Using the Wizard**
| Select the screen colour depth | 8bits/16bits/32bits | 16bits | The number of bits per pixel. For monochrome LCD and e-ink LCD, please select the 8bits. |
269
+
| Width of the screen | 8...32767 | 320 | The width of the target screen |
270
+
| Height of the screen | 8...32767 | 240 | The height of the target screen |
271
+
| Width of the PFB block | 1...32767 | 320 | The width of a partial frame buffer (PFB). If possible, please use the screen width here. |
272
+
| Height of the PFB block | 1...32767 | 240 | The height of a partial frame buffer (PFB). It is recommended to start from 1/10 of the height of the screen. If possible, do not use a value smaller than 8. |
273
+
| Width Alignment of generated PFBs | 1/2/4...128 pixels | 1 pixel | The horizontal pixel alignment of the PFBs sending to the `DispN_DrawBitmap()` for flushing. It is important for LCDs that have certain pixel alignment requirements. For example, 8 pixel alignment for monochrome LCDs and 4 pixel alignment for e-inks. |
274
+
| Height Alignment of generated PFBs | 1/2/4...128 pixels | 1 pixel | The vertical pixel alignment of the PFBs sending to the `DispN_DrawBitmap()` for flushing. It is important for LCDs that have certain pixel alignment requirements. For example, 8 pixel alignment for some 12864 monochrome LCDs. |
275
+
| PFB Block Count | 1...32767 | 1 | The number of PFB blocks in the pool. Please set it to `2` or more when using Asynchornose flushing mode; otherwise, keep it as `1`. |
276
+
| Number of iterations | 0...32767 | 30 | Calculate the real-time FPS for every specified number of frames. Set it to `0` to disable the real-time FPS calculation. |
277
+
| FPS Calculation Mode | Render-Only FPS/Real FPS | Render-Only FPS |**Render-Only FPS**: record the time used by the renderer and use it to calculate the FPS without taking LCD latency into consideration. <br />**Real FPS**: calculate the real FPS people actually see on the screen. |
278
+
| Swap the high and low bytes | Select/Unselect | Unselect | Some RGB565 LCDs require swapping the high and the low bytes for each pixel. Please **ONLY** enable this option when there is no hardware solution to swap the high and low bytes. |
279
+
| Enable the helper service for Asynchronous Flushing | Select/Unselect | Unselect | By selecting this option, a dedicated helper service will be provided for asynchronous flushing mode. For more, please read the guidance in the header file. |
280
+
| Disable the default Scene | Select/Unselect | Unselect | A Display Adapter brings a default scene for indicating successful porting. You can disable it by selecting this option. |
281
+
| Disable the navigation layer | Select/Unselect | Unselect | A Display Adapter uses the navigation layer (which is floating above the content created by users) to show real-time FPS and version info. You should disable it before the product releasing or disable it to add your own navigation layer. |
282
+
283
+
284
+
285
+
**NOTE**:
286
+
287
+
- If the target device cannot afford the full frame buffer, please set the PFB size (i.e. width and/or height) to a smaller value. **We recommend you start with a 1/10 full frame buffer**, as it actually isn't 10x slower than using a full frame buffer.
288
+
- For **monochrome LCDs**, you should use 8-bit colour depth and pack every 8 pixels into one byte in the `Disp0_DrawBitmap()`. Don't forget to set the PFB alignment to 8 horizontally or vertically depending on the monochrome LCD pixel layout.
289
+
- For **2-bit e-ink LCDs**, you should use 8-bit colour depth and pack every 4 pixels into one byte in the `Disp0_DrawBitmap()`. Don't forget to set the PFB alignment to 4 horizontally or vertically depending on the e-ink LCD pixel layout.
290
+
- For **4-bit e-ink LCDs**, you should use 8-bit colour depth and pack every 2 pixels into one byte in the `Disp0_DrawBitmap()`. Don't forget to set the PFB alignment to 2 horizontally or vertically depending on the e-ink LCD pixel layout.
291
+
- Please make sure the stack size is no less than 3K Bytes.
292
+
293
+
294
+
295
+
### 3.4 Implement the External Reference Timer
296
+
297
+
Arm-2D helper service relies on an external reference timer which we should implement:
298
+
299
+
**Table 3-2 The Interface for Accessing the External Timer**
| int64_t arm_2d_helper_get_system_timestamp(void) | a function that returns the number of ticks (timestamp) of the reference timer since reset. |
304
+
| uint32_t arm_2d_helper_get_reference_clock_frequency(void) | the frequency of the reference timer. |
305
+
306
+
307
+
308
+
**We highly recommand you to install perf_counter from Pack-Installer, [Keil Website](https://www.keil.arm.com/packs/) or [its Github repo](https://github.com/GorgonMeducer/perf_counter/releases) to simplify this process.** You have to initialize the perf_counter before using Arm-2D. For more, please read the [guidance here](https://github.com/GorgonMeducer/perf_counter/blob/main/README.md).
309
+
310
+
311
+
312
+
### 3.5 Verifying The Porting Result
313
+
314
+
After finished steps above, if everything goes well, you should see a screen as shown in **Figure 3-4**. If the colour doesn't look right and the LCD uses RGB565, try to swap the high and low bytes for each pixel.
315
+
316
+
**Figure 3-4 The Look of The Default Scene In A Succsessuf Porting**
159
317
318
+

160
319
161
320
162
-
### 3.2 Display Adapter Service
163
321
322
+
If you encounter any problems, please feel free to raise an issue.
164
323
324
+
Enjoy.
165
325
166
326
167
327
@@ -170,9 +330,9 @@ Here, `disp_ram` points to the memory space reserved for the LCD display RAM.
| benchmark | It is an **ALL-IN-ONE** example that demonstrates almost all features provided by Arm-2D. By setting different PFB sizes, you can evaluate the 2D image processing capability for the target system. | examples/benchmark |Can be used as benchmark. |
176
-
| watch_panel | It is a dedicated example of a smart-watch-like panel. A pointer and two gears rotate at different angular velocities on a translucent watch panel with a dynamic background. | examples/watch_panel |Can be used as benchmark |
177
-
|\[template\]\[bare-metal\]\[pfb\]| It is a project template for the bare-metal environment. | examples/\[template\]\[bare-metal\]\[pfb\]| Project Template |
178
-
|\[template\]\[cmsis-rtos2\]\[pfb\]| It is a project template for the RTOS environment, which use CMSIS-RTO2 as an example to show how Arm-2D can work with an RTOS. | examples/\[template\]\[cmsis-rtos2\]\[pfb\]| Project Template|
| benchmark | It is an **ALL-IN-ONE** example that demonstrates almost all features provided by Arm-2D. By setting different PFB sizes, you can evaluate the 2D image processing capability for the target system. | examples/benchmark |**Used as benchmark.**|
336
+
| watch_panel | It is a dedicated example of a smart-watch-like panel. A pointer and two gears rotate at different angular velocities on a translucent watch panel with a dynamic background. | examples/watch_panel |**Used as benchmark**|
337
+
|\[template\]\[bare-metal\]\[pfb\]| It is a project template for the bare-metal environment. | examples/\[template\]\[bare-metal\]\[pfb\]| Project Template |
338
+
|\[template\]\[cmsis-rtos2\]\[pfb\]| It is a project template for the RTOS environment, which use CMSIS-RTOS2 as an example to show how Arm-2D can work with an RTOS. | examples/\[template\]\[cmsis-rtos2\]\[pfb\]| Project Template |
0 commit comments