diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/BearPi_STM32L31RC.uvoptx b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/BearPi_STM32L31RC.uvoptx
new file mode 100644
index 00000000..810275e2
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/BearPi_STM32L31RC.uvoptx
@@ -0,0 +1,1248 @@
+
+
+
+ 1.0
+
+ ### uVision Project, (C) Keil Software
+
+
+ *.c
+ *.s*; *.src; *.a*
+ *.obj; *.o
+ *.lib
+ *.txt; *.h; *.inc
+ *.plm
+ *.cpp
+ 0
+
+
+
+ 0
+ 0
+
+
+
+ TencentOS_tiny
+ 0x4
+ ARM-ADS
+
+ 80000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\list\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 1
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM))
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U066CFF343637424257194226 -O10446 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)
+
+
+
+
+ 0
+ 0
+ 245
+ 1
+ 134228264
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c
+
+ \\TencentOS_tiny\../../../../arch/arm/arm-v7m/common/tos_cpu.c\245
+
+
+ 1
+ 0
+ 251
+ 1
+ 134228282
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c
+
+ \\TencentOS_tiny\../../../../arch/arm/arm-v7m/common/tos_cpu.c\251
+
+
+
+
+ 0
+ 1
+ tos_next_task
+
+
+ 1
+ 1
+ tos_rdyq.highest_prio
+
+
+ 2
+ 1
+ task_list
+
+
+ 3
+ 1
+ 0x20000280
+
+
+ 4
+ 1
+ tos_rdyq.highest_prio
+
+
+ 5
+ 1
+ owner
+
+
+ 6
+ 1
+ tos_curr_task
+
+
+ 7
+ 1
+ highest_pending_prio
+
+
+ 8
+ 1
+ task
+
+
+
+
+ 1
+ 0
+ 0x200016F4
+ 0
+
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
+
+ Application/MDK-ARM
+ 0
+ 0
+ 0
+ 0
+
+ 1
+ 1
+ 2
+ 0
+ 0
+ 0
+ startup_stm32l431xx.s
+ startup_stm32l431xx.s
+ 0
+ 0
+
+
+
+
+ Application/User
+ 1
+ 0
+ 0
+ 0
+
+ 2
+ 2
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\gpio.c
+ gpio.c
+ 0
+ 0
+
+
+ 2
+ 3
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\main.c
+ main.c
+ 0
+ 0
+
+
+ 2
+ 4
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\mcu_init.c
+ mcu_init.c
+ 0
+ 0
+
+
+ 2
+ 5
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\stm32l4xx_hal_msp.c
+ stm32l4xx_hal_msp.c
+ 0
+ 0
+
+
+ 2
+ 6
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\stm32l4xx_it.c
+ stm32l4xx_it.c
+ 0
+ 0
+
+
+ 2
+ 7
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\usart.c
+ usart.c
+ 0
+ 0
+
+
+ 2
+ 8
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\adc.c
+ adc.c
+ 0
+ 0
+
+
+ 2
+ 9
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\i2c.c
+ i2c.c
+ 0
+ 0
+
+
+ 2
+ 10
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\spi.c
+ spi.c
+ 0
+ 0
+
+
+
+
+ examples
+ 1
+ 0
+ 0
+ 0
+
+ 3
+ 11
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\examples\stemwin_gui_demo\tos_stemwin_gui_test_demo.c
+ tos_stemwin_gui_test_demo.c
+ 0
+ 0
+
+
+
+
+ Drivers/STM32L4xx_HAL_Driver
+ 0
+ 0
+ 0
+ 0
+
+ 4
+ 12
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c
+ stm32l4xx_hal_tim.c
+ 0
+ 0
+
+
+ 4
+ 13
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c
+ stm32l4xx_hal_tim_ex.c
+ 0
+ 0
+
+
+ 4
+ 14
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c
+ stm32l4xx_hal_uart.c
+ 0
+ 0
+
+
+ 4
+ 15
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c
+ stm32l4xx_hal_uart_ex.c
+ 0
+ 0
+
+
+ 4
+ 16
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c
+ stm32l4xx_hal.c
+ 0
+ 0
+
+
+ 4
+ 17
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c
+ stm32l4xx_hal_i2c.c
+ 0
+ 0
+
+
+ 4
+ 18
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c
+ stm32l4xx_hal_i2c_ex.c
+ 0
+ 0
+
+
+ 4
+ 19
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c
+ stm32l4xx_hal_rcc.c
+ 0
+ 0
+
+
+ 4
+ 20
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c
+ stm32l4xx_hal_rcc_ex.c
+ 0
+ 0
+
+
+ 4
+ 21
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c
+ stm32l4xx_hal_flash.c
+ 0
+ 0
+
+
+ 4
+ 22
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c
+ stm32l4xx_hal_flash_ex.c
+ 0
+ 0
+
+
+ 4
+ 23
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c
+ stm32l4xx_hal_flash_ramfunc.c
+ 0
+ 0
+
+
+ 4
+ 24
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c
+ stm32l4xx_hal_gpio.c
+ 0
+ 0
+
+
+ 4
+ 25
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c
+ stm32l4xx_hal_dma.c
+ 0
+ 0
+
+
+ 4
+ 26
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c
+ stm32l4xx_hal_dma_ex.c
+ 0
+ 0
+
+
+ 4
+ 27
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c
+ stm32l4xx_hal_pwr.c
+ 0
+ 0
+
+
+ 4
+ 28
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c
+ stm32l4xx_hal_pwr_ex.c
+ 0
+ 0
+
+
+ 4
+ 29
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c
+ stm32l4xx_hal_cortex.c
+ 0
+ 0
+
+
+ 4
+ 30
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c
+ stm32l4xx_hal_adc_ex.c
+ 0
+ 0
+
+
+ 4
+ 31
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c
+ stm32l4xx_hal_adc.c
+ 0
+ 0
+
+
+ 4
+ 32
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c
+ stm32l4xx_hal_dac.c
+ 0
+ 0
+
+
+ 4
+ 33
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c
+ stm32l4xx_hal_dac_ex.c
+ 0
+ 0
+
+
+ 4
+ 34
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c
+ stm32l4xx_hal_spi.c
+ 0
+ 0
+
+
+ 4
+ 35
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c
+ stm32l4xx_hal_spi_ex.c
+ 0
+ 0
+
+
+
+
+ Drivers/CMSIS
+ 1
+ 0
+ 0
+ 0
+
+ 5
+ 36
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Src\system_stm32l4xx.c
+ system_stm32l4xx.c
+ 0
+ 0
+
+
+
+
+ Hardware
+ 1
+ 0
+ 0
+ 0
+
+ 6
+ 37
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Hardware\BH1750\BH1750.c
+ BH1750.c
+ 0
+ 0
+
+
+ 6
+ 38
+ 1
+ 0
+ 0
+ 0
+ ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c
+ lcd_spi2_drv.c
+ 0
+ 0
+
+
+
+
+ kernel
+ 0
+ 0
+ 0
+ 0
+
+ 7
+ 39
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_mmblk.c
+ tos_mmblk.c
+ 0
+ 0
+
+
+ 7
+ 40
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_mmheap.c
+ tos_mmheap.c
+ 0
+ 0
+
+
+ 7
+ 41
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_mutex.c
+ tos_mutex.c
+ 0
+ 0
+
+
+ 7
+ 42
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_sched.c
+ tos_sched.c
+ 0
+ 0
+
+
+ 7
+ 43
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_sem.c
+ tos_sem.c
+ 0
+ 0
+
+
+ 7
+ 44
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_sys.c
+ tos_sys.c
+ 0
+ 0
+
+
+ 7
+ 45
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_task.c
+ tos_task.c
+ 0
+ 0
+
+
+ 7
+ 46
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_tick.c
+ tos_tick.c
+ 0
+ 0
+
+
+ 7
+ 47
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_time.c
+ tos_time.c
+ 0
+ 0
+
+
+ 7
+ 48
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_timer.c
+ tos_timer.c
+ 0
+ 0
+
+
+ 7
+ 49
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_event.c
+ tos_event.c
+ 0
+ 0
+
+
+ 7
+ 50
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_global.c
+ tos_global.c
+ 0
+ 0
+
+
+ 7
+ 51
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_pend.c
+ tos_pend.c
+ 0
+ 0
+
+
+ 7
+ 52
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_robin.c
+ tos_robin.c
+ 0
+ 0
+
+
+ 7
+ 53
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_binary_heap.c
+ tos_binary_heap.c
+ 0
+ 0
+
+
+ 7
+ 54
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_char_fifo.c
+ tos_char_fifo.c
+ 0
+ 0
+
+
+ 7
+ 55
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_completion.c
+ tos_completion.c
+ 0
+ 0
+
+
+ 7
+ 56
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_countdownlatch.c
+ tos_countdownlatch.c
+ 0
+ 0
+
+
+ 7
+ 57
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_mail_queue.c
+ tos_mail_queue.c
+ 0
+ 0
+
+
+ 7
+ 58
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_message_queue.c
+ tos_message_queue.c
+ 0
+ 0
+
+
+ 7
+ 59
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_priority_mail_queue.c
+ tos_priority_mail_queue.c
+ 0
+ 0
+
+
+ 7
+ 60
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_priority_message_queue.c
+ tos_priority_message_queue.c
+ 0
+ 0
+
+
+ 7
+ 61
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_priority_queue.c
+ tos_priority_queue.c
+ 0
+ 0
+
+
+ 7
+ 62
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\kernel\core\tos_ring_queue.c
+ tos_ring_queue.c
+ 0
+ 0
+
+
+
+
+ cpu
+ 0
+ 0
+ 0
+ 0
+
+ 8
+ 63
+ 2
+ 0
+ 0
+ 0
+ ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S
+ port_s.S
+ 0
+ 0
+
+
+ 8
+ 64
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c
+ tos_cpu.c
+ 0
+ 0
+
+
+ 8
+ 65
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c
+ port_c.c
+ 0
+ 0
+
+
+
+
+ cmsis
+ 0
+ 0
+ 0
+ 0
+
+ 9
+ 66
+ 1
+ 0
+ 0
+ 0
+ ..\..\..\..\osal\cmsis_os\cmsis_os.c
+ cmsis_os.c
+ 0
+ 0
+
+
+
+
+ config
+ 0
+ 0
+ 0
+ 0
+
+ 10
+ 67
+ 5
+ 0
+ 0
+ 0
+ ..\..\TOS-CONFIG\tos_config.h
+ tos_config.h
+ 0
+ 0
+
+
+
+
+ emwin_config
+ 1
+ 0
+ 0
+ 0
+
+ 11
+ 68
+ 1
+ 0
+ 0
+ 0
+ .\STemWin_Config\Config\GUIConf.c
+ GUIConf.c
+ 0
+ 0
+
+
+ 11
+ 69
+ 1
+ 0
+ 0
+ 0
+ .\STemWin_Config\OS\GUI_X_TOS.c
+ GUI_X_TOS.c
+ 0
+ 0
+
+
+ 11
+ 70
+ 1
+ 0
+ 0
+ 0
+ .\STemWin_Config\Config\LCDConf_FlexColor_Template.c
+ LCDConf_FlexColor_Template.c
+ 0
+ 0
+
+
+
+
+ emwin_lib
+ 1
+ 0
+ 0
+ 0
+
+ 12
+ 71
+ 4
+ 0
+ 0
+ 0
+ ..\..\..\..\components\gui\STemWin\Lib\STemWin532_CM4_Keil.lib
+ STemWin532_CM4_Keil.lib
+ 0
+ 0
+
+
+
+
+ ::CMSIS
+ 0
+ 0
+ 0
+ 1
+
+
+
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/BearPi_STM32L31RC.uvprojx b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/BearPi_STM32L31RC.uvprojx
new file mode 100644
index 00000000..cd8aa379
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/BearPi_STM32L31RC.uvprojx
@@ -0,0 +1,817 @@
+
+
+
+ 2.1
+
+ ### uVision Project, (C) Keil Software
+
+
+
+ TencentOS_tiny
+ 0x4
+ ARM-ADS
+ 5060750::V5.06 update 6 (build 750)::ARMCC
+ 0
+
+
+ STM32L431RCTx
+ STMicroelectronics
+ Keil.STM32L4xx_DFP.2.1.0
+ http://www.keil.com/pack
+ IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd
+ 0
+ 0
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 1
+
+ .\obj\
+ TencentOS_tiny
+ 1
+ 0
+ 1
+ 1
+ 0
+ .\list\
+ 1
+ 0
+ 0
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+ 0
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 3
+
+
+ 0
+
+
+ SARMCM3.DLL
+ -REMAP -MPU
+ DCM.DLL
+ -pCM4
+ SARMCM3.DLL
+ -MPU
+ TCM.DLL
+ -pCM4
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 16
+
+
+
+
+ 1
+ 0
+ 0
+ 1
+ 1
+ 4107
+
+ 1
+ BIN\UL2CM3.DLL
+
+
+
+
+
+ 0
+
+
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ "Cortex-M4"
+
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 0
+ 2
+ 0
+ 0
+ 0
+ 8
+ 1
+ 0
+ 0
+ 0
+ 3
+ 3
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20000000
+ 0x10000
+
+
+ 1
+ 0x8000000
+ 0x40000
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x8000000
+ 0x40000
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20000000
+ 0x10000
+
+
+ 0
+ 0x0
+ 0x0
+
+
+
+
+
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 2
+ 0
+ 0
+ 1
+ 0
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 0
+
+
+ USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266
+
+ ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\LCD_ST7789;..\..\BSP\Hardware\BH1750;..\..\..\..\examples\stemwin_gui_demo;..\..\..\..\components\gui\STemWin\inc;.\STemWin_Config\Config
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20000000
+
+
+
+
+
+
+
+
+
+
+
+
+ Application/MDK-ARM
+
+
+ startup_stm32l431xx.s
+ 2
+ startup_stm32l431xx.s
+
+
+
+
+ Application/User
+
+
+ gpio.c
+ 1
+ ..\..\BSP\Src\gpio.c
+
+
+ main.c
+ 1
+ ..\..\BSP\Src\main.c
+
+
+ mcu_init.c
+ 1
+ ..\..\BSP\Src\mcu_init.c
+
+
+ stm32l4xx_hal_msp.c
+ 1
+ ..\..\BSP\Src\stm32l4xx_hal_msp.c
+
+
+ stm32l4xx_it.c
+ 1
+ ..\..\BSP\Src\stm32l4xx_it.c
+
+
+ usart.c
+ 1
+ ..\..\BSP\Src\usart.c
+
+
+ adc.c
+ 1
+ ..\..\BSP\Src\adc.c
+
+
+ i2c.c
+ 1
+ ..\..\BSP\Src\i2c.c
+
+
+ spi.c
+ 1
+ ..\..\BSP\Src\spi.c
+
+
+
+
+ examples
+
+
+ tos_stemwin_gui_test_demo.c
+ 1
+ ..\..\..\..\examples\stemwin_gui_demo\tos_stemwin_gui_test_demo.c
+
+
+
+
+ Drivers/STM32L4xx_HAL_Driver
+
+
+ stm32l4xx_hal_tim.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c
+
+
+ stm32l4xx_hal_tim_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c
+
+
+ stm32l4xx_hal_uart.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c
+
+
+ stm32l4xx_hal_uart_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c
+
+
+ stm32l4xx_hal.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c
+
+
+ stm32l4xx_hal_i2c.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c
+
+
+ stm32l4xx_hal_i2c_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c
+
+
+ stm32l4xx_hal_rcc.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c
+
+
+ stm32l4xx_hal_rcc_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c
+
+
+ stm32l4xx_hal_flash.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c
+
+
+ stm32l4xx_hal_flash_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c
+
+
+ stm32l4xx_hal_flash_ramfunc.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c
+
+
+ stm32l4xx_hal_gpio.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c
+
+
+ stm32l4xx_hal_dma.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c
+
+
+ stm32l4xx_hal_dma_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c
+
+
+ stm32l4xx_hal_pwr.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c
+
+
+ stm32l4xx_hal_pwr_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c
+
+
+ stm32l4xx_hal_cortex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c
+
+
+ stm32l4xx_hal_adc_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c
+
+
+ stm32l4xx_hal_adc.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c
+
+
+ stm32l4xx_hal_dac.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c
+
+
+ stm32l4xx_hal_dac_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c
+
+
+ stm32l4xx_hal_spi.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c
+
+
+ stm32l4xx_hal_spi_ex.c
+ 1
+ ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c
+
+
+
+
+ Drivers/CMSIS
+
+
+ system_stm32l4xx.c
+ 1
+ ..\..\BSP\Src\system_stm32l4xx.c
+
+
+
+
+ Hardware
+
+
+ BH1750.c
+ 1
+ ..\..\BSP\Hardware\BH1750\BH1750.c
+
+
+ lcd_spi2_drv.c
+ 1
+ ..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c
+
+
+
+
+ kernel
+
+
+ tos_mmblk.c
+ 1
+ ..\..\..\..\kernel\core\tos_mmblk.c
+
+
+ tos_mmheap.c
+ 1
+ ..\..\..\..\kernel\core\tos_mmheap.c
+
+
+ tos_mutex.c
+ 1
+ ..\..\..\..\kernel\core\tos_mutex.c
+
+
+ tos_sched.c
+ 1
+ ..\..\..\..\kernel\core\tos_sched.c
+
+
+ tos_sem.c
+ 1
+ ..\..\..\..\kernel\core\tos_sem.c
+
+
+ tos_sys.c
+ 1
+ ..\..\..\..\kernel\core\tos_sys.c
+
+
+ tos_task.c
+ 1
+ ..\..\..\..\kernel\core\tos_task.c
+
+
+ tos_tick.c
+ 1
+ ..\..\..\..\kernel\core\tos_tick.c
+
+
+ tos_time.c
+ 1
+ ..\..\..\..\kernel\core\tos_time.c
+
+
+ tos_timer.c
+ 1
+ ..\..\..\..\kernel\core\tos_timer.c
+
+
+ tos_event.c
+ 1
+ ..\..\..\..\kernel\core\tos_event.c
+
+
+ tos_global.c
+ 1
+ ..\..\..\..\kernel\core\tos_global.c
+
+
+ tos_pend.c
+ 1
+ ..\..\..\..\kernel\core\tos_pend.c
+
+
+ tos_robin.c
+ 1
+ ..\..\..\..\kernel\core\tos_robin.c
+
+
+ tos_binary_heap.c
+ 1
+ ..\..\..\..\kernel\core\tos_binary_heap.c
+
+
+ tos_char_fifo.c
+ 1
+ ..\..\..\..\kernel\core\tos_char_fifo.c
+
+
+ tos_completion.c
+ 1
+ ..\..\..\..\kernel\core\tos_completion.c
+
+
+ tos_countdownlatch.c
+ 1
+ ..\..\..\..\kernel\core\tos_countdownlatch.c
+
+
+ tos_mail_queue.c
+ 1
+ ..\..\..\..\kernel\core\tos_mail_queue.c
+
+
+ tos_message_queue.c
+ 1
+ ..\..\..\..\kernel\core\tos_message_queue.c
+
+
+ tos_priority_mail_queue.c
+ 1
+ ..\..\..\..\kernel\core\tos_priority_mail_queue.c
+
+
+ tos_priority_message_queue.c
+ 1
+ ..\..\..\..\kernel\core\tos_priority_message_queue.c
+
+
+ tos_priority_queue.c
+ 1
+ ..\..\..\..\kernel\core\tos_priority_queue.c
+
+
+ tos_ring_queue.c
+ 1
+ ..\..\..\..\kernel\core\tos_ring_queue.c
+
+
+
+
+ cpu
+
+
+ port_s.S
+ 2
+ ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S
+
+
+ tos_cpu.c
+ 1
+ ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c
+
+
+ port_c.c
+ 1
+ ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c
+
+
+
+
+ cmsis
+
+
+ cmsis_os.c
+ 1
+ ..\..\..\..\osal\cmsis_os\cmsis_os.c
+
+
+
+
+ config
+
+
+ tos_config.h
+ 5
+ ..\..\TOS-CONFIG\tos_config.h
+
+
+
+
+ emwin_config
+
+
+ GUIConf.c
+ 1
+ .\STemWin_Config\Config\GUIConf.c
+
+
+ GUI_X_TOS.c
+ 1
+ .\STemWin_Config\OS\GUI_X_TOS.c
+
+
+ LCDConf_FlexColor_Template.c
+ 1
+ .\STemWin_Config\Config\LCDConf_FlexColor_Template.c
+
+
+
+
+ emwin_lib
+
+
+ STemWin532_CM4_Keil.lib
+ 4
+ ..\..\..\..\components\gui\STemWin\Lib\STemWin532_CM4_Keil.lib
+
+
+
+
+ ::CMSIS
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/RTE/_TencentOS_tiny/RTE_Components.h b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/RTE/_TencentOS_tiny/RTE_Components.h
new file mode 100644
index 00000000..3347054c
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/RTE/_TencentOS_tiny/RTE_Components.h
@@ -0,0 +1,20 @@
+
+/*
+ * Auto generated Run-Time-Environment Component Configuration File
+ * *** Do not modify ! ***
+ *
+ * Project: 'BearPi_STM32L31RC'
+ * Target: 'TencentOS_tiny'
+ */
+
+#ifndef RTE_COMPONENTS_H
+#define RTE_COMPONENTS_H
+
+
+/*
+ * Define the Device Header File:
+ */
+#define CMSIS_device_header "stm32l4xx.h"
+
+
+#endif /* RTE_COMPONENTS_H */
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIConf.c b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIConf.c
new file mode 100644
index 00000000..27255530
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIConf.c
@@ -0,0 +1,96 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIConf.c
+Purpose : Display controller initialization
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include "GUI.h"
+
+/*********************************************************************
+*
+* Defines
+*
+**********************************************************************
+*/
+//
+// Define the available number of bytes available for the GUI
+//
+#define GUI_NUMBYTES (16*1024)//0x200000 //ÉèÖÃEMWINÄÚ´æ´óС
+
+/*********************************************************************
+*
+* Public code
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* GUI_X_Config
+*
+* Purpose:
+* Called during the initialization process in order to set up the
+* available memory for the GUI.
+*/
+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);
+ //
+ // Set default font
+ //
+ GUI_SetDefaultFont(GUI_FONT_6X8);
+}
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIConf.h b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIConf.h
new file mode 100644
index 00000000..429d127c
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIConf.h
@@ -0,0 +1,98 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIConf.h
+Purpose : Configures emWins abilities, fonts etc.
+----------------------------------------------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef GUICONF_H
+#define GUICONF_H
+/*********************************************************************
+*
+* Multi layer/display support ÏÔʾµÄ×î´ó²ãÊý
+*/
+#define GUI_NUM_LAYERS 2 // Maximum number of available layers
+
+/*********************************************************************
+*
+* Multi tasking support
+*/
+#ifdef OS_SUPPORT
+ #define GUI_OS (1) // Compile with multitasking support
+#else
+ #define GUI_OS (0) //²»Ê¹ÓòÙ×÷ϵͳ
+#endif
+/*********************************************************************
+*
+* Configuration of touch support
+*/
+#ifndef GUI_SUPPORT_TOUCH
+ #define GUI_SUPPORT_TOUCH (0) //ÅäÖò»Ö§³Ö´¥Ãþ
+#endif
+
+/*********************************************************************
+*
+* Default font
+*/
+#define GUI_DEFAULT_FONT &GUI_Font6x8 //ĬÈÏÖ§³Ö×ÖÌå
+
+/*********************************************************************
+*
+* Configuration of available packages
+*/
+//ʹÓÃÊó±ê
+#define GUI_SUPPORT_MOUSE (0) /* Support a mouse */
+//Ö§³Ö´°¿Ú¹ÜÀí
+#define GUI_WINSUPPORT (1) /* Use window manager */
+//Ö§³Ö´æ´¢É豸
+#define GUI_SUPPORT_MEMDEV (1) /* Memory device package available */
+//ʹÓÃÉ豸ָÕë
+#define GUI_SUPPORT_DEVICES (1) /* Enable use of device pointers */
+
+#endif /* Avoid multiple inclusion */
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIDRV_Template.c b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIDRV_Template.c
new file mode 100644
index 00000000..ce1986fd
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIDRV_Template.c
@@ -0,0 +1,844 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIDRV_Template.c
+Purpose : Template driver, could be used as starting point for new
+ simple display drivers supporting only one color depth.
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include
+
+#include "LCD_Private.h"
+#include "GUI_Private.h"
+#include "LCD_ConfDefaults.h"
+
+#include "lcd.h"
+/*********************************************************************
+*
+* Defines
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* Macros for MIRROR_, SWAP_ and LUT_
+*/
+#if (!defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
+ #if (!LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) x
+ #define LOG2PHYS_Y(x, y) y
+ #elif (!LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) y
+ #define LOG2PHYS_Y(x, y) x
+ #elif (!LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) x
+ #define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
+ #elif (!LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) y
+ #define LOG2PHYS_Y(x, y) LCD_XSIZE - 1 - (x)
+ #elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
+ #define LOG2PHYS_Y(x, y) y
+ #elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
+ #define LOG2PHYS_Y(x, y) x
+ #elif ( LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
+ #define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
+ #elif ( LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
+ #define LOG2PHYS_Y(x, y) LCD_XSIZE - 1 - (x)
+ #endif
+#else
+ #if ( defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
+ #define LOG2PHYS_X(x, y) x
+ #define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
+ #elif (!defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
+ #define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
+ #define LOG2PHYS_Y(x, y) y
+ #elif ( defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
+ #define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
+ #define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
+ #endif
+#endif
+
+/*********************************************************************
+*
+* Types
+*
+**********************************************************************
+*/
+typedef struct {
+ U32 VRAMAddr;
+ int xSize, ySize;
+ int vxSize, vySize;
+ int vxSizePhys;
+ int BitsPerPixel;
+} DRIVER_CONTEXT_TEMPLATE;
+
+/*********************************************************************
+*
+* Static functions
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* _SetPixelIndex
+*
+* Purpose:
+* Sets the index of the given pixel. The upper layers
+* calling this routine make sure that the coordinates are in range, so
+* that no check on the parameters needs to be performed.
+*/
+static void _SetPixelIndex(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) {
+ //
+ // Convert logical into physical coordinates (Dep. on LCDConf.h)
+ //
+ //Ìí¼Ó´òµãº¯Êý
+ LCD_Draw_ColorPoint(x,y,PixelIndex);
+ #if 0
+ #if (LCD_MIRROR_X == 1) || (LCD_MIRROR_Y == 1) || (LCD_SWAP_XY == 1)
+ int xPhys, yPhys;
+
+ xPhys = LOG2PHYS_X(x, y);
+ yPhys = LOG2PHYS_Y(x, y);
+ #else
+ #define xPhys x
+ #define yPhys y
+ #endif
+ GUI_USE_PARA(pDevice);
+ GUI_USE_PARA(x);
+ GUI_USE_PARA(y);
+ GUI_USE_PARA(PixelIndex);
+ {
+ //
+ // Write into hardware ... Adapt to your system
+ //
+ // TBD by customer...
+
+ //
+ }
+ #if (LCD_MIRROR_X == 0) && (LCD_MIRROR_Y == 0) && (LCD_SWAP_XY == 0)
+ #undef xPhys
+ #undef yPhys
+ #endif
+ #endif
+}
+
+/*********************************************************************
+*
+* _GetPixelIndex
+*
+* Purpose:
+* Returns the index of the given pixel. The upper layers
+* calling this routine make sure that the coordinates are in range, so
+* that no check on the parameters needs to be performed.
+*/
+static unsigned int _GetPixelIndex(GUI_DEVICE * pDevice, int x, int y) {
+ unsigned int PixelIndex;
+ //
+ // Convert logical into physical coordinates (Dep. on LCDConf.h)
+ //
+ #if (LCD_MIRROR_X == 1) || (LCD_MIRROR_Y == 1) || (LCD_SWAP_XY == 1)
+ int xPhys, yPhys;
+
+ xPhys = LOG2PHYS_X(x, y);
+ yPhys = LOG2PHYS_Y(x, y);
+ #else
+ #define xPhys x
+ #define yPhys y
+ #endif
+ GUI_USE_PARA(pDevice);
+ GUI_USE_PARA(x);
+ GUI_USE_PARA(y);
+ {
+ //
+ // Write into hardware ... Adapt to your system
+ //
+ // TBD by customer...
+ //
+ PixelIndex = 0;
+ }
+ #if (LCD_MIRROR_X == 0) && (LCD_MIRROR_Y == 0) && (LCD_SWAP_XY == 0)
+ #undef xPhys
+ #undef yPhys
+ #endif
+ return PixelIndex;
+}
+
+/*********************************************************************
+*
+* _XorPixel
+*/
+static void _XorPixel(GUI_DEVICE * pDevice, int x, int y) {
+ LCD_PIXELINDEX PixelIndex;
+ LCD_PIXELINDEX IndexMask;
+
+ PixelIndex = _GetPixelIndex(pDevice, x, y);
+ IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
+ _SetPixelIndex(pDevice, x, y, PixelIndex ^ IndexMask);
+}
+
+/*********************************************************************
+*
+* _FillRect
+*/
+static void _FillRect(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
+
+ LCD_PIXELINDEX PixelIndex;
+ int x;
+
+ PixelIndex = LCD__GetColorIndex();
+ if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
+ for (; y0 <= y1; y0++) {
+ for (x = x0; x <= x1; x++) {
+ _XorPixel(pDevice, x, y0);
+ }
+ }
+ } else {
+ for (; y0 <= y1; y0++) {
+ for (x = x0; x <= x1; x++) {
+ _SetPixelIndex(pDevice, x, y0, PixelIndex);
+ }
+ }
+ }
+}
+
+/*********************************************************************
+*
+* _DrawHLine
+*/
+static void _DrawHLine(GUI_DEVICE * pDevice, int x0, int y, int x1) {
+ _FillRect(pDevice, x0, y, x1, y);
+}
+
+/*********************************************************************
+*
+* _DrawVLine, not optimized
+*/
+static void _DrawVLine(GUI_DEVICE * pDevice, int x, int y0, int y1) {
+ _FillRect(pDevice, x, y0, x, y1);
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 1 BPP
+*/
+static void _DrawBitLine1BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
+
+ LCD_PIXELINDEX IndexMask, Index0, Index1, Pixel;
+
+ Index0 = *(pTrans + 0);
+ Index1 = *(pTrans + 1);
+ x += Diff;
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ do {
+ _SetPixelIndex(pDevice, x++, y, (*p & (0x80 >> Diff)) ? Index1 : Index0);
+ if (++Diff == 8) {
+ Diff = 0;
+ p++;
+ }
+ } while (--xsize);
+ break;
+ case LCD_DRAWMODE_TRANS:
+ do {
+ if (*p & (0x80 >> Diff))
+ _SetPixelIndex(pDevice, x, y, Index1);
+ x++;
+ if (++Diff == 8) {
+ Diff = 0;
+ p++;
+ }
+ } while (--xsize);
+ break;
+ case LCD_DRAWMODE_XOR | LCD_DRAWMODE_TRANS:
+ case LCD_DRAWMODE_XOR:
+ IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
+ do {
+ if (*p & (0x80 >> Diff)) {
+ Pixel = _GetPixelIndex(pDevice, x, y);
+ _SetPixelIndex(pDevice, x, y, Pixel ^ IndexMask);
+ }
+ x++;
+ if (++Diff == 8) {
+ Diff = 0;
+ p++;
+ }
+ } while (--xsize);
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 2 BPP
+*/
+static void _DrawBitLine2BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
+ LCD_PIXELINDEX Pixels, PixelIndex;
+ int CurrentPixel, Shift, Index;
+
+ Pixels = *p;
+ CurrentPixel = Diff;
+ x += Diff;
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ if (pTrans) {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x++, y, PixelIndex);
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ _SetPixelIndex(pDevice, x++, y, Index);
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ case LCD_DRAWMODE_TRANS:
+ if (pTrans) {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ if (Index) {
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x, y, PixelIndex);
+ }
+ x++;
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ if (Index) {
+ _SetPixelIndex(pDevice, x, y, Index);
+ }
+ x++;
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 4 BPP
+*/
+static void _DrawBitLine4BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
+ LCD_PIXELINDEX Pixels, PixelIndex;
+ int CurrentPixel, Shift, Index;
+
+ Pixels = *p;
+ CurrentPixel = Diff;
+ x += Diff;
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ if (pTrans) {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x++, y, PixelIndex);
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ _SetPixelIndex(pDevice, x++, y, Index);
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ case LCD_DRAWMODE_TRANS:
+ if (pTrans) {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ if (Index) {
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x, y, PixelIndex);
+ }
+ x++;
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ if (Index) {
+ _SetPixelIndex(pDevice, x, y, Index);
+ }
+ x++;
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 8 BPP
+*/
+static void _DrawBitLine8BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int xsize, const LCD_PIXELINDEX * pTrans) {
+ LCD_PIXELINDEX Pixel;
+
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ if (pTrans) {
+ for (; xsize > 0; xsize--, x++, p++) {
+ Pixel = *p;
+ _SetPixelIndex(pDevice, x, y, *(pTrans + Pixel));
+ }
+ } else {
+ for (; xsize > 0; xsize--, x++, p++) {
+ _SetPixelIndex(pDevice, x, y, *p);
+ }
+ }
+ break;
+ case LCD_DRAWMODE_TRANS:
+ if (pTrans) {
+ for (; xsize > 0; xsize--, x++, p++) {
+ Pixel = *p;
+ if (Pixel) {
+ _SetPixelIndex(pDevice, x, y, *(pTrans + Pixel));
+ }
+ }
+ } else {
+ for (; xsize > 0; xsize--, x++, p++) {
+ Pixel = *p;
+ if (Pixel) {
+ _SetPixelIndex(pDevice, x, y, Pixel);
+ }
+ }
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 16 BPP, not optimized
+*
+* Purpose:
+* Drawing of 16bpp high color bitmaps.
+* Only required for 16bpp color depth of target. Should be removed otherwise.
+*/
+static void _DrawBitLine16BPP(GUI_DEVICE * pDevice, int x, int y, U16 const GUI_UNI_PTR * p, int xsize) {
+ for (;xsize > 0; xsize--, x++, p++) {
+ _SetPixelIndex(pDevice, x, y, *p);
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 32 BPP, not optimized
+*
+* Purpose:
+* Drawing of 32bpp true color bitmaps.
+* Only required for 32bpp color depth of target. Should be removed otherwise.
+*/
+static void _DrawBitLine32BPP(GUI_DEVICE * pDevice, int x, int y, U32 const GUI_UNI_PTR * p, int xsize) {
+ for (;xsize > 0; xsize--, x++, p++) {
+ _SetPixelIndex(pDevice, x, y, *p);
+ }
+}
+
+/*********************************************************************
+*
+* _DrawBitmap
+*/
+static void _DrawBitmap(GUI_DEVICE * pDevice, int x0, int y0,
+ int xSize, int ySize,
+ int BitsPerPixel,
+ int BytesPerLine,
+ const U8 GUI_UNI_PTR * pData, int Diff,
+ const LCD_PIXELINDEX * pTrans) {
+ int i;
+
+ switch (BitsPerPixel) {
+ case 1:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine1BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ case 2:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine2BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ case 4:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine4BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ case 8:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine8BPP(pDevice, x0, i + y0, pData, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ //
+ // Only required for 16bpp color depth of target. Should be removed otherwise.
+ //
+ case 16:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine16BPP(pDevice, x0, i + y0, (const U16 *)pData, xSize);
+ pData += BytesPerLine;
+ }
+ break;
+ //
+ // Only required for 32bpp color depth of target. Should be removed otherwise.
+ //
+ case 32:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine32BPP(pDevice, x0, i + y0, (const U32 *)pData, xSize);
+ pData += BytesPerLine;
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* _InitOnce
+*
+* Purpose:
+* Allocates a fixed block for the context of the driver
+*
+* Return value:
+* 0 on success, 1 on error
+*/
+static int _InitOnce(GUI_DEVICE * pDevice) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ if (pDevice->u.pContext == NULL) {
+ pDevice->u.pContext = GUI_ALLOC_GetFixedBlock(sizeof(DRIVER_CONTEXT_TEMPLATE));
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->BitsPerPixel = LCD__GetBPP(pDevice->pColorConvAPI->pfGetIndexMask());
+ }
+ return pDevice->u.pContext ? 0 : 1;
+}
+
+/*********************************************************************
+*
+* _GetDevProp
+*/
+static I32 _GetDevProp(GUI_DEVICE * pDevice, int Index) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ switch (Index) {
+ case LCD_DEVCAP_XSIZE:
+ return pContext->xSize;
+ case LCD_DEVCAP_YSIZE:
+ return pContext->ySize;
+ case LCD_DEVCAP_VXSIZE:
+ return pContext->vxSize;
+ case LCD_DEVCAP_VYSIZE:
+ return pContext->vySize;
+ case LCD_DEVCAP_BITSPERPIXEL:
+ return pContext->BitsPerPixel;
+ case LCD_DEVCAP_NUMCOLORS:
+ return 0;
+ case LCD_DEVCAP_XMAG:
+ return 1;
+ case LCD_DEVCAP_YMAG:
+ return 1;
+ case LCD_DEVCAP_MIRROR_X:
+ return 0;
+ case LCD_DEVCAP_MIRROR_Y:
+ return 0;
+ case LCD_DEVCAP_SWAP_XY:
+ return 0;
+ }
+ return -1;
+}
+
+/*********************************************************************
+*
+* _GetDevData
+*/
+static void * _GetDevData(GUI_DEVICE * pDevice, int Index) {
+ GUI_USE_PARA(pDevice);
+ #if GUI_SUPPORT_MEMDEV
+ switch (Index) {
+ case LCD_DEVDATA_MEMDEV:
+ return (void *)&GUI_MEMDEV_DEVICE_16; // TBD: Has to be adapted to the right memory device depending on the used color depth!
+ }
+ #else
+ GUI_USE_PARA(Index);
+ #endif
+ return NULL;
+}
+
+/*********************************************************************
+*
+* _GetRect
+*/
+static void _GetRect(GUI_DEVICE * pDevice, LCD_RECT * pRect) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pRect->x0 = 0;
+ pRect->y0 = 0;
+ pRect->x1 = pContext->vxSize - 1;
+ pRect->y1 = pContext->vySize - 1;
+}
+
+/*********************************************************************
+*
+* _SetOrg
+*/
+static void _SetOrg(GUI_DEVICE * pDevice, int x, int y) {
+ LCD_X_SETORG_INFO Data = {0};
+
+ Data.xPos = x;
+ Data.yPos = y;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETORG, (void *)&Data);
+}
+
+/*********************************************************************
+*
+* Static code: Functions available by _GetDevFunc()
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* _SetVRAMAddr
+*/
+static void _SetVRAMAddr(GUI_DEVICE * pDevice, void * pVRAM) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+ LCD_X_SETVRAMADDR_INFO Data = {0};
+
+ _InitOnce(pDevice);
+ if (pDevice->u.pContext) {
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->VRAMAddr = (U32)pVRAM;
+ Data.pVRAM = pVRAM;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETVRAMADDR, (void *)&Data);
+ }
+}
+
+/*********************************************************************
+*
+* _SetVSize
+*/
+static void _SetVSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ _InitOnce(pDevice);
+ if (pDevice->u.pContext) {
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->vxSize = xSize;
+ pContext->vySize = ySize;
+ pContext->vxSizePhys = xSize;
+ }
+}
+
+/*********************************************************************
+*
+* _SetSize
+*/
+static void _SetSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+ LCD_X_SETSIZE_INFO Data = {0};
+
+ _InitOnce(pDevice);
+ if (pDevice->u.pContext) {
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->vxSizePhys = (pContext->vxSizePhys == 0) ? xSize : pContext->vxSizePhys;
+ pContext->xSize = xSize;
+ pContext->ySize = ySize;
+ Data.xSize = xSize;
+ Data.ySize = ySize;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETSIZE, (void *)&Data);
+ }
+}
+/*********************************************************************
+*
+* _Init
+*/
+static int _Init(GUI_DEVICE * pDevice) {
+ int r;
+
+ r = _InitOnce(pDevice);
+ r |= LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_INITCONTROLLER, NULL);
+ return r;
+}
+
+/*********************************************************************
+*
+* _On
+*/
+static void _On (GUI_DEVICE * pDevice) {
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_ON, NULL);
+}
+
+/*********************************************************************
+*
+* _Off
+*/
+static void _Off (GUI_DEVICE * pDevice) {
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_OFF, NULL);
+}
+
+/*********************************************************************
+*
+* _SetLUTEntry
+*/
+static void _SetLUTEntry(GUI_DEVICE * pDevice, U8 Pos, LCD_COLOR Color) {
+ LCD_X_SETLUTENTRY_INFO Data = {0};
+
+ Data.Pos = Pos;
+ Data.Color = Color;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETLUTENTRY, (void *)&Data);
+}
+
+/*********************************************************************
+*
+* _GetDevFunc
+*/
+static void (* _GetDevFunc(GUI_DEVICE ** ppDevice, int Index))(void) {
+ GUI_USE_PARA(ppDevice);
+ switch (Index) {
+ case LCD_DEVFUNC_SET_VRAM_ADDR:
+ return (void (*)(void))_SetVRAMAddr;
+ case LCD_DEVFUNC_SET_VSIZE:
+ return (void (*)(void))_SetVSize;
+ case LCD_DEVFUNC_SET_SIZE:
+ return (void (*)(void))_SetSize;
+ case LCD_DEVFUNC_INIT:
+ return (void (*)(void))_Init;
+ case LCD_DEVFUNC_ON:
+ return (void (*)(void))_On;
+ case LCD_DEVFUNC_OFF:
+ return (void (*)(void))_Off;
+ case LCD_DEVFUNC_SETLUTENTRY:
+ return (void (*)(void))_SetLUTEntry;
+ }
+ return NULL;
+}
+
+/*********************************************************************
+*
+* Public data
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* GUI_DEVICE_API structure
+*/
+const GUI_DEVICE_API GUIDRV_Template_API = {
+ //
+ // Data
+ //
+ DEVICE_CLASS_DRIVER,
+ //
+ // Drawing functions
+ //
+ _DrawBitmap,
+ _DrawHLine,
+ _DrawVLine,
+ _FillRect,
+ _GetPixelIndex,
+ _SetPixelIndex,
+ _XorPixel,
+ //
+ // Set origin
+ //
+ _SetOrg,
+ //
+ // Request information
+ //
+ _GetDevFunc,
+ _GetDevProp,
+ _GetDevData,
+ _GetRect,
+};
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIDRV_Template.h b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIDRV_Template.h
new file mode 100644
index 00000000..773d8baa
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/GUIDRV_Template.h
@@ -0,0 +1,73 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIDRV_Template.h
+Purpose : Interface definition for GUIDRV_Template driver
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef GUIDRV_TEMPLATE_H
+#define GUIDRV_TEMPLATE_H
+
+/*********************************************************************
+*
+* Display drivers
+*/
+//
+// Addresses
+//
+extern const GUI_DEVICE_API GUIDRV_Template_API;
+
+//
+// Macro to be used in configuration files
+//
+#define GUIDRV_TEMPLATE &GUIDRV_Template_API
+
+#endif
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf.h b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf.h
new file mode 100644
index 00000000..4b096d11
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf.h
@@ -0,0 +1,9 @@
+#ifndef __LCDCONF_H
+#define __LCDCONF_H
+
+
+
+
+
+#endif //__LCDCONF_H
+
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_FlexColor_Template.c b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_FlexColor_Template.c
new file mode 100644
index 00000000..a5de2fc5
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_FlexColor_Template.c
@@ -0,0 +1,277 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_FlexColor_Template.c
+Purpose : Display controller configuration (single layer)
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include "GUI.h"
+#include "GUIDRV_FlexColor.h"
+
+/*********************************************************************
+*
+* Layer configuration (to be modified)
+*
+**********************************************************************
+*/
+#include "spi.h"
+#include "lcd_spi2_drv.h"
+//
+// Physical display size
+//
+//¸ü¸ÄÏÔʾ·Ö±æÂÊ
+#define XSIZE_PHYS 240 // To be adapted to x-screen size
+#define YSIZE_PHYS 240 // To be adapted to y-screen size
+
+/*********************************************************************
+*
+* Configuration checking
+*
+**********************************************************************
+*/
+#ifndef VXSIZE_PHYS
+ #define VXSIZE_PHYS XSIZE_PHYS
+#endif
+#ifndef VYSIZE_PHYS
+ #define VYSIZE_PHYS YSIZE_PHYS
+#endif
+#ifndef XSIZE_PHYS
+ #error Physical X size of display is not defined!
+#endif
+#ifndef YSIZE_PHYS
+ #error Physical Y size of display is not defined!
+#endif
+#ifndef GUICC_565
+ #error Color conversion not defined!
+#endif
+#ifndef GUIDRV_FLEXCOLOR
+ #error No display driver defined!
+#endif
+
+
+/**
+ * @brief SPI ·¢ËÍ×Ö½Úº¯Êý
+ * @param TxData Òª·¢Ë͵ÄÊý¾Ý
+ * @param size ·¢ËÍÊý¾ÝµÄ×Ö½Ú´óС
+ * @return 0:дÈë³É¹¦,ÆäËû:дÈëʧ°Ü
+ */
+static uint8_t BearPi_SPI_WriteByte(uint8_t *TxData,uint16_t size)
+{
+ return HAL_SPI_Transmit(&hspi2,TxData,size,1000);
+}
+
+/**
+ * @brief LCDµ×²ãSPI·¢ËÍÊý¾Ýº¯Êý
+ * @param data ¡ª¡ª Êý¾ÝµÄÆðʼµØÖ·
+ * @param size ¡ª¡ª ·¢ËÍÊý¾Ý×Ö½ÚÊý
+ * @return none
+ */
+static void BearPi_LCD_SPI_Send(uint8_t *data, uint16_t size)
+{
+ BearPi_SPI_WriteByte(data, size);
+}
+
+/**
+ * @brief дÃüÁîµ½LCD
+ * @param cmd ¡ª¡ª ÐèÒª·¢Ë͵ÄÃüÁî
+ * @return none
+ */
+static void BearPi_LCD_Write_Cmd(uint8_t cmd)
+{
+ LCD_WR_RS(0);
+ BearPi_LCD_SPI_Send(&cmd, 1);
+}
+
+/**
+ * @brief дÊý¾Ýµ½LCD
+ * @param dat ¡ª¡ª ÐèÒª·¢Ë͵ÄÊý¾Ý
+ * @return none
+ */
+static void BearPi_LCD_Write_Data(uint8_t dat)
+{
+ LCD_WR_RS(1);
+ BearPi_LCD_SPI_Send(&dat, 1);
+}
+
+/*********************************************************************
+*
+* Local functions
+*
+**********************************************************************
+*/
+/********************************************************************
+*
+* LcdWriteReg
+*
+* Function description:
+* Sets display register
+*/
+static void LcdWriteReg(U8 Data) {
+ // ... TBD by user
+ BearPi_LCD_Write_Cmd(Data);
+}
+
+/********************************************************************
+*
+* LcdWriteData
+*
+* Function description:
+* Writes a value to a display register
+*/
+static void LcdWriteData(U8 Data) {
+ // ... TBD by user
+ BearPi_LCD_Write_Data(Data);
+}
+
+/********************************************************************
+*
+* LcdWriteDataMultiple
+*
+* Function description:
+* Writes multiple values to a display register.
+*/
+static void LcdWriteDataMultiple(U8 * pData, int NumItems) {
+ while (NumItems--) {
+ // ... TBD by user
+ BearPi_LCD_Write_Data(*pData++);
+ }
+}
+
+
+/*********************************************************************
+*
+* Public functions
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* LCD_X_Config
+*
+* Function description:
+* Called during the initialization process in order to set up the
+* display driver configuration.
+*
+*/
+void LCD_X_Config(void) {
+ GUI_DEVICE * pDevice;
+ CONFIG_FLEXCOLOR Config = {0};
+ GUI_PORT_API PortAPI = {0};
+ //
+ // Set display driver and color conversion
+ //
+ pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_M565, 0, 0);
+ //
+ // Display driver configuration, required for Lin-driver
+ //
+ LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
+ LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
+ //
+ // Orientation
+ //
+ //Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y;
+ Config.Orientation = 0 ;
+ Config.NumDummyReads = 2;
+ GUIDRV_FlexColor_Config(pDevice, &Config);
+ //
+ // Set controller and operation mode
+ //
+ PortAPI.pfWrite8_A0 = LcdWriteReg;
+ PortAPI.pfWrite8_A1 = LcdWriteData;
+ PortAPI.pfWriteM8_A1 = LcdWriteDataMultiple;
+ //ST7789ΪGUIDRV_FLEXCOLOR_F66709
+ GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B8);
+}
+
+/*********************************************************************
+*
+* LCD_X_DisplayDriver
+*
+* Function description:
+* This function is called by the display driver for several purposes.
+* To support the according task the routine needs to be adapted to
+* the display controller. Please note that the commands marked with
+* 'optional' are not cogently required and should only be adapted if
+* the display controller supports these features.
+*
+* Parameter:
+* LayerIndex - Index of layer to be configured
+* Cmd - Please refer to the details in the switch statement below
+* pData - Pointer to a LCD_X_DATA structure
+*
+* Return Value:
+* < -1 - Error
+* -1 - Command not handled
+* 0 - Ok
+*/
+int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
+ int r;
+ (void) LayerIndex;
+ (void) pData;
+
+ switch (Cmd) {
+ case LCD_X_INITCONTROLLER: {
+ //
+ // Called during the initialization process in order to set up the
+ // display controller and put it into operation. If the display
+ // controller is not initialized by any external routine this needs
+ // to be adapted by the customer...
+ //
+ // ...
+ LCD_Init();
+ return 0;
+ }
+ default:
+ r = -1;
+ }
+ return r;
+}
+
+/*************************** End of file ****************************/
+
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_FlexColor_Template.h b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_FlexColor_Template.h
new file mode 100644
index 00000000..76fbcaf5
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_FlexColor_Template.h
@@ -0,0 +1,59 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_FlexColor_Template.h
+Purpose : Display driver configuration file
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef LCDCONF_H
+#define LCDCONF_H
+
+#endif /* LCDCONF_H */
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_Lin_Template.c b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_Lin_Template.c
new file mode 100644
index 00000000..3db3a0ff
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_Lin_Template.c
@@ -0,0 +1,262 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_Lin_Template.c
+Purpose : Display controller configuration (single layer)
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include "GUI.h"
+#include "GUIDRV_Lin.h"
+
+/*********************************************************************
+*
+* Layer configuration (to be modified)
+*
+**********************************************************************
+*/
+//
+// Physical display size
+//
+#define XSIZE_PHYS 320
+#define YSIZE_PHYS 240
+
+//
+// Color conversion
+//
+#define COLOR_CONVERSION GUICC_8888
+
+//
+// Display driver
+//
+#define DISPLAY_DRIVER GUIDRV_WIN32
+
+//
+// Buffers / VScreens
+//
+#define NUM_BUFFERS 1 // Number of multiple buffers to be used
+#define NUM_VSCREENS 1 // Number of virtual screens to be used
+
+/*********************************************************************
+*
+* Configuration checking
+*
+**********************************************************************
+*/
+#ifndef VRAM_ADDR
+ #define VRAM_ADDR 0 // TBD by customer: This has to be the frame buffer start address
+#endif
+#ifndef XSIZE_PHYS
+ #error Physical X size of display is not defined!
+#endif
+#ifndef YSIZE_PHYS
+ #error Physical Y size of display is not defined!
+#endif
+#ifndef COLOR_CONVERSION
+ #error Color conversion not defined!
+#endif
+#ifndef DISPLAY_DRIVER
+ #error No display driver defined!
+#endif
+#ifndef NUM_VSCREENS
+ #define NUM_VSCREENS 1
+#else
+ #if (NUM_VSCREENS <= 0)
+ #error At least one screeen needs to be defined!
+ #endif
+#endif
+#if (NUM_VSCREENS > 1) && (NUM_BUFFERS > 1)
+ #error Virtual screens and multiple buffers are not allowed!
+#endif
+
+/*********************************************************************
+*
+* Public code
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* LCD_X_Config
+*
+* Purpose:
+* Called during the initialization process in order to set up the
+* display driver configuration.
+*
+*/
+void LCD_X_Config(void) {
+ //
+ // At first initialize use of multiple buffers on demand
+ //
+ #if (NUM_BUFFERS > 1)
+ GUI_MULTIBUF_Config(NUM_BUFFERS);
+ #endif
+ //
+ // Set display driver and color conversion for 1st layer
+ //
+ GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
+ //
+ // Display driver configuration, required for Lin-driver
+ //
+ if (LCD_GetSwapXY()) {
+ LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
+ LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
+ } else {
+ LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
+ LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);
+ }
+ LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR);
+ //
+ // Set user palette data (only required if no fixed palette is used)
+ //
+ #if defined(PALETTE)
+ LCD_SetLUTEx(0, PALETTE);
+ #endif
+
+ //
+ // Set custom functions for several operations to optimize native processes
+ //
+ LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))CUSTOM_LCD_CopyBuffer);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_COPYRECT, (void(*)(void))CUSTOM_LCD_CopyRect);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_FILLRECT, (void(*)(void))CUSTOM_LCD_FillRect);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap8bpp);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_16BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap16bpp);
+}
+
+/*********************************************************************
+*
+* LCD_X_DisplayDriver
+*
+* Purpose:
+* This function is called by the display driver for several purposes.
+* To support the according task the routine needs to be adapted to
+* the display controller. Please note that the commands marked with
+* 'optional' are not cogently required and should only be adapted if
+* the display controller supports these features.
+*
+* Parameter:
+* LayerIndex - Index of layer to be configured
+* Cmd - Please refer to the details in the switch statement below
+* pData - Pointer to a LCD_X_DATA structure
+*
+* Return Value:
+* < -1 - Error
+* -1 - Command not handled
+* 0 - Ok
+*/
+int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
+ int r;
+
+ switch (Cmd) {
+ case LCD_X_INITCONTROLLER: {
+ //
+ // Called during the initialization process in order to set up the
+ // display controller and put it into operation. If the display
+ // controller is not initialized by any external routine this needs
+ // to be adapted by the customer...
+ //
+ // ...
+ return 0;
+ }
+ case LCD_X_SETVRAMADDR: {
+ //
+ // Required for setting the address of the video RAM for drivers
+ // with memory mapped video RAM which is passed in the 'pVRAM' element of p
+ //
+ LCD_X_SETVRAMADDR_INFO * p;
+ p = (LCD_X_SETVRAMADDR_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_SETORG: {
+ //
+ // Required for setting the display origin which is passed in the 'xPos' and 'yPos' element of p
+ //
+ LCD_X_SETORG_INFO * p;
+ p = (LCD_X_SETORG_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_SHOWBUFFER: {
+ //
+ // Required if multiple buffers are used. The 'Index' element of p contains the buffer index.
+ //
+ LCD_X_SHOWBUFFER_INFO * p;
+ p = (LCD_X_SHOWBUFFER_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_SETLUTENTRY: {
+ //
+ // Required for setting a lookup table entry which is passed in the 'Pos' and 'Color' element of p
+ //
+ LCD_X_SETLUTENTRY_INFO * p;
+ p = (LCD_X_SETLUTENTRY_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_ON: {
+ //
+ // Required if the display controller should support switching on and off
+ //
+ return 0;
+ }
+ case LCD_X_OFF: {
+ //
+ // Required if the display controller should support switching on and off
+ //
+ // ...
+ return 0;
+ }
+ default:
+ r = -1;
+ }
+ return r;
+}
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_Lin_Template.h b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_Lin_Template.h
new file mode 100644
index 00000000..304e693b
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/LCDConf_Lin_Template.h
@@ -0,0 +1,59 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.30 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_Lin_Template.h
+Purpose : Display driver configuration file
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef LCDCONF_H
+#define LCDCONF_H
+
+#endif /* LCDCONF_H */
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/SIMConf.c b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/SIMConf.c
new file mode 100644
index 00000000..80d048d2
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/Config/SIMConf.c
@@ -0,0 +1,71 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with a license and should not be re-
+distributed in any way. We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : SIMConf.c
+Purpose : Windows Simulator configuration
+---------------------------END-OF-HEADER------------------------------
+*/
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifdef WIN32
+
+#include "LCD_SIM.h"
+
+/*********************************************************************
+*
+* Public code
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* SIM_X_Config
+*
+* Purpose:
+* Called during the initialization process in order to configure
+* the simulator.
+*/
+void SIM_X_Config() {
+ SIM_GUI_SetTransColor(0xff0000); // Define the transparent color
+}
+
+#else
+
+void SIMConf_C(void); // Avoid empty object files
+void SIMConf_C(void) {}
+
+#endif
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/OS/GUI_X.c b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/OS/GUI_X.c
new file mode 100644
index 00000000..50d2732c
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/OS/GUI_X.c
@@ -0,0 +1,123 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUI_X.C
+Purpose : Config / System dependent externals for GUI
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include "GUI.h"
+
+/*********************************************************************
+*
+* Global data
+*/
+volatile GUI_TIMER_TIME OS_TimeMS;
+
+/*********************************************************************
+*
+* Timing:
+* GUI_X_GetTime()
+* GUI_X_Delay(int)
+
+ Some timing dependent routines require a GetTime
+ and delay function. Default time unit (tick), normally is
+ 1 ms.
+*/
+
+GUI_TIMER_TIME GUI_X_GetTime(void) {
+ return OS_TimeMS;
+}
+
+void GUI_X_Delay(int ms) {
+ int tEnd = OS_TimeMS + ms;
+ while ((tEnd - OS_TimeMS) > 0);
+}
+
+/*********************************************************************
+*
+* GUI_X_Init()
+*
+* Note:
+* GUI_X_Init() is called from GUI_Init is a possibility to init
+* some hardware which needs to be up and running before the GUI.
+* If not required, leave this routine blank.
+*/
+
+void GUI_X_Init(void) {}
+
+
+/*********************************************************************
+*
+* GUI_X_ExecIdle
+*
+* Note:
+* Called if WM is in idle state
+*/
+
+void GUI_X_ExecIdle(void) {}
+
+/*********************************************************************
+*
+* Logging: OS dependent
+
+Note:
+ Logging is used in higher debug levels only. The typical target
+ build does not use logging and does therefor not require any of
+ the logging routines below. For a release build without logging
+ the routines below may be eliminated to save some space.
+ (If the linker is not function aware and eliminates unreferenced
+ functions automatically)
+
+*/
+
+void GUI_X_Log (const char *s) { GUI_USE_PARA(s); }
+void GUI_X_Warn (const char *s) { GUI_USE_PARA(s); }
+void GUI_X_ErrorOut(const char *s) { GUI_USE_PARA(s); }
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/OS/GUI_X_TOS.c b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/OS/GUI_X_TOS.c
new file mode 100644
index 00000000..6292dbe5
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/STemWin_Config/OS/GUI_X_TOS.c
@@ -0,0 +1,209 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUI_X.C
+Purpose : This file provides emWin Interface with FreeRTOS
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+/* Includes ------------------------------------------------------------------*/
+
+#include "GUI.h"
+
+/* RT-Thread include files */
+//#include "cmsis_os.h"
+#include "tos_k.h"
+
+/*********************************************************************
+*
+* Global data
+*/
+//static osMutexId osMutex;
+//static osSemaphoreId osSemaphore;
+/*¶¨ÒåÒ»¸ö»¥³âËø*/
+static k_mutex_t osMutex ;
+/*¶¨ÒåÒ»¸öÐźÅÁ¿*/
+static k_sem_t osSemaphore ;
+/*********************************************************************
+*
+* Timing:
+* GUI_X_GetTime()
+* GUI_X_Delay(int)
+
+Some timing dependent routines require a GetTime
+and delay function. Default time unit (tick), normally is
+1 ms.
+*/
+
+int GUI_X_GetTime(void)
+{
+ //return ((int) xTaskGetTickCount());
+ return (int)tos_systick_get();
+}
+
+void GUI_X_Delay(int ms)
+{
+ //vTaskDelay( ms );
+ tos_sleep_ms(ms);
+}
+
+/*********************************************************************
+*
+* GUI_X_Init()
+*
+* Note:
+* GUI_X_Init() is called from GUI_Init is a possibility to init
+* some hardware which needs to be up and running before the GUI.
+* If not required, leave this routine blank.
+*/
+
+void GUI_X_Init(void) {
+}
+
+
+/*********************************************************************
+*
+* GUI_X_ExecIdle
+*
+* Note:
+* Called if WM is in idle state
+*/
+
+void GUI_X_ExecIdle(void) {
+ GUI_X_Delay(1);
+}
+
+/*********************************************************************
+*
+* Multitasking:
+*
+* GUI_X_InitOS()
+* GUI_X_GetTaskId()
+* GUI_X_Lock()
+* GUI_X_Unlock()
+*
+* Note:
+* The following routines are required only if emWin is used in a
+* true multi task environment, which means you have more than one
+* thread using the emWin API.
+* In this case the
+* #define GUI_OS 1
+* needs to be in GUIConf.h
+*/
+
+/* Init OS */
+#include
+void GUI_X_InitOS(void)
+{
+ /*´´½¨»¥³âÐźÅÁ¿,ÓÃÓÚ×ÊÔ´¹²Ïí*/
+ //osMutex = rt_mutex_create("osMutex", RT_IPC_FLAG_FIFO);
+ //RT_ASSERT(osMutex != RT_NULL);
+ /*´´½¨ÐźÅÁ¿,ÓÃÓÚʼþ´¥·¢*/
+ //osSemaphore = rt_sem_create("osSem", 0, RT_IPC_FLAG_FIFO);
+ //RT_ASSERT(osSemaphore != RT_NULL);
+ tos_mutex_create(&osMutex);
+ tos_sem_create(&osSemaphore,1);
+}
+
+void GUI_X_Unlock(void)
+{
+ //osMutexRelease(osMutex);
+ //¸ø³ö»¥³âÁ¿
+ tos_mutex_post(&osMutex);
+}
+
+void GUI_X_Lock(void)
+{
+ //osMutexWait(osMutex , osWaitForever) ;
+ //»ñÈ¡»¥³âÁ¿
+ tos_mutex_pend(&osMutex);
+}
+
+/* Get Task handle */
+U32 GUI_X_GetTaskId(void)
+{
+ //return ((U32) osThreadGetId());
+ /*»ñÈ¡µ±Ç°Ï߳̾ä±ú*/
+ return (U32) tos_task_curr_task_get();
+}
+
+
+void GUI_X_WaitEvent (void)
+{
+ // osSemaphoreWait(osSemaphore , osWaitForever) ;
+ /*»ñÈ¡ÐźÅÁ¿*/
+ tos_sem_pend(&osSemaphore,TOS_TIME_FOREVER);
+}
+
+
+void GUI_X_SignalEvent (void)
+{
+ //osMutexRelease(osSemaphore);
+ /*¸ø³öÐźÅÁ¿*/
+ tos_sem_post(&osSemaphore);
+}
+
+/*********************************************************************
+*
+* Logging: OS dependent
+
+Note:
+Logging is used in higher debug levels only. The typical target
+build does not use logging and does therefor not require any of
+the logging routines below. For a release build without logging
+the routines below may be eliminated to save some space.
+(If the linker is not function aware and eliminates unreferenced
+functions automatically)
+
+*/
+
+void GUI_X_Log (const char *s) { }
+void GUI_X_Warn (const char *s) { }
+void GUI_X_ErrorOut(const char *s) { }
+
+/*************************** End of file ****************************/
diff --git a/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/startup_stm32l431xx.s b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/startup_stm32l431xx.s
new file mode 100644
index 00000000..6a5c15a5
--- /dev/null
+++ b/board/BearPi_STM32L431RC/KEIL/tencent_os_stemwin_demo/startup_stm32l431xx.s
@@ -0,0 +1,404 @@
+;********************** COPYRIGHT(c) 2017 STMicroelectronics ******************
+;* File Name : startup_stm32l431xx.s
+;* Author : MCD Application Team
+;* Description : STM32L431xx Ultra Low Power devices vector table for MDK-ARM toolchain.
+;* This module performs:
+;* - Set the initial SP
+;* - Set the initial PC == Reset_Handler
+;* - Set the vector table entries with the exceptions ISR address
+;* - Branches to __main in the C library (which eventually
+;* calls main()).
+;* After Reset the Cortex-M4 processor is in Thread mode,
+;* priority is Privileged, and the Stack is set to Main.
+;* <<< Use Configuration Wizard in Context Menu >>>
+;*******************************************************************************
+;*
+;* Redistribution and use in source and binary forms, with or without modification,
+;* are permitted provided that the following conditions are met:
+;* 1. Redistributions of source code must retain the above copyright notice,
+;* this list of conditions and the following disclaimer.
+;* 2. Redistributions in binary form must reproduce the above copyright notice,
+;* this list of conditions and the following disclaimer in the documentation
+;* and/or other materials provided with the distribution.
+;* 3. Neither the name of STMicroelectronics nor the names of its contributors
+;* may be used to endorse or promote products derived from this software
+;* without specific prior written permission.
+;*
+;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+;*
+;*******************************************************************************
+;
+; Amount of memory (in bytes) allocated for Stack
+; Tailor this value to your application needs
+; Stack Configuration
+; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;
+
+Stack_Size EQU 0x100
+
+ AREA STACK, NOINIT, READWRITE, ALIGN=3
+Stack_Mem SPACE Stack_Size
+__initial_sp
+
+
+; Heap Configuration
+; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
+;
+
+Heap_Size EQU 0x100
+
+ AREA HEAP, NOINIT, READWRITE, ALIGN=3
+__heap_base
+Heap_Mem SPACE Heap_Size
+__heap_limit
+
+ PRESERVE8
+ THUMB
+
+
+; Vector Table Mapped to Address 0 at Reset
+ AREA RESET, DATA, READONLY
+ EXPORT __Vectors
+ EXPORT __Vectors_End
+ EXPORT __Vectors_Size
+
+__Vectors DCD __initial_sp ; Top of Stack
+ DCD Reset_Handler ; Reset Handler
+ DCD NMI_Handler ; NMI Handler
+ DCD HardFault_Handler ; Hard Fault Handler
+ DCD MemManage_Handler ; MPU Fault Handler
+ DCD BusFault_Handler ; Bus Fault Handler
+ DCD UsageFault_Handler ; Usage Fault Handler
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SVC_Handler ; SVCall Handler
+ DCD DebugMon_Handler ; Debug Monitor Handler
+ DCD 0 ; Reserved
+ DCD PendSV_Handler ; PendSV Handler
+ DCD SysTick_Handler ; SysTick Handler
+
+ ; External Interrupts
+ DCD WWDG_IRQHandler ; Window WatchDog
+ DCD PVD_PVM_IRQHandler ; PVD/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection
+ DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
+ DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
+ DCD FLASH_IRQHandler ; FLASH
+ DCD RCC_IRQHandler ; RCC
+ DCD EXTI0_IRQHandler ; EXTI Line0
+ DCD EXTI1_IRQHandler ; EXTI Line1
+ DCD EXTI2_IRQHandler ; EXTI Line2
+ DCD EXTI3_IRQHandler ; EXTI Line3
+ DCD EXTI4_IRQHandler ; EXTI Line4
+ DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
+ DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
+ DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
+ DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
+ DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
+ DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
+ DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
+ DCD ADC1_IRQHandler ; ADC1
+ DCD CAN1_TX_IRQHandler ; CAN1 TX
+ DCD CAN1_RX0_IRQHandler ; CAN1 RX0
+ DCD CAN1_RX1_IRQHandler ; CAN1 RX1
+ DCD CAN1_SCE_IRQHandler ; CAN1 SCE
+ DCD EXTI9_5_IRQHandler ; External Line[9:5]s
+ DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15
+ DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16
+ DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation
+ DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
+ DCD TIM2_IRQHandler ; TIM2
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD I2C1_EV_IRQHandler ; I2C1 Event
+ DCD I2C1_ER_IRQHandler ; I2C1 Error
+ DCD I2C2_EV_IRQHandler ; I2C2 Event
+ DCD I2C2_ER_IRQHandler ; I2C2 Error
+ DCD SPI1_IRQHandler ; SPI1
+ DCD SPI2_IRQHandler ; SPI2
+ DCD USART1_IRQHandler ; USART1
+ DCD USART2_IRQHandler ; USART2
+ DCD USART3_IRQHandler ; USART3
+ DCD EXTI15_10_IRQHandler ; External Line[15:10]
+ DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD SDMMC1_IRQHandler ; SDMMC1
+ DCD 0 ; Reserved
+ DCD SPI3_IRQHandler ; SPI3
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors
+ DCD TIM7_IRQHandler ; TIM7
+ DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1
+ DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2
+ DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3
+ DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4
+ DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD COMP_IRQHandler ; COMP Interrupt
+ DCD LPTIM1_IRQHandler ; LP TIM1 interrupt
+ DCD LPTIM2_IRQHandler ; LP TIM2 interrupt
+ DCD 0 ; Reserved
+ DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6
+ DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7
+ DCD LPUART1_IRQHandler ; LP UART1 interrupt
+ DCD QUADSPI_IRQHandler ; Quad SPI global interrupt
+ DCD I2C3_EV_IRQHandler ; I2C3 event
+ DCD I2C3_ER_IRQHandler ; I2C3 error
+ DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt
+ DCD 0 ; Reserved
+ DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt
+ DCD TSC_IRQHandler ; Touch Sense Controller global interrupt
+ DCD 0 ; Reserved
+ DCD 0 ; Reserved
+ DCD RNG_IRQHandler ; RNG global interrupt
+ DCD FPU_IRQHandler ; FPU
+ DCD CRS_IRQHandler ; CRS interrupt
+
+__Vectors_End
+
+__Vectors_Size EQU __Vectors_End - __Vectors
+
+ AREA |.text|, CODE, READONLY
+
+; Reset handler
+Reset_Handler PROC
+ EXPORT Reset_Handler [WEAK]
+ IMPORT SystemInit
+ IMPORT __main
+
+ LDR R0, =SystemInit
+ BLX R0
+ LDR R0, =__main
+ BX R0
+ ENDP
+
+; Dummy Exception Handlers (infinite loops which can be modified)
+
+NMI_Handler PROC
+ EXPORT NMI_Handler [WEAK]
+ B .
+ ENDP
+HardFault_Handler\
+ PROC
+ EXPORT HardFault_Handler [WEAK]
+ B .
+ ENDP
+MemManage_Handler\
+ PROC
+ EXPORT MemManage_Handler [WEAK]
+ B .
+ ENDP
+BusFault_Handler\
+ PROC
+ EXPORT BusFault_Handler [WEAK]
+ B .
+ ENDP
+UsageFault_Handler\
+ PROC
+ EXPORT UsageFault_Handler [WEAK]
+ B .
+ ENDP
+SVC_Handler PROC
+ EXPORT SVC_Handler [WEAK]
+ B .
+ ENDP
+DebugMon_Handler\
+ PROC
+ EXPORT DebugMon_Handler [WEAK]
+ B .
+ ENDP
+PendSV_Handler PROC
+ EXPORT PendSV_Handler [WEAK]
+ B .
+ ENDP
+SysTick_Handler PROC
+ EXPORT SysTick_Handler [WEAK]
+ B .
+ ENDP
+
+Default_Handler PROC
+
+ EXPORT WWDG_IRQHandler [WEAK]
+ EXPORT PVD_PVM_IRQHandler [WEAK]
+ EXPORT TAMP_STAMP_IRQHandler [WEAK]
+ EXPORT RTC_WKUP_IRQHandler [WEAK]
+ EXPORT FLASH_IRQHandler [WEAK]
+ EXPORT RCC_IRQHandler [WEAK]
+ EXPORT EXTI0_IRQHandler [WEAK]
+ EXPORT EXTI1_IRQHandler [WEAK]
+ EXPORT EXTI2_IRQHandler [WEAK]
+ EXPORT EXTI3_IRQHandler [WEAK]
+ EXPORT EXTI4_IRQHandler [WEAK]
+ EXPORT DMA1_Channel1_IRQHandler [WEAK]
+ EXPORT DMA1_Channel2_IRQHandler [WEAK]
+ EXPORT DMA1_Channel3_IRQHandler [WEAK]
+ EXPORT DMA1_Channel4_IRQHandler [WEAK]
+ EXPORT DMA1_Channel5_IRQHandler [WEAK]
+ EXPORT DMA1_Channel6_IRQHandler [WEAK]
+ EXPORT DMA1_Channel7_IRQHandler [WEAK]
+ EXPORT ADC1_IRQHandler [WEAK]
+ EXPORT CAN1_TX_IRQHandler [WEAK]
+ EXPORT CAN1_RX0_IRQHandler [WEAK]
+ EXPORT CAN1_RX1_IRQHandler [WEAK]
+ EXPORT CAN1_SCE_IRQHandler [WEAK]
+ EXPORT EXTI9_5_IRQHandler [WEAK]
+ EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK]
+ EXPORT TIM1_UP_TIM16_IRQHandler [WEAK]
+ EXPORT TIM1_TRG_COM_IRQHandler [WEAK]
+ EXPORT TIM1_CC_IRQHandler [WEAK]
+ EXPORT TIM2_IRQHandler [WEAK]
+ EXPORT I2C1_EV_IRQHandler [WEAK]
+ EXPORT I2C1_ER_IRQHandler [WEAK]
+ EXPORT I2C2_EV_IRQHandler [WEAK]
+ EXPORT I2C2_ER_IRQHandler [WEAK]
+ EXPORT SPI1_IRQHandler [WEAK]
+ EXPORT SPI2_IRQHandler [WEAK]
+ EXPORT USART1_IRQHandler [WEAK]
+ EXPORT USART2_IRQHandler [WEAK]
+ EXPORT USART3_IRQHandler [WEAK]
+ EXPORT EXTI15_10_IRQHandler [WEAK]
+ EXPORT RTC_Alarm_IRQHandler [WEAK]
+ EXPORT SDMMC1_IRQHandler [WEAK]
+ EXPORT SPI3_IRQHandler [WEAK]
+ EXPORT TIM6_DAC_IRQHandler [WEAK]
+ EXPORT TIM7_IRQHandler [WEAK]
+ EXPORT DMA2_Channel1_IRQHandler [WEAK]
+ EXPORT DMA2_Channel2_IRQHandler [WEAK]
+ EXPORT DMA2_Channel3_IRQHandler [WEAK]
+ EXPORT DMA2_Channel4_IRQHandler [WEAK]
+ EXPORT DMA2_Channel5_IRQHandler [WEAK]
+ EXPORT COMP_IRQHandler [WEAK]
+ EXPORT LPTIM1_IRQHandler [WEAK]
+ EXPORT LPTIM2_IRQHandler [WEAK]
+ EXPORT DMA2_Channel6_IRQHandler [WEAK]
+ EXPORT DMA2_Channel7_IRQHandler [WEAK]
+ EXPORT LPUART1_IRQHandler [WEAK]
+ EXPORT QUADSPI_IRQHandler [WEAK]
+ EXPORT I2C3_EV_IRQHandler [WEAK]
+ EXPORT I2C3_ER_IRQHandler [WEAK]
+ EXPORT SAI1_IRQHandler [WEAK]
+ EXPORT SWPMI1_IRQHandler [WEAK]
+ EXPORT TSC_IRQHandler [WEAK]
+ EXPORT RNG_IRQHandler [WEAK]
+ EXPORT FPU_IRQHandler [WEAK]
+ EXPORT CRS_IRQHandler [WEAK]
+
+WWDG_IRQHandler
+PVD_PVM_IRQHandler
+TAMP_STAMP_IRQHandler
+RTC_WKUP_IRQHandler
+FLASH_IRQHandler
+RCC_IRQHandler
+EXTI0_IRQHandler
+EXTI1_IRQHandler
+EXTI2_IRQHandler
+EXTI3_IRQHandler
+EXTI4_IRQHandler
+DMA1_Channel1_IRQHandler
+DMA1_Channel2_IRQHandler
+DMA1_Channel3_IRQHandler
+DMA1_Channel4_IRQHandler
+DMA1_Channel5_IRQHandler
+DMA1_Channel6_IRQHandler
+DMA1_Channel7_IRQHandler
+ADC1_IRQHandler
+CAN1_TX_IRQHandler
+CAN1_RX0_IRQHandler
+CAN1_RX1_IRQHandler
+CAN1_SCE_IRQHandler
+EXTI9_5_IRQHandler
+TIM1_BRK_TIM15_IRQHandler
+TIM1_UP_TIM16_IRQHandler
+TIM1_TRG_COM_IRQHandler
+TIM1_CC_IRQHandler
+TIM2_IRQHandler
+I2C1_EV_IRQHandler
+I2C1_ER_IRQHandler
+I2C2_EV_IRQHandler
+I2C2_ER_IRQHandler
+SPI1_IRQHandler
+SPI2_IRQHandler
+USART1_IRQHandler
+USART2_IRQHandler
+USART3_IRQHandler
+EXTI15_10_IRQHandler
+RTC_Alarm_IRQHandler
+SDMMC1_IRQHandler
+SPI3_IRQHandler
+TIM6_DAC_IRQHandler
+TIM7_IRQHandler
+DMA2_Channel1_IRQHandler
+DMA2_Channel2_IRQHandler
+DMA2_Channel3_IRQHandler
+DMA2_Channel4_IRQHandler
+DMA2_Channel5_IRQHandler
+COMP_IRQHandler
+LPTIM1_IRQHandler
+LPTIM2_IRQHandler
+DMA2_Channel6_IRQHandler
+DMA2_Channel7_IRQHandler
+LPUART1_IRQHandler
+QUADSPI_IRQHandler
+I2C3_EV_IRQHandler
+I2C3_ER_IRQHandler
+SAI1_IRQHandler
+SWPMI1_IRQHandler
+TSC_IRQHandler
+RNG_IRQHandler
+FPU_IRQHandler
+CRS_IRQHandler
+
+ B .
+
+ ENDP
+
+ ALIGN
+
+;*******************************************************************************
+; User Stack and Heap initialization
+;*******************************************************************************
+ IF :DEF:__MICROLIB
+
+ EXPORT __initial_sp
+ EXPORT __heap_base
+ EXPORT __heap_limit
+
+ ELSE
+
+ IMPORT __use_two_region_memory
+ EXPORT __user_initial_stackheap
+
+__user_initial_stackheap
+
+ LDR R0, = Heap_Mem
+ LDR R1, =(Stack_Mem + Stack_Size)
+ LDR R2, = (Heap_Mem + Heap_Size)
+ LDR R3, = Stack_Mem
+ BX LR
+
+ ALIGN
+
+ ENDIF
+
+ END
+
+;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
diff --git a/components/gui/STemWin/Config/GUIConf.c b/components/gui/STemWin/Config/GUIConf.c
new file mode 100644
index 00000000..e3d06a43
--- /dev/null
+++ b/components/gui/STemWin/Config/GUIConf.c
@@ -0,0 +1,96 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIConf.c
+Purpose : Display controller initialization
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include "GUI.h"
+
+/*********************************************************************
+*
+* Defines
+*
+**********************************************************************
+*/
+//
+// Define the available number of bytes available for the GUI
+//
+#define GUI_NUMBYTES 0x200000
+
+/*********************************************************************
+*
+* Public code
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* GUI_X_Config
+*
+* Purpose:
+* Called during the initialization process in order to set up the
+* available memory for the GUI.
+*/
+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);
+ //
+ // Set default font
+ //
+ GUI_SetDefaultFont(GUI_FONT_6X8);
+}
+
+/*************************** End of file ****************************/
diff --git a/components/gui/STemWin/Config/GUIConf.h b/components/gui/STemWin/Config/GUIConf.h
new file mode 100644
index 00000000..2945cc44
--- /dev/null
+++ b/components/gui/STemWin/Config/GUIConf.h
@@ -0,0 +1,96 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIConf.h
+Purpose : Configures emWins abilities, fonts etc.
+----------------------------------------------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef GUICONF_H
+#define GUICONF_H
+
+/*********************************************************************
+*
+* Multi layer/display support
+*/
+#define GUI_NUM_LAYERS 2 // Maximum number of available layers
+
+/*********************************************************************
+*
+* Multi tasking support
+*/
+#ifdef OS_SUPPORT
+ #define GUI_OS (1) // Compile with multitasking support
+#else
+ #define GUI_OS (0)
+#endif
+
+/*********************************************************************
+*
+* Configuration of touch support
+*/
+#ifndef GUI_SUPPORT_TOUCH
+ #define GUI_SUPPORT_TOUCH (1) // Support touchscreen
+#endif
+
+/*********************************************************************
+*
+* Default font
+*/
+#define GUI_DEFAULT_FONT &GUI_Font6x8
+
+/*********************************************************************
+*
+* Configuration of available packages
+*/
+#define GUI_SUPPORT_MOUSE (1) /* Support a mouse */
+#define GUI_WINSUPPORT (1) /* Use window manager */
+#define GUI_SUPPORT_MEMDEV (1) /* Memory device package available */
+#define GUI_SUPPORT_DEVICES (1) /* Enable use of device pointers */
+
+#endif /* Avoid multiple inclusion */
diff --git a/components/gui/STemWin/Config/GUIDRV_Template.c b/components/gui/STemWin/Config/GUIDRV_Template.c
new file mode 100644
index 00000000..eda67eec
--- /dev/null
+++ b/components/gui/STemWin/Config/GUIDRV_Template.c
@@ -0,0 +1,836 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIDRV_Template.c
+Purpose : Template driver, could be used as starting point for new
+ simple display drivers supporting only one color depth.
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include
+
+#include "LCD_Private.h"
+#include "GUI_Private.h"
+#include "LCD_ConfDefaults.h"
+
+/*********************************************************************
+*
+* Defines
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* Macros for MIRROR_, SWAP_ and LUT_
+*/
+#if (!defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
+ #if (!LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) x
+ #define LOG2PHYS_Y(x, y) y
+ #elif (!LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) y
+ #define LOG2PHYS_Y(x, y) x
+ #elif (!LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) x
+ #define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
+ #elif (!LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) y
+ #define LOG2PHYS_Y(x, y) LCD_XSIZE - 1 - (x)
+ #elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
+ #define LOG2PHYS_Y(x, y) y
+ #elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
+ #define LOG2PHYS_Y(x, y) x
+ #elif ( LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
+ #define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
+ #elif ( LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
+ #define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
+ #define LOG2PHYS_Y(x, y) LCD_XSIZE - 1 - (x)
+ #endif
+#else
+ #if ( defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
+ #define LOG2PHYS_X(x, y) x
+ #define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
+ #elif (!defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
+ #define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
+ #define LOG2PHYS_Y(x, y) y
+ #elif ( defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
+ #define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
+ #define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
+ #endif
+#endif
+
+/*********************************************************************
+*
+* Types
+*
+**********************************************************************
+*/
+typedef struct {
+ U32 VRAMAddr;
+ int xSize, ySize;
+ int vxSize, vySize;
+ int vxSizePhys;
+ int BitsPerPixel;
+} DRIVER_CONTEXT_TEMPLATE;
+
+/*********************************************************************
+*
+* Static functions
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* _SetPixelIndex
+*
+* Purpose:
+* Sets the index of the given pixel. The upper layers
+* calling this routine make sure that the coordinates are in range, so
+* that no check on the parameters needs to be performed.
+*/
+static void _SetPixelIndex(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) {
+ //
+ // Convert logical into physical coordinates (Dep. on LCDConf.h)
+ //
+ #if (LCD_MIRROR_X == 1) || (LCD_MIRROR_Y == 1) || (LCD_SWAP_XY == 1)
+ int xPhys, yPhys;
+
+ xPhys = LOG2PHYS_X(x, y);
+ yPhys = LOG2PHYS_Y(x, y);
+ #else
+ #define xPhys x
+ #define yPhys y
+ #endif
+ GUI_USE_PARA(pDevice);
+ GUI_USE_PARA(x);
+ GUI_USE_PARA(y);
+ GUI_USE_PARA(PixelIndex);
+ {
+ //
+ // Write into hardware ... Adapt to your system
+ //
+ // TBD by customer...
+ //
+ }
+ #if (LCD_MIRROR_X == 0) && (LCD_MIRROR_Y == 0) && (LCD_SWAP_XY == 0)
+ #undef xPhys
+ #undef yPhys
+ #endif
+}
+
+/*********************************************************************
+*
+* _GetPixelIndex
+*
+* Purpose:
+* Returns the index of the given pixel. The upper layers
+* calling this routine make sure that the coordinates are in range, so
+* that no check on the parameters needs to be performed.
+*/
+static unsigned int _GetPixelIndex(GUI_DEVICE * pDevice, int x, int y) {
+ unsigned int PixelIndex;
+ //
+ // Convert logical into physical coordinates (Dep. on LCDConf.h)
+ //
+ #if (LCD_MIRROR_X == 1) || (LCD_MIRROR_Y == 1) || (LCD_SWAP_XY == 1)
+ int xPhys, yPhys;
+
+ xPhys = LOG2PHYS_X(x, y);
+ yPhys = LOG2PHYS_Y(x, y);
+ #else
+ #define xPhys x
+ #define yPhys y
+ #endif
+ GUI_USE_PARA(pDevice);
+ GUI_USE_PARA(x);
+ GUI_USE_PARA(y);
+ {
+ //
+ // Write into hardware ... Adapt to your system
+ //
+ // TBD by customer...
+ //
+ PixelIndex = 0;
+ }
+ #if (LCD_MIRROR_X == 0) && (LCD_MIRROR_Y == 0) && (LCD_SWAP_XY == 0)
+ #undef xPhys
+ #undef yPhys
+ #endif
+ return PixelIndex;
+}
+
+/*********************************************************************
+*
+* _XorPixel
+*/
+static void _XorPixel(GUI_DEVICE * pDevice, int x, int y) {
+ LCD_PIXELINDEX PixelIndex;
+ LCD_PIXELINDEX IndexMask;
+
+ PixelIndex = _GetPixelIndex(pDevice, x, y);
+ IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
+ _SetPixelIndex(pDevice, x, y, PixelIndex ^ IndexMask);
+}
+
+/*********************************************************************
+*
+* _FillRect
+*/
+static void _FillRect(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
+ LCD_PIXELINDEX PixelIndex;
+ int x;
+
+ PixelIndex = LCD__GetColorIndex();
+ if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
+ for (; y0 <= y1; y0++) {
+ for (x = x0; x <= x1; x++) {
+ _XorPixel(pDevice, x, y0);
+ }
+ }
+ } else {
+ for (; y0 <= y1; y0++) {
+ for (x = x0; x <= x1; x++) {
+ _SetPixelIndex(pDevice, x, y0, PixelIndex);
+ }
+ }
+ }
+}
+
+/*********************************************************************
+*
+* _DrawHLine
+*/
+static void _DrawHLine(GUI_DEVICE * pDevice, int x0, int y, int x1) {
+ _FillRect(pDevice, x0, y, x1, y);
+}
+
+/*********************************************************************
+*
+* _DrawVLine, not optimized
+*/
+static void _DrawVLine(GUI_DEVICE * pDevice, int x, int y0, int y1) {
+ _FillRect(pDevice, x, y0, x, y1);
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 1 BPP
+*/
+static void _DrawBitLine1BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
+ LCD_PIXELINDEX IndexMask, Index0, Index1, Pixel;
+
+ Index0 = *(pTrans + 0);
+ Index1 = *(pTrans + 1);
+ x += Diff;
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ do {
+ _SetPixelIndex(pDevice, x++, y, (*p & (0x80 >> Diff)) ? Index1 : Index0);
+ if (++Diff == 8) {
+ Diff = 0;
+ p++;
+ }
+ } while (--xsize);
+ break;
+ case LCD_DRAWMODE_TRANS:
+ do {
+ if (*p & (0x80 >> Diff))
+ _SetPixelIndex(pDevice, x, y, Index1);
+ x++;
+ if (++Diff == 8) {
+ Diff = 0;
+ p++;
+ }
+ } while (--xsize);
+ break;
+ case LCD_DRAWMODE_XOR | LCD_DRAWMODE_TRANS:
+ case LCD_DRAWMODE_XOR:
+ IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
+ do {
+ if (*p & (0x80 >> Diff)) {
+ Pixel = _GetPixelIndex(pDevice, x, y);
+ _SetPixelIndex(pDevice, x, y, Pixel ^ IndexMask);
+ }
+ x++;
+ if (++Diff == 8) {
+ Diff = 0;
+ p++;
+ }
+ } while (--xsize);
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 2 BPP
+*/
+static void _DrawBitLine2BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
+ LCD_PIXELINDEX Pixels, PixelIndex;
+ int CurrentPixel, Shift, Index;
+
+ Pixels = *p;
+ CurrentPixel = Diff;
+ x += Diff;
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ if (pTrans) {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x++, y, PixelIndex);
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ _SetPixelIndex(pDevice, x++, y, Index);
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ case LCD_DRAWMODE_TRANS:
+ if (pTrans) {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ if (Index) {
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x, y, PixelIndex);
+ }
+ x++;
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (3 - CurrentPixel) << 1;
+ Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
+ if (Index) {
+ _SetPixelIndex(pDevice, x, y, Index);
+ }
+ x++;
+ if (++CurrentPixel == 4) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 4 BPP
+*/
+static void _DrawBitLine4BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
+ LCD_PIXELINDEX Pixels, PixelIndex;
+ int CurrentPixel, Shift, Index;
+
+ Pixels = *p;
+ CurrentPixel = Diff;
+ x += Diff;
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ if (pTrans) {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x++, y, PixelIndex);
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ _SetPixelIndex(pDevice, x++, y, Index);
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ case LCD_DRAWMODE_TRANS:
+ if (pTrans) {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ if (Index) {
+ PixelIndex = *(pTrans + Index);
+ _SetPixelIndex(pDevice, x, y, PixelIndex);
+ }
+ x++;
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ } else {
+ do {
+ Shift = (1 - CurrentPixel) << 2;
+ Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
+ if (Index) {
+ _SetPixelIndex(pDevice, x, y, Index);
+ }
+ x++;
+ if (++CurrentPixel == 2) {
+ CurrentPixel = 0;
+ Pixels = *(++p);
+ }
+ } while (--xsize);
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 8 BPP
+*/
+static void _DrawBitLine8BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int xsize, const LCD_PIXELINDEX * pTrans) {
+ LCD_PIXELINDEX Pixel;
+
+ switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
+ case 0:
+ if (pTrans) {
+ for (; xsize > 0; xsize--, x++, p++) {
+ Pixel = *p;
+ _SetPixelIndex(pDevice, x, y, *(pTrans + Pixel));
+ }
+ } else {
+ for (; xsize > 0; xsize--, x++, p++) {
+ _SetPixelIndex(pDevice, x, y, *p);
+ }
+ }
+ break;
+ case LCD_DRAWMODE_TRANS:
+ if (pTrans) {
+ for (; xsize > 0; xsize--, x++, p++) {
+ Pixel = *p;
+ if (Pixel) {
+ _SetPixelIndex(pDevice, x, y, *(pTrans + Pixel));
+ }
+ }
+ } else {
+ for (; xsize > 0; xsize--, x++, p++) {
+ Pixel = *p;
+ if (Pixel) {
+ _SetPixelIndex(pDevice, x, y, Pixel);
+ }
+ }
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 16 BPP, not optimized
+*
+* Purpose:
+* Drawing of 16bpp high color bitmaps.
+* Only required for 16bpp color depth of target. Should be removed otherwise.
+*/
+static void _DrawBitLine16BPP(GUI_DEVICE * pDevice, int x, int y, U16 const GUI_UNI_PTR * p, int xsize) {
+ for (;xsize > 0; xsize--, x++, p++) {
+ _SetPixelIndex(pDevice, x, y, *p);
+ }
+}
+
+/*********************************************************************
+*
+* Draw Bitmap 32 BPP, not optimized
+*
+* Purpose:
+* Drawing of 32bpp true color bitmaps.
+* Only required for 32bpp color depth of target. Should be removed otherwise.
+*/
+static void _DrawBitLine32BPP(GUI_DEVICE * pDevice, int x, int y, U32 const GUI_UNI_PTR * p, int xsize) {
+ for (;xsize > 0; xsize--, x++, p++) {
+ _SetPixelIndex(pDevice, x, y, *p);
+ }
+}
+
+/*********************************************************************
+*
+* _DrawBitmap
+*/
+static void _DrawBitmap(GUI_DEVICE * pDevice, int x0, int y0,
+ int xSize, int ySize,
+ int BitsPerPixel,
+ int BytesPerLine,
+ const U8 GUI_UNI_PTR * pData, int Diff,
+ const LCD_PIXELINDEX * pTrans) {
+ int i;
+
+ switch (BitsPerPixel) {
+ case 1:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine1BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ case 2:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine2BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ case 4:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine4BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ case 8:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine8BPP(pDevice, x0, i + y0, pData, xSize, pTrans);
+ pData += BytesPerLine;
+ }
+ break;
+ //
+ // Only required for 16bpp color depth of target. Should be removed otherwise.
+ //
+ case 16:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine16BPP(pDevice, x0, i + y0, (const U16 *)pData, xSize);
+ pData += BytesPerLine;
+ }
+ break;
+ //
+ // Only required for 32bpp color depth of target. Should be removed otherwise.
+ //
+ case 32:
+ for (i = 0; i < ySize; i++) {
+ _DrawBitLine32BPP(pDevice, x0, i + y0, (const U32 *)pData, xSize);
+ pData += BytesPerLine;
+ }
+ break;
+ }
+}
+
+/*********************************************************************
+*
+* _InitOnce
+*
+* Purpose:
+* Allocates a fixed block for the context of the driver
+*
+* Return value:
+* 0 on success, 1 on error
+*/
+static int _InitOnce(GUI_DEVICE * pDevice) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ if (pDevice->u.pContext == NULL) {
+ pDevice->u.pContext = GUI_ALLOC_GetFixedBlock(sizeof(DRIVER_CONTEXT_TEMPLATE));
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->BitsPerPixel = LCD__GetBPP(pDevice->pColorConvAPI->pfGetIndexMask());
+ }
+ return pDevice->u.pContext ? 0 : 1;
+}
+
+/*********************************************************************
+*
+* _GetDevProp
+*/
+static I32 _GetDevProp(GUI_DEVICE * pDevice, int Index) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ switch (Index) {
+ case LCD_DEVCAP_XSIZE:
+ return pContext->xSize;
+ case LCD_DEVCAP_YSIZE:
+ return pContext->ySize;
+ case LCD_DEVCAP_VXSIZE:
+ return pContext->vxSize;
+ case LCD_DEVCAP_VYSIZE:
+ return pContext->vySize;
+ case LCD_DEVCAP_BITSPERPIXEL:
+ return pContext->BitsPerPixel;
+ case LCD_DEVCAP_NUMCOLORS:
+ return 0;
+ case LCD_DEVCAP_XMAG:
+ return 1;
+ case LCD_DEVCAP_YMAG:
+ return 1;
+ case LCD_DEVCAP_MIRROR_X:
+ return 0;
+ case LCD_DEVCAP_MIRROR_Y:
+ return 0;
+ case LCD_DEVCAP_SWAP_XY:
+ return 0;
+ }
+ return -1;
+}
+
+/*********************************************************************
+*
+* _GetDevData
+*/
+static void * _GetDevData(GUI_DEVICE * pDevice, int Index) {
+ GUI_USE_PARA(pDevice);
+ #if GUI_SUPPORT_MEMDEV
+ switch (Index) {
+ case LCD_DEVDATA_MEMDEV:
+ return (void *)&GUI_MEMDEV_DEVICE_16; // TBD: Has to be adapted to the right memory device depending on the used color depth!
+ }
+ #else
+ GUI_USE_PARA(Index);
+ #endif
+ return NULL;
+}
+
+/*********************************************************************
+*
+* _GetRect
+*/
+static void _GetRect(GUI_DEVICE * pDevice, LCD_RECT * pRect) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pRect->x0 = 0;
+ pRect->y0 = 0;
+ pRect->x1 = pContext->vxSize - 1;
+ pRect->y1 = pContext->vySize - 1;
+}
+
+/*********************************************************************
+*
+* _SetOrg
+*/
+static void _SetOrg(GUI_DEVICE * pDevice, int x, int y) {
+ LCD_X_SETORG_INFO Data = {0};
+
+ Data.xPos = x;
+ Data.yPos = y;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETORG, (void *)&Data);
+}
+
+/*********************************************************************
+*
+* Static code: Functions available by _GetDevFunc()
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* _SetVRAMAddr
+*/
+static void _SetVRAMAddr(GUI_DEVICE * pDevice, void * pVRAM) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+ LCD_X_SETVRAMADDR_INFO Data = {0};
+
+ _InitOnce(pDevice);
+ if (pDevice->u.pContext) {
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->VRAMAddr = (U32)pVRAM;
+ Data.pVRAM = pVRAM;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETVRAMADDR, (void *)&Data);
+ }
+}
+
+/*********************************************************************
+*
+* _SetVSize
+*/
+static void _SetVSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+
+ _InitOnce(pDevice);
+ if (pDevice->u.pContext) {
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->vxSize = xSize;
+ pContext->vySize = ySize;
+ pContext->vxSizePhys = xSize;
+ }
+}
+
+/*********************************************************************
+*
+* _SetSize
+*/
+static void _SetSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
+ DRIVER_CONTEXT_TEMPLATE * pContext;
+ LCD_X_SETSIZE_INFO Data = {0};
+
+ _InitOnce(pDevice);
+ if (pDevice->u.pContext) {
+ pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
+ pContext->vxSizePhys = (pContext->vxSizePhys == 0) ? xSize : pContext->vxSizePhys;
+ pContext->xSize = xSize;
+ pContext->ySize = ySize;
+ Data.xSize = xSize;
+ Data.ySize = ySize;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETSIZE, (void *)&Data);
+ }
+}
+/*********************************************************************
+*
+* _Init
+*/
+static int _Init(GUI_DEVICE * pDevice) {
+ int r;
+
+ r = _InitOnce(pDevice);
+ r |= LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_INITCONTROLLER, NULL);
+ return r;
+}
+
+/*********************************************************************
+*
+* _On
+*/
+static void _On (GUI_DEVICE * pDevice) {
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_ON, NULL);
+}
+
+/*********************************************************************
+*
+* _Off
+*/
+static void _Off (GUI_DEVICE * pDevice) {
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_OFF, NULL);
+}
+
+/*********************************************************************
+*
+* _SetLUTEntry
+*/
+static void _SetLUTEntry(GUI_DEVICE * pDevice, U8 Pos, LCD_COLOR Color) {
+ LCD_X_SETLUTENTRY_INFO Data = {0};
+
+ Data.Pos = Pos;
+ Data.Color = Color;
+ LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETLUTENTRY, (void *)&Data);
+}
+
+/*********************************************************************
+*
+* _GetDevFunc
+*/
+static void (* _GetDevFunc(GUI_DEVICE ** ppDevice, int Index))(void) {
+ GUI_USE_PARA(ppDevice);
+ switch (Index) {
+ case LCD_DEVFUNC_SET_VRAM_ADDR:
+ return (void (*)(void))_SetVRAMAddr;
+ case LCD_DEVFUNC_SET_VSIZE:
+ return (void (*)(void))_SetVSize;
+ case LCD_DEVFUNC_SET_SIZE:
+ return (void (*)(void))_SetSize;
+ case LCD_DEVFUNC_INIT:
+ return (void (*)(void))_Init;
+ case LCD_DEVFUNC_ON:
+ return (void (*)(void))_On;
+ case LCD_DEVFUNC_OFF:
+ return (void (*)(void))_Off;
+ case LCD_DEVFUNC_SETLUTENTRY:
+ return (void (*)(void))_SetLUTEntry;
+ }
+ return NULL;
+}
+
+/*********************************************************************
+*
+* Public data
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* GUI_DEVICE_API structure
+*/
+const GUI_DEVICE_API GUIDRV_Template_API = {
+ //
+ // Data
+ //
+ DEVICE_CLASS_DRIVER,
+ //
+ // Drawing functions
+ //
+ _DrawBitmap,
+ _DrawHLine,
+ _DrawVLine,
+ _FillRect,
+ _GetPixelIndex,
+ _SetPixelIndex,
+ _XorPixel,
+ //
+ // Set origin
+ //
+ _SetOrg,
+ //
+ // Request information
+ //
+ _GetDevFunc,
+ _GetDevProp,
+ _GetDevData,
+ _GetRect,
+};
+
+/*************************** End of file ****************************/
diff --git a/components/gui/STemWin/Config/GUIDRV_Template.h b/components/gui/STemWin/Config/GUIDRV_Template.h
new file mode 100644
index 00000000..773d8baa
--- /dev/null
+++ b/components/gui/STemWin/Config/GUIDRV_Template.h
@@ -0,0 +1,73 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : GUIDRV_Template.h
+Purpose : Interface definition for GUIDRV_Template driver
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef GUIDRV_TEMPLATE_H
+#define GUIDRV_TEMPLATE_H
+
+/*********************************************************************
+*
+* Display drivers
+*/
+//
+// Addresses
+//
+extern const GUI_DEVICE_API GUIDRV_Template_API;
+
+//
+// Macro to be used in configuration files
+//
+#define GUIDRV_TEMPLATE &GUIDRV_Template_API
+
+#endif
+
+/*************************** End of file ****************************/
diff --git a/components/gui/STemWin/Config/LCDConf_FlexColor_Template.c b/components/gui/STemWin/Config/LCDConf_FlexColor_Template.c
new file mode 100644
index 00000000..c421922b
--- /dev/null
+++ b/components/gui/STemWin/Config/LCDConf_FlexColor_Template.c
@@ -0,0 +1,236 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_FlexColor_Template.c
+Purpose : Display controller configuration (single layer)
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include "GUI.h"
+#include "GUIDRV_FlexColor.h"
+
+/*********************************************************************
+*
+* Layer configuration (to be modified)
+*
+**********************************************************************
+*/
+
+//
+// Physical display size
+//
+#define XSIZE_PHYS 240 // To be adapted to x-screen size
+#define YSIZE_PHYS 320 // To be adapted to y-screen size
+
+/*********************************************************************
+*
+* Configuration checking
+*
+**********************************************************************
+*/
+#ifndef VXSIZE_PHYS
+ #define VXSIZE_PHYS XSIZE_PHYS
+#endif
+#ifndef VYSIZE_PHYS
+ #define VYSIZE_PHYS YSIZE_PHYS
+#endif
+#ifndef XSIZE_PHYS
+ #error Physical X size of display is not defined!
+#endif
+#ifndef YSIZE_PHYS
+ #error Physical Y size of display is not defined!
+#endif
+#ifndef GUICC_565
+ #error Color conversion not defined!
+#endif
+#ifndef GUIDRV_FLEXCOLOR
+ #error No display driver defined!
+#endif
+
+/*********************************************************************
+*
+* Local functions
+*
+**********************************************************************
+*/
+/********************************************************************
+*
+* LcdWriteReg
+*
+* Function description:
+* Sets display register
+*/
+static void LcdWriteReg(U16 Data) {
+ // ... TBD by user
+}
+
+/********************************************************************
+*
+* LcdWriteData
+*
+* Function description:
+* Writes a value to a display register
+*/
+static void LcdWriteData(U16 Data) {
+ // ... TBD by user
+}
+
+/********************************************************************
+*
+* LcdWriteDataMultiple
+*
+* Function description:
+* Writes multiple values to a display register.
+*/
+static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
+ while (NumItems--) {
+ // ... TBD by user
+ }
+}
+
+/********************************************************************
+*
+* LcdReadDataMultiple
+*
+* Function description:
+* Reads multiple values from a display register.
+*/
+static void LcdReadDataMultiple(U16 * pData, int NumItems) {
+ while (NumItems--) {
+ // ... TBD by user
+ }
+}
+
+/*********************************************************************
+*
+* Public functions
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* LCD_X_Config
+*
+* Function description:
+* Called during the initialization process in order to set up the
+* display driver configuration.
+*
+*/
+void LCD_X_Config(void) {
+ GUI_DEVICE * pDevice;
+ CONFIG_FLEXCOLOR Config = {0};
+ GUI_PORT_API PortAPI = {0};
+ //
+ // Set display driver and color conversion
+ //
+ pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565, 0, 0);
+ //
+ // Display driver configuration, required for Lin-driver
+ //
+ LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
+ LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
+ //
+ // Orientation
+ //
+ Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y;
+ GUIDRV_FlexColor_Config(pDevice, &Config);
+ //
+ // Set controller and operation mode
+ //
+ PortAPI.pfWrite16_A0 = LcdWriteReg;
+ PortAPI.pfWrite16_A1 = LcdWriteData;
+ PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple;
+ PortAPI.pfReadM16_A1 = LcdReadDataMultiple;
+ GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66708, GUIDRV_FLEXCOLOR_M16C0B16);
+}
+
+/*********************************************************************
+*
+* LCD_X_DisplayDriver
+*
+* Function description:
+* This function is called by the display driver for several purposes.
+* To support the according task the routine needs to be adapted to
+* the display controller. Please note that the commands marked with
+* 'optional' are not cogently required and should only be adapted if
+* the display controller supports these features.
+*
+* Parameter:
+* LayerIndex - Index of layer to be configured
+* Cmd - Please refer to the details in the switch statement below
+* pData - Pointer to a LCD_X_DATA structure
+*
+* Return Value:
+* < -1 - Error
+* -1 - Command not handled
+* 0 - Ok
+*/
+int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
+ int r;
+ (void) LayerIndex;
+ (void) pData;
+
+ switch (Cmd) {
+ case LCD_X_INITCONTROLLER: {
+ //
+ // Called during the initialization process in order to set up the
+ // display controller and put it into operation. If the display
+ // controller is not initialized by any external routine this needs
+ // to be adapted by the customer...
+ //
+ // ...
+ return 0;
+ }
+ default:
+ r = -1;
+ }
+ return r;
+}
+
+/*************************** End of file ****************************/
+
diff --git a/components/gui/STemWin/Config/LCDConf_FlexColor_Template.h b/components/gui/STemWin/Config/LCDConf_FlexColor_Template.h
new file mode 100644
index 00000000..76fbcaf5
--- /dev/null
+++ b/components/gui/STemWin/Config/LCDConf_FlexColor_Template.h
@@ -0,0 +1,59 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_FlexColor_Template.h
+Purpose : Display driver configuration file
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef LCDCONF_H
+#define LCDCONF_H
+
+#endif /* LCDCONF_H */
+
+/*************************** End of file ****************************/
diff --git a/components/gui/STemWin/Config/LCDConf_Lin_Template.c b/components/gui/STemWin/Config/LCDConf_Lin_Template.c
new file mode 100644
index 00000000..3db3a0ff
--- /dev/null
+++ b/components/gui/STemWin/Config/LCDConf_Lin_Template.c
@@ -0,0 +1,262 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_Lin_Template.c
+Purpose : Display controller configuration (single layer)
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#include "GUI.h"
+#include "GUIDRV_Lin.h"
+
+/*********************************************************************
+*
+* Layer configuration (to be modified)
+*
+**********************************************************************
+*/
+//
+// Physical display size
+//
+#define XSIZE_PHYS 320
+#define YSIZE_PHYS 240
+
+//
+// Color conversion
+//
+#define COLOR_CONVERSION GUICC_8888
+
+//
+// Display driver
+//
+#define DISPLAY_DRIVER GUIDRV_WIN32
+
+//
+// Buffers / VScreens
+//
+#define NUM_BUFFERS 1 // Number of multiple buffers to be used
+#define NUM_VSCREENS 1 // Number of virtual screens to be used
+
+/*********************************************************************
+*
+* Configuration checking
+*
+**********************************************************************
+*/
+#ifndef VRAM_ADDR
+ #define VRAM_ADDR 0 // TBD by customer: This has to be the frame buffer start address
+#endif
+#ifndef XSIZE_PHYS
+ #error Physical X size of display is not defined!
+#endif
+#ifndef YSIZE_PHYS
+ #error Physical Y size of display is not defined!
+#endif
+#ifndef COLOR_CONVERSION
+ #error Color conversion not defined!
+#endif
+#ifndef DISPLAY_DRIVER
+ #error No display driver defined!
+#endif
+#ifndef NUM_VSCREENS
+ #define NUM_VSCREENS 1
+#else
+ #if (NUM_VSCREENS <= 0)
+ #error At least one screeen needs to be defined!
+ #endif
+#endif
+#if (NUM_VSCREENS > 1) && (NUM_BUFFERS > 1)
+ #error Virtual screens and multiple buffers are not allowed!
+#endif
+
+/*********************************************************************
+*
+* Public code
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* LCD_X_Config
+*
+* Purpose:
+* Called during the initialization process in order to set up the
+* display driver configuration.
+*
+*/
+void LCD_X_Config(void) {
+ //
+ // At first initialize use of multiple buffers on demand
+ //
+ #if (NUM_BUFFERS > 1)
+ GUI_MULTIBUF_Config(NUM_BUFFERS);
+ #endif
+ //
+ // Set display driver and color conversion for 1st layer
+ //
+ GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
+ //
+ // Display driver configuration, required for Lin-driver
+ //
+ if (LCD_GetSwapXY()) {
+ LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
+ LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
+ } else {
+ LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
+ LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);
+ }
+ LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR);
+ //
+ // Set user palette data (only required if no fixed palette is used)
+ //
+ #if defined(PALETTE)
+ LCD_SetLUTEx(0, PALETTE);
+ #endif
+
+ //
+ // Set custom functions for several operations to optimize native processes
+ //
+ LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))CUSTOM_LCD_CopyBuffer);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_COPYRECT, (void(*)(void))CUSTOM_LCD_CopyRect);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_FILLRECT, (void(*)(void))CUSTOM_LCD_FillRect);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap8bpp);
+ LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_16BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap16bpp);
+}
+
+/*********************************************************************
+*
+* LCD_X_DisplayDriver
+*
+* Purpose:
+* This function is called by the display driver for several purposes.
+* To support the according task the routine needs to be adapted to
+* the display controller. Please note that the commands marked with
+* 'optional' are not cogently required and should only be adapted if
+* the display controller supports these features.
+*
+* Parameter:
+* LayerIndex - Index of layer to be configured
+* Cmd - Please refer to the details in the switch statement below
+* pData - Pointer to a LCD_X_DATA structure
+*
+* Return Value:
+* < -1 - Error
+* -1 - Command not handled
+* 0 - Ok
+*/
+int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
+ int r;
+
+ switch (Cmd) {
+ case LCD_X_INITCONTROLLER: {
+ //
+ // Called during the initialization process in order to set up the
+ // display controller and put it into operation. If the display
+ // controller is not initialized by any external routine this needs
+ // to be adapted by the customer...
+ //
+ // ...
+ return 0;
+ }
+ case LCD_X_SETVRAMADDR: {
+ //
+ // Required for setting the address of the video RAM for drivers
+ // with memory mapped video RAM which is passed in the 'pVRAM' element of p
+ //
+ LCD_X_SETVRAMADDR_INFO * p;
+ p = (LCD_X_SETVRAMADDR_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_SETORG: {
+ //
+ // Required for setting the display origin which is passed in the 'xPos' and 'yPos' element of p
+ //
+ LCD_X_SETORG_INFO * p;
+ p = (LCD_X_SETORG_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_SHOWBUFFER: {
+ //
+ // Required if multiple buffers are used. The 'Index' element of p contains the buffer index.
+ //
+ LCD_X_SHOWBUFFER_INFO * p;
+ p = (LCD_X_SHOWBUFFER_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_SETLUTENTRY: {
+ //
+ // Required for setting a lookup table entry which is passed in the 'Pos' and 'Color' element of p
+ //
+ LCD_X_SETLUTENTRY_INFO * p;
+ p = (LCD_X_SETLUTENTRY_INFO *)pData;
+ //...
+ return 0;
+ }
+ case LCD_X_ON: {
+ //
+ // Required if the display controller should support switching on and off
+ //
+ return 0;
+ }
+ case LCD_X_OFF: {
+ //
+ // Required if the display controller should support switching on and off
+ //
+ // ...
+ return 0;
+ }
+ default:
+ r = -1;
+ }
+ return r;
+}
+
+/*************************** End of file ****************************/
diff --git a/components/gui/STemWin/Config/LCDConf_Lin_Template.h b/components/gui/STemWin/Config/LCDConf_Lin_Template.h
new file mode 100644
index 00000000..304e693b
--- /dev/null
+++ b/components/gui/STemWin/Config/LCDConf_Lin_Template.h
@@ -0,0 +1,59 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.30 - Graphical user interface for embedded applications **
+All Intellectual Property rights in the Software belongs to SEGGER.
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with the following terms:
+
+The software has been licensed to STMicroelectronics International
+N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
+les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
+purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
+troller products commercialized by Licensee only, sublicensed and dis_
+tributed under the terms and conditions of the End User License Agree_
+ment supplied by STMicroelectronics International N.V.
+Full source code is available at: www.segger.com
+
+We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : LCDConf_Lin_Template.h
+Purpose : Display driver configuration file
+---------------------------END-OF-HEADER------------------------------
+*/
+
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifndef LCDCONF_H
+#define LCDCONF_H
+
+#endif /* LCDCONF_H */
+
+/*************************** End of file ****************************/
diff --git a/components/gui/STemWin/Config/SIMConf.c b/components/gui/STemWin/Config/SIMConf.c
new file mode 100644
index 00000000..80d048d2
--- /dev/null
+++ b/components/gui/STemWin/Config/SIMConf.c
@@ -0,0 +1,71 @@
+/*********************************************************************
+* Portions COPYRIGHT 2016 STMicroelectronics *
+* Portions SEGGER Microcontroller GmbH & Co. KG *
+* Solutions for real time microcontroller applications *
+**********************************************************************
+* *
+* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
+* *
+* Internet: www.segger.com Support: support@segger.com *
+* *
+**********************************************************************
+
+** emWin V5.32 - Graphical user interface for embedded applications **
+emWin is protected by international copyright laws. Knowledge of the
+source code may not be used to write a similar product. This file may
+only be used in accordance with a license and should not be re-
+distributed in any way. We appreciate your understanding and fairness.
+----------------------------------------------------------------------
+File : SIMConf.c
+Purpose : Windows Simulator configuration
+---------------------------END-OF-HEADER------------------------------
+*/
+/**
+ ******************************************************************************
+ * @attention
+ *
+ * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.st.com/software_license_agreement_liberty_v2
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************
+ */
+
+#ifdef WIN32
+
+#include "LCD_SIM.h"
+
+/*********************************************************************
+*
+* Public code
+*
+**********************************************************************
+*/
+/*********************************************************************
+*
+* SIM_X_Config
+*
+* Purpose:
+* Called during the initialization process in order to configure
+* the simulator.
+*/
+void SIM_X_Config() {
+ SIM_GUI_SetTransColor(0xff0000); // Define the transparent color
+}
+
+#else
+
+void SIMConf_C(void); // Avoid empty object files
+void SIMConf_C(void) {}
+
+#endif
+
+/*************************** End of file ****************************/
diff --git a/components/gui/STemWin/Documentation/STemWin532.pdf b/components/gui/STemWin/Documentation/STemWin532.pdf
new file mode 100644
index 00000000..aef08df5
--- /dev/null
+++ b/components/gui/STemWin/Documentation/STemWin532.pdf
@@ -0,0 +1,111192 @@
+%PDF-1.2
%âãÏÓ
+78186 0 obj <>
endobj
xref
+78186 865
+0000000016 00000 n
+0000041620 00000 n
+0000041819 00000 n
+0000041849 00000 n
+0000041895 00000 n
+0000041934 00000 n
+0000042078 00000 n
+0000042279 00000 n
+0000042437 00000 n
+0000042490 00000 n
+0000042923 00000 n
+0000043615 00000 n
+0000043706 00000 n
+0000044450 00000 n
+0000045022 00000 n
+0000045204 00000 n
+0000045434 00000 n
+0000045769 00000 n
+0000046106 00000 n
+0000056256 00000 n
+0000057075 00000 n
+0000057333 00000 n
+0000058460 00000 n
+0000058725 00000 n
+0000058788 00000 n
+0000058887 00000 n
+0000058972 00000 n
+0000059115 00000 n
+0000059286 00000 n
+0000059377 00000 n
+0000059526 00000 n
+0000059640 00000 n
+0000059750 00000 n
+0000059915 00000 n
+0000060051 00000 n
+0000060197 00000 n
+0000060371 00000 n
+0000060480 00000 n
+0000060575 00000 n
+0000060723 00000 n
+0000060825 00000 n
+0000060925 00000 n
+0000061071 00000 n
+0000061209 00000 n
+0000061309 00000 n
+0000061460 00000 n
+0000061611 00000 n
+0000061769 00000 n
+0000061920 00000 n
+0000062053 00000 n
+0000062150 00000 n
+0000062298 00000 n
+0000062436 00000 n
+0000062530 00000 n
+0000062672 00000 n
+0000062774 00000 n
+0000062869 00000 n
+0000063011 00000 n
+0000063108 00000 n
+0000063203 00000 n
+0000063352 00000 n
+0000063449 00000 n
+0000063555 00000 n
+0000063715 00000 n
+0000063812 00000 n
+0000063921 00000 n
+0000064077 00000 n
+0000064174 00000 n
+0000064282 00000 n
+0000064451 00000 n
+0000064589 00000 n
+0000064729 00000 n
+0000064896 00000 n
+0000064994 00000 n
+0000065098 00000 n
+0000065252 00000 n
+0000065390 00000 n
+0000065498 00000 n
+0000065643 00000 n
+0000065746 00000 n
+0000065890 00000 n
+0000066036 00000 n
+0000066134 00000 n
+0000066242 00000 n
+0000066384 00000 n
+0000066483 00000 n
+0000066623 00000 n
+0000066785 00000 n
+0000066921 00000 n
+0000067069 00000 n
+0000067230 00000 n
+0000067336 00000 n
+0000067429 00000 n
+0000067604 00000 n
+0000067715 00000 n
+0000067808 00000 n
+0000067959 00000 n
+0000068079 00000 n
+0000068223 00000 n
+0000068365 00000 n
+0000068467 00000 n
+0000068603 00000 n
+0000068749 00000 n
+0000068847 00000 n
+0000068947 00000 n
+0000069088 00000 n
+0000069185 00000 n
+0000069280 00000 n
+0000069431 00000 n
+0000069529 00000 n
+0000069631 00000 n
+0000069772 00000 n
+0000069870 00000 n
+0000070010 00000 n
+0000070162 00000 n
+0000070259 00000 n
+0000070374 00000 n
+0000070533 00000 n
+0000070674 00000 n
+0000070800 00000 n
+0000070954 00000 n
+0000071076 00000 n
+0000071228 00000 n
+0000071346 00000 n
+0000071495 00000 n
+0000071592 00000 n
+0000071723 00000 n
+0000071866 00000 n
+0000072002 00000 n
+0000072098 00000 n
+0000072239 00000 n
+0000072364 00000 n
+0000072509 00000 n
+0000072653 00000 n
+0000072837 00000 n
+0000072986 00000 n
+0000073099 00000 n
+0000073216 00000 n
+0000073372 00000 n
+0000073479 00000 n
+0000073573 00000 n
+0000073684 00000 n
+0000073832 00000 n
+0000073953 00000 n
+0000074064 00000 n
+0000074181 00000 n
+0000074288 00000 n
+0000074439 00000 n
+0000074551 00000 n
+0000074673 00000 n
+0000074804 00000 n
+0000074921 00000 n
+0000075037 00000 n
+0000075169 00000 n
+0000075326 00000 n
+0000075451 00000 n
+0000075584 00000 n
+0000075737 00000 n
+0000075827 00000 n
+0000075932 00000 n
+0000076036 00000 n
+0000076193 00000 n
+0000076286 00000 n
+0000076406 00000 n
+0000076562 00000 n
+0000076668 00000 n
+0000076765 00000 n
+0000076884 00000 n
+0000077022 00000 n
+0000077151 00000 n
+0000077270 00000 n
+0000077391 00000 n
+0000077534 00000 n
+0000077687 00000 n
+0000077808 00000 n
+0000077931 00000 n
+0000078071 00000 n
+0000078204 00000 n
+0000078312 00000 n
+0000078455 00000 n
+0000078569 00000 n
+0000078705 00000 n
+0000078863 00000 n
+0000078959 00000 n
+0000079080 00000 n
+0000079250 00000 n
+0000079368 00000 n
+0000079475 00000 n
+0000079601 00000 n
+0000079723 00000 n
+0000079844 00000 n
+0000079942 00000 n
+0000080040 00000 n
+0000080140 00000 n
+0000080233 00000 n
+0000080340 00000 n
+0000080452 00000 n
+0000080561 00000 n
+0000080674 00000 n
+0000080785 00000 n
+0000080887 00000 n
+0000081017 00000 n
+0000081142 00000 n
+0000081275 00000 n
+0000081387 00000 n
+0000081499 00000 n
+0000081627 00000 n
+0000081766 00000 n
+0000081887 00000 n
+0000082004 00000 n
+0000082119 00000 n
+0000082237 00000 n
+0000082354 00000 n
+0000082472 00000 n
+0000082587 00000 n
+0000082713 00000 n
+0000082830 00000 n
+0000082946 00000 n
+0000083070 00000 n
+0000083226 00000 n
+0000083346 00000 n
+0000083440 00000 n
+0000083596 00000 n
+0000083716 00000 n
+0000083810 00000 n
+0000083967 00000 n
+0000084088 00000 n
+0000084183 00000 n
+0000084307 00000 n
+0000084421 00000 n
+0000084544 00000 n
+0000084680 00000 n
+0000084794 00000 n
+0000084916 00000 n
+0000085030 00000 n
+0000085152 00000 n
+0000085256 00000 n
+0000085350 00000 n
+0000085509 00000 n
+0000085616 00000 n
+0000085724 00000 n
+0000085859 00000 n
+0000085977 00000 n
+0000086102 00000 n
+0000086273 00000 n
+0000086384 00000 n
+0000086486 00000 n
+0000086648 00000 n
+0000086756 00000 n
+0000086862 00000 n
+0000086971 00000 n
+0000087087 00000 n
+0000087243 00000 n
+0000087358 00000 n
+0000087464 00000 n
+0000087585 00000 n
+0000087724 00000 n
+0000087845 00000 n
+0000087972 00000 n
+0000088088 00000 n
+0000088202 00000 n
+0000088323 00000 n
+0000088444 00000 n
+0000088558 00000 n
+0000088713 00000 n
+0000088806 00000 n
+0000088901 00000 n
+0000089050 00000 n
+0000089167 00000 n
+0000089284 00000 n
+0000089401 00000 n
+0000089524 00000 n
+0000089658 00000 n
+0000089811 00000 n
+0000089912 00000 n
+0000090028 00000 n
+0000090139 00000 n
+0000090267 00000 n
+0000090405 00000 n
+0000090546 00000 n
+0000090682 00000 n
+0000090818 00000 n
+0000090954 00000 n
+0000091095 00000 n
+0000091226 00000 n
+0000091345 00000 n
+0000091474 00000 n
+0000091595 00000 n
+0000091746 00000 n
+0000091876 00000 n
+0000092031 00000 n
+0000092151 00000 n
+0000092271 00000 n
+0000092433 00000 n
+0000092539 00000 n
+0000092646 00000 n
+0000092801 00000 n
+0000092926 00000 n
+0000093055 00000 n
+0000093197 00000 n
+0000093350 00000 n
+0000093486 00000 n
+0000093642 00000 n
+0000093747 00000 n
+0000093875 00000 n
+0000093983 00000 n
+0000094138 00000 n
+0000094257 00000 n
+0000094355 00000 n
+0000094507 00000 n
+0000094621 00000 n
+0000094721 00000 n
+0000094892 00000 n
+0000095004 00000 n
+0000095104 00000 n
+0000095252 00000 n
+0000095363 00000 n
+0000095472 00000 n
+0000095599 00000 n
+0000095718 00000 n
+0000095846 00000 n
+0000095991 00000 n
+0000096142 00000 n
+0000096286 00000 n
+0000096430 00000 n
+0000096546 00000 n
+0000096677 00000 n
+0000096792 00000 n
+0000096927 00000 n
+0000097039 00000 n
+0000097202 00000 n
+0000097321 00000 n
+0000097423 00000 n
+0000097584 00000 n
+0000097692 00000 n
+0000097821 00000 n
+0000097950 00000 n
+0000098053 00000 n
+0000098161 00000 n
+0000098279 00000 n
+0000098439 00000 n
+0000098529 00000 n
+0000098666 00000 n
+0000098806 00000 n
+0000098925 00000 n
+0000099051 00000 n
+0000099169 00000 n
+0000099327 00000 n
+0000099428 00000 n
+0000099547 00000 n
+0000099662 00000 n
+0000099806 00000 n
+0000099910 00000 n
+0000100058 00000 n
+0000100180 00000 n
+0000100320 00000 n
+0000100465 00000 n
+0000100581 00000 n
+0000100693 00000 n
+0000100813 00000 n
+0000100948 00000 n
+0000101086 00000 n
+0000101216 00000 n
+0000101351 00000 n
+0000101502 00000 n
+0000101625 00000 n
+0000101754 00000 n
+0000101876 00000 n
+0000102001 00000 n
+0000102122 00000 n
+0000102268 00000 n
+0000102416 00000 n
+0000102602 00000 n
+0000102700 00000 n
+0000102794 00000 n
+0000102974 00000 n
+0000103072 00000 n
+0000103170 00000 n
+0000103342 00000 n
+0000103440 00000 n
+0000103559 00000 n
+0000103672 00000 n
+0000103787 00000 n
+0000103899 00000 n
+0000104036 00000 n
+0000104151 00000 n
+0000104263 00000 n
+0000104380 00000 n
+0000104493 00000 n
+0000104608 00000 n
+0000104720 00000 n
+0000104867 00000 n
+0000104981 00000 n
+0000105101 00000 n
+0000105223 00000 n
+0000105372 00000 n
+0000105477 00000 n
+0000105593 00000 n
+0000105742 00000 n
+0000105843 00000 n
+0000105948 00000 n
+0000106103 00000 n
+0000106224 00000 n
+0000106345 00000 n
+0000106549 00000 n
+0000106664 00000 n
+0000106767 00000 n
+0000106908 00000 n
+0000107050 00000 n
+0000107184 00000 n
+0000107319 00000 n
+0000107438 00000 n
+0000107553 00000 n
+0000107696 00000 n
+0000107829 00000 n
+0000107957 00000 n
+0000108083 00000 n
+0000108219 00000 n
+0000108355 00000 n
+0000108495 00000 n
+0000108621 00000 n
+0000108740 00000 n
+0000108874 00000 n
+0000109019 00000 n
+0000109156 00000 n
+0000109292 00000 n
+0000109417 00000 n
+0000109543 00000 n
+0000109653 00000 n
+0000109752 00000 n
+0000109919 00000 n
+0000110028 00000 n
+0000110124 00000 n
+0000110283 00000 n
+0000110393 00000 n
+0000110490 00000 n
+0000110659 00000 n
+0000110781 00000 n
+0000110878 00000 n
+0000111048 00000 n
+0000111158 00000 n
+0000111254 00000 n
+0000111417 00000 n
+0000111527 00000 n
+0000111623 00000 n
+0000111793 00000 n
+0000111903 00000 n
+0000111999 00000 n
+0000112167 00000 n
+0000112277 00000 n
+0000112374 00000 n
+0000112544 00000 n
+0000112654 00000 n
+0000112751 00000 n
+0000112924 00000 n
+0000113034 00000 n
+0000113130 00000 n
+0000113305 00000 n
+0000113415 00000 n
+0000113511 00000 n
+0000113670 00000 n
+0000113772 00000 n
+0000113868 00000 n
+0000114037 00000 n
+0000114147 00000 n
+0000114249 00000 n
+0000114416 00000 n
+0000114526 00000 n
+0000114622 00000 n
+0000114788 00000 n
+0000114898 00000 n
+0000114995 00000 n
+0000115154 00000 n
+0000115255 00000 n
+0000115352 00000 n
+0000115513 00000 n
+0000115623 00000 n
+0000115721 00000 n
+0000115889 00000 n
+0000115999 00000 n
+0000116095 00000 n
+0000116258 00000 n
+0000116368 00000 n
+0000116464 00000 n
+0000116625 00000 n
+0000116743 00000 n
+0000116840 00000 n
+0000117010 00000 n
+0000117127 00000 n
+0000117222 00000 n
+0000117380 00000 n
+0000117489 00000 n
+0000117585 00000 n
+0000117751 00000 n
+0000117860 00000 n
+0000117955 00000 n
+0000118121 00000 n
+0000118230 00000 n
+0000118325 00000 n
+0000118487 00000 n
+0000118596 00000 n
+0000118692 00000 n
+0000118851 00000 n
+0000118967 00000 n
+0000119073 00000 n
+0000119184 00000 n
+0000119306 00000 n
+0000119424 00000 n
+0000119537 00000 n
+0000119657 00000 n
+0000119778 00000 n
+0000119895 00000 n
+0000120010 00000 n
+0000120130 00000 n
+0000120251 00000 n
+0000120368 00000 n
+0000120483 00000 n
+0000120603 00000 n
+0000120724 00000 n
+0000120841 00000 n
+0000120951 00000 n
+0000121071 00000 n
+0000121192 00000 n
+0000121309 00000 n
+0000121424 00000 n
+0000121544 00000 n
+0000121668 00000 n
+0000121781 00000 n
+0000121902 00000 n
+0000122020 00000 n
+0000122145 00000 n
+0000122274 00000 n
+0000122393 00000 n
+0000122533 00000 n
+0000122647 00000 n
+0000122768 00000 n
+0000122890 00000 n
+0000123006 00000 n
+0000123127 00000 n
+0000123249 00000 n
+0000123367 00000 n
+0000123489 00000 n
+0000123607 00000 n
+0000123728 00000 n
+0000123850 00000 n
+0000123968 00000 n
+0000124093 00000 n
+0000124207 00000 n
+0000124328 00000 n
+0000124450 00000 n
+0000124568 00000 n
+0000124684 00000 n
+0000124805 00000 n
+0000124927 00000 n
+0000125045 00000 n
+0000125166 00000 n
+0000125288 00000 n
+0000125406 00000 n
+0000125518 00000 n
+0000125639 00000 n
+0000125764 00000 n
+0000125883 00000 n
+0000126000 00000 n
+0000126121 00000 n
+0000126243 00000 n
+0000126361 00000 n
+0000126478 00000 n
+0000126599 00000 n
+0000126721 00000 n
+0000126839 00000 n
+0000126953 00000 n
+0000127074 00000 n
+0000127192 00000 n
+0000127305 00000 n
+0000127426 00000 n
+0000127548 00000 n
+0000127666 00000 n
+0000127783 00000 n
+0000127904 00000 n
+0000128026 00000 n
+0000128144 00000 n
+0000128258 00000 n
+0000128379 00000 n
+0000128501 00000 n
+0000128619 00000 n
+0000128734 00000 n
+0000128855 00000 n
+0000128977 00000 n
+0000129095 00000 n
+0000129212 00000 n
+0000129334 00000 n
+0000129452 00000 n
+0000129577 00000 n
+0000129725 00000 n
+0000129837 00000 n
+0000129958 00000 n
+0000130080 00000 n
+0000130198 00000 n
+0000130314 00000 n
+0000130435 00000 n
+0000130557 00000 n
+0000130675 00000 n
+0000130800 00000 n
+0000130921 00000 n
+0000131025 00000 n
+0000131131 00000 n
+0000131271 00000 n
+0000131393 00000 n
+0000131489 00000 n
+0000131587 00000 n
+0000131698 00000 n
+0000131856 00000 n
+0000131958 00000 n
+0000132062 00000 n
+0000132175 00000 n
+0000132289 00000 n
+0000132411 00000 n
+0000132536 00000 n
+0000132667 00000 n
+0000132825 00000 n
+0000132938 00000 n
+0000133043 00000 n
+0000133159 00000 n
+0000133288 00000 n
+0000133430 00000 n
+0000133564 00000 n
+0000133705 00000 n
+0000133817 00000 n
+0000133922 00000 n
+0000134080 00000 n
+0000134192 00000 n
+0000134297 00000 n
+0000134458 00000 n
+0000134570 00000 n
+0000134675 00000 n
+0000134832 00000 n
+0000134944 00000 n
+0000135049 00000 n
+0000135208 00000 n
+0000135320 00000 n
+0000135425 00000 n
+0000135586 00000 n
+0000135698 00000 n
+0000135803 00000 n
+0000135959 00000 n
+0000136071 00000 n
+0000136176 00000 n
+0000136334 00000 n
+0000136446 00000 n
+0000136551 00000 n
+0000136711 00000 n
+0000136823 00000 n
+0000136928 00000 n
+0000137088 00000 n
+0000137200 00000 n
+0000137305 00000 n
+0000137464 00000 n
+0000137575 00000 n
+0000137679 00000 n
+0000137836 00000 n
+0000137947 00000 n
+0000138051 00000 n
+0000138172 00000 n
+0000138357 00000 n
+0000138476 00000 n
+0000138580 00000 n
+0000138726 00000 n
+0000138879 00000 n
+0000138988 00000 n
+0000139102 00000 n
+0000139220 00000 n
+0000139357 00000 n
+0000139497 00000 n
+0000139612 00000 n
+0000139736 00000 n
+0000139851 00000 n
+0000139975 00000 n
+0000140091 00000 n
+0000140216 00000 n
+0000140332 00000 n
+0000140457 00000 n
+0000140573 00000 n
+0000140698 00000 n
+0000140814 00000 n
+0000140939 00000 n
+0000141055 00000 n
+0000141180 00000 n
+0000141296 00000 n
+0000141421 00000 n
+0000141537 00000 n
+0000141662 00000 n
+0000141778 00000 n
+0000141903 00000 n
+0000142019 00000 n
+0000142144 00000 n
+0000142260 00000 n
+0000142385 00000 n
+0000142531 00000 n
+0000142685 00000 n
+0000142789 00000 n
+0000142900 00000 n
+0000143012 00000 n
+0000143125 00000 n
+0000143229 00000 n
+0000143333 00000 n
+0000143482 00000 n
+0000143583 00000 n
+0000143710 00000 n
+0000143824 00000 n
+0000143937 00000 n
+0000144082 00000 n
+0000144168 00000 n
+0000144325 00000 n
+0000144461 00000 n
+0000144571 00000 n
+0000144738 00000 n
+0000144855 00000 n
+0000144975 00000 n
+0000145140 00000 n
+0000145240 00000 n
+0000145358 00000 n
+0000145479 00000 n
+0000145598 00000 n
+0000145715 00000 n
+0000145838 00000 n
+0000145965 00000 n
+0000146087 00000 n
+0000146215 00000 n
+0000146333 00000 n
+0000146498 00000 n
+0000146639 00000 n
+0000146742 00000 n
+0000146902 00000 n
+0000147014 00000 n
+0000147132 00000 n
+0000147285 00000 n
+0000147397 00000 n
+0000147500 00000 n
+0000147625 00000 n
+0000147779 00000 n
+0000147896 00000 n
+0000148011 00000 n
+0000148137 00000 n
+0000148253 00000 n
+0000148370 00000 n
+0000148527 00000 n
+0000148632 00000 n
+0000148737 00000 n
+0000148848 00000 n
+0000148963 00000 n
+0000149083 00000 n
+0000149241 00000 n
+0000149338 00000 n
+0000149500 00000 n
+0000149600 00000 n
+0000149718 00000 n
+0000149873 00000 n
+0000149974 00000 n
+0000150094 00000 n
+0000150267 00000 n
+0000150370 00000 n
+0000150494 00000 n
+0000150617 00000 n
+0000150739 00000 n
+0000150882 00000 n
+0000151007 00000 n
+0000151117 00000 n
+0000151248 00000 n
+0000151363 00000 n
+0000151494 00000 n
+0000151606 00000 n
+0000151716 00000 n
+0000151845 00000 n
+0000151946 00000 n
+0000152045 00000 n
+0000152160 00000 n
+0000152280 00000 n
+0000152386 00000 n
+0000152492 00000 n
+0000152670 00000 n
+0000152774 00000 n
+0000152906 00000 n
+0000153079 00000 n
+0000153192 00000 n
+0000153352 00000 n
+0000153489 00000 n
+0000153628 00000 n
+0000153750 00000 n
+0000153923 00000 n
+0000154027 00000 n
+0000154133 00000 n
+0000154308 00000 n
+0000154412 00000 n
+0000154528 00000 n
+0000154661 00000 n
+0000154794 00000 n
+0000154930 00000 n
+0000155045 00000 n
+0000155160 00000 n
+0000155275 00000 n
+0000155390 00000 n
+0000155505 00000 n
+0000155624 00000 n
+0000155745 00000 n
+0000155871 00000 n
+0000155989 00000 n
+0000156107 00000 n
+0000156223 00000 n
+0000156338 00000 n
+0000156456 00000 n
+0000156574 00000 n
+0000156692 00000 n
+0000156805 00000 n
+0000156922 00000 n
+0000157041 00000 n
+0000157155 00000 n
+0000157271 00000 n
+0000157388 00000 n
+0000157499 00000 n
+0000157635 00000 n
+0000157767 00000 n
+0000157889 00000 n
+0000158002 00000 n
+0000158159 00000 n
+0000158276 00000 n
+0000158407 00000 n
+0000158564 00000 n
+0000158662 00000 n
+0000158789 00000 n
+0000158889 00000 n
+0000159005 00000 n
+0000159119 00000 n
+0000159259 00000 n
+0000159403 00000 n
+0000159563 00000 n
+0000159692 00000 n
+0000159798 00000 n
+0000159927 00000 n
+0000160031 00000 n
+0000160144 00000 n
+0000160306 00000 n
+0000160410 00000 n
+0000160535 00000 n
+0000160702 00000 n
+0000160811 00000 n
+0000160920 00000 n
+0000161083 00000 n
+0000161192 00000 n
+0000161299 00000 n
+0000161431 00000 n
+0000161572 00000 n
+0000161696 00000 n
+0000161817 00000 n
+0000161938 00000 n
+0000162054 00000 n
+0000162171 00000 n
+0000162317 00000 n
+0000162436 00000 n
+0000162566 00000 n
+0000162694 00000 n
+0000162824 00000 n
+0000162926 00000 n
+0000163029 00000 n
+0000163147 00000 n
+0000017947 00000 n
+trailer
+<]>>
+startxref
+0
+%%EOF
+
+79050 0 obj<>stream
+xÚì½gX×7