Merge pull request #283 from Yangyuanxin/master
add BearPi STemWin test demo
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,817 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
|
||||
|
||||
<SchemaVersion>2.1</SchemaVersion>
|
||||
|
||||
<Header>### uVision Project, (C) Keil Software</Header>
|
||||
|
||||
<Targets>
|
||||
<Target>
|
||||
<TargetName>TencentOS_tiny</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060750::V5.06 update 6 (build 750)::ARMCC</pCCUsed>
|
||||
<uAC6>0</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>STM32L431RCTx</Device>
|
||||
<Vendor>STMicroelectronics</Vendor>
|
||||
<PackID>Keil.STM32L4xx_DFP.2.1.0</PackID>
|
||||
<PackURL>http://www.keil.com/pack</PackURL>
|
||||
<Cpu>IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4")</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
<StartupFile></StartupFile>
|
||||
<FlashDriverDll></FlashDriverDll>
|
||||
<DeviceId></DeviceId>
|
||||
<RegisterFile></RegisterFile>
|
||||
<MemoryEnv></MemoryEnv>
|
||||
<Cmp></Cmp>
|
||||
<Asm></Asm>
|
||||
<Linker></Linker>
|
||||
<OHString></OHString>
|
||||
<InfinionOptionDll></InfinionOptionDll>
|
||||
<SLE66CMisc></SLE66CMisc>
|
||||
<SLE66AMisc></SLE66AMisc>
|
||||
<SLE66LinkerMisc></SLE66LinkerMisc>
|
||||
<SFDFile>$$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd</SFDFile>
|
||||
<bCustSvd>0</bCustSvd>
|
||||
<UseEnv>0</UseEnv>
|
||||
<BinPath></BinPath>
|
||||
<IncludePath></IncludePath>
|
||||
<LibPath></LibPath>
|
||||
<RegisterFilePath></RegisterFilePath>
|
||||
<DBRegisterFilePath></DBRegisterFilePath>
|
||||
<TargetStatus>
|
||||
<Error>0</Error>
|
||||
<ExitCodeStop>0</ExitCodeStop>
|
||||
<ButtonStop>0</ButtonStop>
|
||||
<NotGenerated>0</NotGenerated>
|
||||
<InvalidFlash>1</InvalidFlash>
|
||||
</TargetStatus>
|
||||
<OutputDirectory>.\obj\</OutputDirectory>
|
||||
<OutputName>TencentOS_tiny</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>0</BrowseInformation>
|
||||
<ListingPath>.\list\</ListingPath>
|
||||
<HexFormatSelection>1</HexFormatSelection>
|
||||
<Merge32K>0</Merge32K>
|
||||
<CreateBatchFile>0</CreateBatchFile>
|
||||
<BeforeCompile>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopU1X>0</nStopU1X>
|
||||
<nStopU2X>0</nStopU2X>
|
||||
</BeforeCompile>
|
||||
<BeforeMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopB1X>0</nStopB1X>
|
||||
<nStopB2X>0</nStopB2X>
|
||||
</BeforeMake>
|
||||
<AfterMake>
|
||||
<RunUserProg1>0</RunUserProg1>
|
||||
<RunUserProg2>0</RunUserProg2>
|
||||
<UserProg1Name></UserProg1Name>
|
||||
<UserProg2Name></UserProg2Name>
|
||||
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
|
||||
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
|
||||
<nStopA1X>0</nStopA1X>
|
||||
<nStopA2X>0</nStopA2X>
|
||||
</AfterMake>
|
||||
<SelectedForBatchBuild>0</SelectedForBatchBuild>
|
||||
<SVCSIdString></SVCSIdString>
|
||||
</TargetCommonOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>0</UseCPPCompiler>
|
||||
<RVCTCodeConst>0</RVCTCodeConst>
|
||||
<RVCTZI>0</RVCTZI>
|
||||
<RVCTOtherData>0</RVCTOtherData>
|
||||
<ModuleSelection>0</ModuleSelection>
|
||||
<IncludeInBuild>1</IncludeInBuild>
|
||||
<AlwaysBuild>0</AlwaysBuild>
|
||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
||||
<PublicsOnly>0</PublicsOnly>
|
||||
<StopOnExitCode>3</StopOnExitCode>
|
||||
<CustomArgument></CustomArgument>
|
||||
<IncludeLibraryModules></IncludeLibraryModules>
|
||||
<ComprImg>0</ComprImg>
|
||||
</CommonProperty>
|
||||
<DllOption>
|
||||
<SimDllName>SARMCM3.DLL</SimDllName>
|
||||
<SimDllArguments>-REMAP -MPU</SimDllArguments>
|
||||
<SimDlgDll>DCM.DLL</SimDlgDll>
|
||||
<SimDlgDllArguments>-pCM4</SimDlgDllArguments>
|
||||
<TargetDllName>SARMCM3.DLL</TargetDllName>
|
||||
<TargetDllArguments>-MPU</TargetDllArguments>
|
||||
<TargetDlgDll>TCM.DLL</TargetDlgDll>
|
||||
<TargetDlgDllArguments>-pCM4</TargetDlgDllArguments>
|
||||
</DllOption>
|
||||
<DebugOption>
|
||||
<OPTHX>
|
||||
<HexSelection>1</HexSelection>
|
||||
<HexRangeLowAddress>0</HexRangeLowAddress>
|
||||
<HexRangeHighAddress>0</HexRangeHighAddress>
|
||||
<HexOffset>0</HexOffset>
|
||||
<Oh166RecLen>16</Oh166RecLen>
|
||||
</OPTHX>
|
||||
</DebugOption>
|
||||
<Utilities>
|
||||
<Flash1>
|
||||
<UseTargetDll>1</UseTargetDll>
|
||||
<UseExternalTool>0</UseExternalTool>
|
||||
<RunIndependent>0</RunIndependent>
|
||||
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
|
||||
<Capability>1</Capability>
|
||||
<DriverSelection>4107</DriverSelection>
|
||||
</Flash1>
|
||||
<bUseTDR>1</bUseTDR>
|
||||
<Flash2>BIN\UL2CM3.DLL</Flash2>
|
||||
<Flash3></Flash3>
|
||||
<Flash4></Flash4>
|
||||
<pFcarmOut></pFcarmOut>
|
||||
<pFcarmGrp></pFcarmGrp>
|
||||
<pFcArmRoot></pFcArmRoot>
|
||||
<FcArmLst>0</FcArmLst>
|
||||
</Utilities>
|
||||
<TargetArmAds>
|
||||
<ArmAdsMisc>
|
||||
<GenerateListings>0</GenerateListings>
|
||||
<asHll>1</asHll>
|
||||
<asAsm>1</asAsm>
|
||||
<asMacX>1</asMacX>
|
||||
<asSyms>1</asSyms>
|
||||
<asFals>1</asFals>
|
||||
<asDbgD>1</asDbgD>
|
||||
<asForm>1</asForm>
|
||||
<ldLst>0</ldLst>
|
||||
<ldmm>1</ldmm>
|
||||
<ldXref>1</ldXref>
|
||||
<BigEnd>0</BigEnd>
|
||||
<AdsALst>1</AdsALst>
|
||||
<AdsACrf>1</AdsACrf>
|
||||
<AdsANop>0</AdsANop>
|
||||
<AdsANot>0</AdsANot>
|
||||
<AdsLLst>1</AdsLLst>
|
||||
<AdsLmap>1</AdsLmap>
|
||||
<AdsLcgr>1</AdsLcgr>
|
||||
<AdsLsym>1</AdsLsym>
|
||||
<AdsLszi>1</AdsLszi>
|
||||
<AdsLtoi>1</AdsLtoi>
|
||||
<AdsLsun>1</AdsLsun>
|
||||
<AdsLven>1</AdsLven>
|
||||
<AdsLsxf>1</AdsLsxf>
|
||||
<RvctClst>0</RvctClst>
|
||||
<GenPPlst>0</GenPPlst>
|
||||
<AdsCpuType>"Cortex-M4"</AdsCpuType>
|
||||
<RvctDeviceName></RvctDeviceName>
|
||||
<mOS>0</mOS>
|
||||
<uocRom>0</uocRom>
|
||||
<uocRam>0</uocRam>
|
||||
<hadIROM>1</hadIROM>
|
||||
<hadIRAM>1</hadIRAM>
|
||||
<hadXRAM>0</hadXRAM>
|
||||
<uocXRam>0</uocXRam>
|
||||
<RvdsVP>2</RvdsVP>
|
||||
<RvdsMve>0</RvdsMve>
|
||||
<hadIRAM2>0</hadIRAM2>
|
||||
<hadIROM2>0</hadIROM2>
|
||||
<StupSel>8</StupSel>
|
||||
<useUlib>1</useUlib>
|
||||
<EndSel>0</EndSel>
|
||||
<uLtcg>0</uLtcg>
|
||||
<nSecure>0</nSecure>
|
||||
<RoSelD>3</RoSelD>
|
||||
<RwSelD>3</RwSelD>
|
||||
<CodeSel>0</CodeSel>
|
||||
<OptFeed>0</OptFeed>
|
||||
<NoZi1>0</NoZi1>
|
||||
<NoZi2>0</NoZi2>
|
||||
<NoZi3>0</NoZi3>
|
||||
<NoZi4>0</NoZi4>
|
||||
<NoZi5>0</NoZi5>
|
||||
<Ro1Chk>0</Ro1Chk>
|
||||
<Ro2Chk>0</Ro2Chk>
|
||||
<Ro3Chk>0</Ro3Chk>
|
||||
<Ir1Chk>1</Ir1Chk>
|
||||
<Ir2Chk>0</Ir2Chk>
|
||||
<Ra1Chk>0</Ra1Chk>
|
||||
<Ra2Chk>0</Ra2Chk>
|
||||
<Ra3Chk>0</Ra3Chk>
|
||||
<Im1Chk>1</Im1Chk>
|
||||
<Im2Chk>0</Im2Chk>
|
||||
<OnChipMemories>
|
||||
<Ocm1>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm1>
|
||||
<Ocm2>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm2>
|
||||
<Ocm3>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm3>
|
||||
<Ocm4>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm4>
|
||||
<Ocm5>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm5>
|
||||
<Ocm6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</Ocm6>
|
||||
<IRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x10000</Size>
|
||||
</IRAM>
|
||||
<IROM>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</IROM>
|
||||
<XRAM>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</XRAM>
|
||||
<OCR_RVCT1>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT1>
|
||||
<OCR_RVCT2>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT2>
|
||||
<OCR_RVCT3>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT3>
|
||||
<OCR_RVCT4>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x8000000</StartAddress>
|
||||
<Size>0x40000</Size>
|
||||
</OCR_RVCT4>
|
||||
<OCR_RVCT5>
|
||||
<Type>1</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT5>
|
||||
<OCR_RVCT6>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT6>
|
||||
<OCR_RVCT7>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT7>
|
||||
<OCR_RVCT8>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT8>
|
||||
<OCR_RVCT9>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x20000000</StartAddress>
|
||||
<Size>0x10000</Size>
|
||||
</OCR_RVCT9>
|
||||
<OCR_RVCT10>
|
||||
<Type>0</Type>
|
||||
<StartAddress>0x0</StartAddress>
|
||||
<Size>0x0</Size>
|
||||
</OCR_RVCT10>
|
||||
</OnChipMemories>
|
||||
<RvctStartVector></RvctStartVector>
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
<Strict>0</Strict>
|
||||
<EnumInt>0</EnumInt>
|
||||
<PlainCh>0</PlainCh>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<wLevel>2</wLevel>
|
||||
<uThumb>0</uThumb>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>1</v6Lang>
|
||||
<v6LangP>1</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define>USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\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</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
<interw>1</interw>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<thumb>0</thumb>
|
||||
<SplitLS>0</SplitLS>
|
||||
<SwStkChk>0</SwStkChk>
|
||||
<NoWarn>0</NoWarn>
|
||||
<uSurpInc>0</uSurpInc>
|
||||
<useXO>0</useXO>
|
||||
<uClangAs>0</uClangAs>
|
||||
<VariousControls>
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath></IncludePath>
|
||||
</VariousControls>
|
||||
</Aads>
|
||||
<LDads>
|
||||
<umfTarg>1</umfTarg>
|
||||
<Ropi>0</Ropi>
|
||||
<Rwpi>0</Rwpi>
|
||||
<noStLib>0</noStLib>
|
||||
<RepFail>1</RepFail>
|
||||
<useFile>0</useFile>
|
||||
<TextAddressRange>0x08000000</TextAddressRange>
|
||||
<DataAddressRange>0x20000000</DataAddressRange>
|
||||
<pXoBase></pXoBase>
|
||||
<ScatterFile></ScatterFile>
|
||||
<IncludeLibs></IncludeLibs>
|
||||
<IncludeLibsPath></IncludeLibsPath>
|
||||
<Misc></Misc>
|
||||
<LinkerInputFile></LinkerInputFile>
|
||||
<DisabledWarnings></DisabledWarnings>
|
||||
</LDads>
|
||||
</TargetArmAds>
|
||||
</TargetOption>
|
||||
<Groups>
|
||||
<Group>
|
||||
<GroupName>Application/MDK-ARM</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>startup_stm32l431xx.s</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>startup_stm32l431xx.s</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Application/User</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>gpio.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\gpio.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>main.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>mcu_init.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\mcu_init.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_msp.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\stm32l4xx_hal_msp.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_it.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\stm32l4xx_it.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>usart.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\usart.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>adc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\adc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>i2c.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\i2c.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>spi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\spi.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>examples</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>tos_stemwin_gui_test_demo.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\examples\stemwin_gui_demo\tos_stemwin_gui_test_demo.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Drivers/STM32L4xx_HAL_Driver</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_tim.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_tim_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_uart.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_uart_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_i2c.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_i2c_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_rcc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_rcc_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_flash.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_flash_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_flash_ramfunc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_gpio.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_dma.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_dma_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_pwr.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_pwr_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_cortex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_adc_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_adc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_dac.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_dac_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_spi.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>stm32l4xx_hal_spi_ex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Drivers/CMSIS</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>system_stm32l4xx.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Src\system_stm32l4xx.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>Hardware</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>BH1750.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Hardware\BH1750\BH1750.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>lcd_spi2_drv.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\BSP\Hardware\LCD_ST7789\lcd_spi2_drv.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>kernel</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>tos_mmblk.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_mmblk.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_mmheap.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_mmheap.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_mutex.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_mutex.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_sched.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_sched.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_sem.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_sem.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_sys.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_sys.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_task.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_task.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_tick.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_tick.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_time.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_time.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_timer.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_timer.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_event.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_event.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_global.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_global.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_pend.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_pend.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_robin.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_robin.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_binary_heap.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_binary_heap.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_char_fifo.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_char_fifo.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_completion.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_completion.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_countdownlatch.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_countdownlatch.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_mail_queue.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_mail_queue.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_message_queue.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_message_queue.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_priority_mail_queue.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_priority_mail_queue.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_priority_message_queue.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_priority_message_queue.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_priority_queue.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_priority_queue.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_ring_queue.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\kernel\core\tos_ring_queue.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>cpu</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>port_s.S</FileName>
|
||||
<FileType>2</FileType>
|
||||
<FilePath>..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>tos_cpu.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>port_c.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>cmsis</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>cmsis_os.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\osal\cmsis_os\cmsis_os.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>config</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>tos_config.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>..\..\TOS-CONFIG\tos_config.h</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>emwin_config</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>GUIConf.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\STemWin_Config\Config\GUIConf.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>GUI_X_TOS.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\STemWin_Config\OS\GUI_X_TOS.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>LCDConf_FlexColor_Template.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\STemWin_Config\Config\LCDConf_FlexColor_Template.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>emwin_lib</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>STemWin532_CM4_Keil.lib</FileName>
|
||||
<FileType>4</FileType>
|
||||
<FilePath>..\..\..\..\components\gui\STemWin\Lib\STemWin532_CM4_Keil.lib</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>::CMSIS</GroupName>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
<RTE>
|
||||
<apis/>
|
||||
<components>
|
||||
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="4.3.0" condition="CMSIS Core">
|
||||
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="4.5.0"/>
|
||||
<targetInfos>
|
||||
<targetInfo name="TencentOS_tiny"/>
|
||||
</targetInfos>
|
||||
</component>
|
||||
</components>
|
||||
<files/>
|
||||
</RTE>
|
||||
|
||||
</Project>
|
@@ -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 */
|
@@ -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 //<2F><><EFBFBD><EFBFBD>EMWIN<49>ڴ<EFBFBD><DAB4><EFBFBD>С
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* 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 ****************************/
|
@@ -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 <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#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) //<2F><>ʹ<EFBFBD>ò<EFBFBD><C3B2><EFBFBD>ϵͳ
|
||||
#endif
|
||||
/*********************************************************************
|
||||
*
|
||||
* Configuration of touch support
|
||||
*/
|
||||
#ifndef GUI_SUPPORT_TOUCH
|
||||
#define GUI_SUPPORT_TOUCH (0) //<2F><><EFBFBD>ò<EFBFBD>֧<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Default font
|
||||
*/
|
||||
#define GUI_DEFAULT_FONT &GUI_Font6x8 //Ĭ<><C4AC>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Configuration of available packages
|
||||
*/
|
||||
//ʹ<><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
#define GUI_SUPPORT_MOUSE (0) /* Support a mouse */
|
||||
//֧<>ִ<EFBFBD><D6B4>ڹ<EFBFBD><DAB9><EFBFBD>
|
||||
#define GUI_WINSUPPORT (1) /* Use window manager */
|
||||
//֧<>ִ洢<D6B4>豸
|
||||
#define GUI_SUPPORT_MEMDEV (1) /* Memory device package available */
|
||||
//ʹ<><CAB9><EFBFBD>豸ָ<E8B1B8><D6B8>
|
||||
#define GUI_SUPPORT_DEVICES (1) /* Enable use of device pointers */
|
||||
|
||||
#endif /* Avoid multiple inclusion */
|
@@ -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 <stddef.h>
|
||||
|
||||
#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)
|
||||
//
|
||||
//<2F><><EFBFBD>Ӵ<EFBFBD><D3B4>㺯<EFBFBD><E3BAAF>
|
||||
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 ****************************/
|
@@ -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 ****************************/
|
@@ -0,0 +1,9 @@
|
||||
#ifndef __LCDCONF_H
|
||||
#define __LCDCONF_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //__LCDCONF_H
|
||||
|
@@ -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
|
||||
//
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>
|
||||
#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 <20><><EFBFBD><EFBFBD><EFBFBD>ֽں<D6BD><DABA><EFBFBD>
|
||||
* @param TxData Ҫ<><D2AA><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @param size <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5>ֽڴ<D6BD>С
|
||||
* @return 0:д<><D0B4><EFBFBD>ɹ<EFBFBD>,<2C><><EFBFBD><EFBFBD>:д<><D0B4>ʧ<EFBFBD><CAA7>
|
||||
*/
|
||||
static uint8_t BearPi_SPI_WriteByte(uint8_t *TxData,uint16_t size)
|
||||
{
|
||||
return HAL_SPI_Transmit(&hspi2,TxData,size,1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LCD<43>ײ<EFBFBD>SPI<50><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD>
|
||||
* @param data <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD>ʼ<EFBFBD><CABC>ַ
|
||||
* @param size <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>
|
||||
* @return none
|
||||
*/
|
||||
static void BearPi_LCD_SPI_Send(uint8_t *data, uint16_t size)
|
||||
{
|
||||
BearPi_SPI_WriteByte(data, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief д<><D0B4><EFBFBD>LCD
|
||||
* @param cmd <20><><EFBFBD><EFBFBD> <20><>Ҫ<EFBFBD><D2AA><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @return none
|
||||
*/
|
||||
static void BearPi_LCD_Write_Cmd(uint8_t cmd)
|
||||
{
|
||||
LCD_WR_RS(0);
|
||||
BearPi_LCD_SPI_Send(&cmd, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief д<><D0B4><EFBFBD>ݵ<EFBFBD>LCD
|
||||
* @param dat <20><><EFBFBD><EFBFBD> <20><>Ҫ<EFBFBD><D2AA><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @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 ****************************/
|
||||
|
@@ -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 ****************************/
|
@@ -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 ****************************/
|
@@ -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 ****************************/
|
@@ -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 ****************************/
|
@@ -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 ****************************/
|
@@ -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;
|
||||
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
static k_mutex_t osMutex ;
|
||||
/*<2A><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>*/
|
||||
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 <stdio.h>
|
||||
void GUI_X_InitOS(void)
|
||||
{
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>*/
|
||||
//osMutex = rt_mutex_create("osMutex", RT_IPC_FLAG_FIFO);
|
||||
//RT_ASSERT(osMutex != RT_NULL);
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
//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);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
tos_mutex_post(&osMutex);
|
||||
}
|
||||
|
||||
void GUI_X_Lock(void)
|
||||
{
|
||||
//osMutexWait(osMutex , osWaitForever) ;
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
tos_mutex_pend(&osMutex);
|
||||
}
|
||||
|
||||
/* Get Task handle */
|
||||
U32 GUI_X_GetTaskId(void)
|
||||
{
|
||||
//return ((U32) osThreadGetId());
|
||||
/*<2A><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD>߳̾<DFB3><CCBE><EFBFBD>*/
|
||||
return (U32) tos_task_curr_task_get();
|
||||
}
|
||||
|
||||
|
||||
void GUI_X_WaitEvent (void)
|
||||
{
|
||||
// osSemaphoreWait(osSemaphore , osWaitForever) ;
|
||||
/*<2A><>ȡ<EFBFBD>ź<EFBFBD><C5BA><EFBFBD>*/
|
||||
tos_sem_pend(&osSemaphore,TOS_TIME_FOREVER);
|
||||
}
|
||||
|
||||
|
||||
void GUI_X_SignalEvent (void)
|
||||
{
|
||||
//osMutexRelease(osSemaphore);
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD>*/
|
||||
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 ****************************/
|
@@ -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
|
||||
; <h> Stack Configuration
|
||||
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
Stack_Size EQU 0x100
|
||||
|
||||
AREA STACK, NOINIT, READWRITE, ALIGN=3
|
||||
Stack_Mem SPACE Stack_Size
|
||||
__initial_sp
|
||||
|
||||
|
||||
; <h> Heap Configuration
|
||||
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
|
||||
; </h>
|
||||
|
||||
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*****
|
96
components/gui/STemWin/Config/GUIConf.c
Normal file
96
components/gui/STemWin/Config/GUIConf.c
Normal file
@@ -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 ****************************/
|
96
components/gui/STemWin/Config/GUIConf.h
Normal file
96
components/gui/STemWin/Config/GUIConf.h
Normal file
@@ -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 */
|
836
components/gui/STemWin/Config/GUIDRV_Template.c
Normal file
836
components/gui/STemWin/Config/GUIDRV_Template.c
Normal file
@@ -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 <stddef.h>
|
||||
|
||||
#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 ****************************/
|
73
components/gui/STemWin/Config/GUIDRV_Template.h
Normal file
73
components/gui/STemWin/Config/GUIDRV_Template.h
Normal file
@@ -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 ****************************/
|
236
components/gui/STemWin/Config/LCDConf_FlexColor_Template.c
Normal file
236
components/gui/STemWin/Config/LCDConf_FlexColor_Template.c
Normal file
@@ -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 ****************************/
|
||||
|
59
components/gui/STemWin/Config/LCDConf_FlexColor_Template.h
Normal file
59
components/gui/STemWin/Config/LCDConf_FlexColor_Template.h
Normal file
@@ -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 ****************************/
|
262
components/gui/STemWin/Config/LCDConf_Lin_Template.c
Normal file
262
components/gui/STemWin/Config/LCDConf_Lin_Template.c
Normal file
@@ -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 ****************************/
|
59
components/gui/STemWin/Config/LCDConf_Lin_Template.h
Normal file
59
components/gui/STemWin/Config/LCDConf_Lin_Template.h
Normal file
@@ -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 ****************************/
|
71
components/gui/STemWin/Config/SIMConf.c
Normal file
71
components/gui/STemWin/Config/SIMConf.c
Normal file
@@ -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 ****************************/
|
111192
components/gui/STemWin/Documentation/STemWin532.pdf
Normal file
111192
components/gui/STemWin/Documentation/STemWin532.pdf
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM0_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM0_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM0_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM0_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM0_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM0_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM0_OS_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM0_OS_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM0_OS_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM0_OS_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM0_OS_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM0_OS_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM3_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM3_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM3_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM3_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM3_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM3_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM3_OS_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM3_OS_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM3_OS_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM3_OS_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM3_OS_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM3_OS_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_GCC_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_GCC_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_IAR_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_IAR_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_Keil_ot.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_Keil_ot.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_GCC_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_GCC_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_IAR_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_IAR_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_Keil_ot.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM4_OS_Keil_ot.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_GCC_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_GCC_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_IAR_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_IAR_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_Keil_ot.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_Keil_ot.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_GCC.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_GCC.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_GCC_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_GCC_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_IAR.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_IAR.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_IAR_ot.a
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_IAR_ot.a
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_Keil.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_Keil.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_Keil_ot.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_CM7_OS_Keil_ot.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Lib/STemWin532_WIN32.lib
Normal file
BIN
components/gui/STemWin/Lib/STemWin532_WIN32.lib
Normal file
Binary file not shown.
123
components/gui/STemWin/OS/GUI_X.c
Normal file
123
components/gui/STemWin/OS/GUI_X.c
Normal file
@@ -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 ****************************/
|
192
components/gui/STemWin/OS/GUI_X_OS.c
Normal file
192
components/gui/STemWin/OS/GUI_X_OS.c
Normal file
@@ -0,0 +1,192 @@
|
||||
/*********************************************************************
|
||||
* 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"
|
||||
|
||||
/* FreeRTOS include files */
|
||||
#include "cmsis_os.h"
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Global data
|
||||
*/
|
||||
static osMutexId osMutex;
|
||||
static osSemaphoreId 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());
|
||||
}
|
||||
|
||||
void GUI_X_Delay(int ms)
|
||||
{
|
||||
vTaskDelay( 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) {}
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* 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 */
|
||||
void GUI_X_InitOS(void)
|
||||
{
|
||||
/* Create Mutex lock */
|
||||
osMutexDef(MUTEX);
|
||||
|
||||
/* Create the Mutex used by the two threads */
|
||||
osMutex = osMutexCreate(osMutex(MUTEX));
|
||||
|
||||
/* Create Semaphore lock */
|
||||
osSemaphoreDef(SEM);
|
||||
|
||||
/* Create the Semaphore used by the two threads */
|
||||
osSemaphore= osSemaphoreCreate(osSemaphore(SEM), 1);
|
||||
}
|
||||
|
||||
void GUI_X_Unlock(void)
|
||||
{
|
||||
osMutexRelease(osMutex);
|
||||
}
|
||||
|
||||
void GUI_X_Lock(void)
|
||||
{
|
||||
osMutexWait(osMutex , osWaitForever) ;
|
||||
}
|
||||
|
||||
/* Get Task handle */
|
||||
U32 GUI_X_GetTaskId(void)
|
||||
{
|
||||
return ((U32) osThreadGetId());
|
||||
}
|
||||
|
||||
|
||||
void GUI_X_WaitEvent (void)
|
||||
{
|
||||
osSemaphoreWait(osSemaphore , osWaitForever) ;
|
||||
}
|
||||
|
||||
|
||||
void GUI_X_SignalEvent (void)
|
||||
{
|
||||
osMutexRelease(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 ****************************/
|
1068
components/gui/STemWin/Release_Notes.html
Normal file
1068
components/gui/STemWin/Release_Notes.html
Normal file
File diff suppressed because it is too large
Load Diff
BIN
components/gui/STemWin/Simulation/GUISim.lib
Normal file
BIN
components/gui/STemWin/Simulation/GUISim.lib
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Simulation/SimulationMinGW.res
Normal file
BIN
components/gui/STemWin/Simulation/SimulationMinGW.res
Normal file
Binary file not shown.
75
components/gui/STemWin/Simulation/WinMain.c
Normal file
75
components/gui/STemWin/Simulation/WinMain.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*********************************************************************
|
||||
* 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
|
||||
|
||||
----------------------------------------------------------------------
|
||||
File : WinMain.c
|
||||
---------------------------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 <windows.h>
|
||||
|
||||
#include "GUI_SIM_Win32.h"
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public data
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public code
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
/*********************************************************************
|
||||
*
|
||||
* WinMain
|
||||
*/
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
|
||||
return SIM_GUI_App(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
|
||||
}
|
||||
|
||||
/*************************** End of file ****************************/
|
BIN
components/gui/STemWin/Software/BmpCvtST.exe
Normal file
BIN
components/gui/STemWin/Software/BmpCvtST.exe
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Software/FontCvtST.exe
Normal file
BIN
components/gui/STemWin/Software/FontCvtST.exe
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Software/GUIBuilder.exe
Normal file
BIN
components/gui/STemWin/Software/GUIBuilder.exe
Normal file
Binary file not shown.
BIN
components/gui/STemWin/Software/JPEG2Movie.exe
Normal file
BIN
components/gui/STemWin/Software/JPEG2Movie.exe
Normal file
Binary file not shown.
21
components/gui/STemWin/Software/JPEG2MovieScripts/120x68.bat
Normal file
21
components/gui/STemWin/Software/JPEG2MovieScripts/120x68.bat
Normal file
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
21
components/gui/STemWin/Software/JPEG2MovieScripts/160x90.bat
Normal file
21
components/gui/STemWin/Software/JPEG2MovieScripts/160x90.bat
Normal file
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
21
components/gui/STemWin/Software/JPEG2MovieScripts/80x45.bat
Normal file
21
components/gui/STemWin/Software/JPEG2MovieScripts/80x45.bat
Normal file
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
21
components/gui/STemWin/Software/JPEG2MovieScripts/80x60.bat
Normal file
21
components/gui/STemWin/Software/JPEG2MovieScripts/80x60.bat
Normal file
@@ -0,0 +1,21 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: <X_SIZE>x<Y_SIZE>.bat
|
||||
*
|
||||
* Purpose: This file simply calls MakeMovie.bat with its own file name
|
||||
* as parameter %2 which defines the resolution used by FFmpeg
|
||||
* to create the JPEG files.
|
||||
* By copying and renaming this file further resolutions can
|
||||
* be simply achieved.
|
||||
*
|
||||
* Note: The file name of this file needs to match the size
|
||||
* specification parameter '-s' for FFmpeg.exe.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
@%~dp0MakeMovie.bat %1 %~n0
|
@@ -0,0 +1,83 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: MakeMovie.bat
|
||||
*
|
||||
* Parameters: 4 (3 optional)
|
||||
* %1: Movie file to be converted
|
||||
* %2: Size
|
||||
* %3: Quality
|
||||
* %4: Framerate
|
||||
*
|
||||
* Requirement: The free available tool FFmpeg is required for the conversion
|
||||
* operation. FFmpeg is available under the following link:
|
||||
*
|
||||
* http://www.ffmpeg.org/
|
||||
*
|
||||
* Please note that Prep.bat needs to be adapted before using
|
||||
* MakeMovie.bat.
|
||||
*
|
||||
* This file (MakeMovie.bat) normally do not need to be modified.
|
||||
*
|
||||
* Purpose: This batch file converts a video file to an (E)mWin (M)ovie (F)ile.
|
||||
* It first uses FFmpeg for converting the given movie into single
|
||||
* JPEG files. After that the emWin tool JPEG2Movie is used to
|
||||
* convert these images into an emWin movie file.
|
||||
*
|
||||
* For details about all supported file types and the parameters
|
||||
* resolution, quality and frame rate please refer to the FFmpeg
|
||||
* documentation.
|
||||
*
|
||||
* Output: A copy of the converted file will be copied into the folder of
|
||||
* the source file. The file name will be the same as the source file
|
||||
* with a size postfix and the extension '.emf' (emWin movie file).
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
CALL %~dp0PREP.BAT
|
||||
|
||||
IF "%2" == "" GOTO CONT2
|
||||
SET SIZE=%2
|
||||
GOTO NEXT2
|
||||
:CONT2
|
||||
SET SIZE=%DEFAULT_SIZE%
|
||||
:NEXT2
|
||||
|
||||
IF "%3" == "" GOTO CONT3
|
||||
SET QUALITY=%3
|
||||
GOTO NEXT3
|
||||
:CONT3
|
||||
SET QUALITY=%DEFAULT_QUALITY%
|
||||
:NEXT3
|
||||
|
||||
IF "%4" == "" GOTO CONT4
|
||||
SET FRAMERATE=%4
|
||||
GOTO NEXT4
|
||||
:CONT4
|
||||
SET FRAMERATE=%DEFAULT_FRAMERATE%
|
||||
:NEXT4
|
||||
|
||||
DEL /Q "%OUTPUT%*.*"
|
||||
|
||||
"%FFMPEG%" -y -i %1 -r %FRAMERATE% -q %QUALITY% -s %SIZE% -f image2 -pix_fmt yuvj420p "%OUTPUT%img-%%05d.jpeg"
|
||||
|
||||
"%JPEG2MOVIE%" "%OUTPUT%"
|
||||
IF ERRORLEVEL 1 GOTO ERROR
|
||||
GOTO NOERROR
|
||||
:ERROR
|
||||
ECHO Error using JPEG2Movie!
|
||||
PAUSE
|
||||
:NOERROR
|
||||
|
||||
COPY /B %OUTPUT%*.emf %~dp1%~n1_%SIZE%.emf
|
||||
|
||||
SET SIZE=
|
||||
SET QUALITY=
|
||||
SET FRAMERATE=
|
||||
SET FOLDER=
|
||||
SET FFMPEG=
|
||||
SET JPEG2MOVIE=
|
50
components/gui/STemWin/Software/JPEG2MovieScripts/Prep.bat
Normal file
50
components/gui/STemWin/Software/JPEG2MovieScripts/Prep.bat
Normal file
@@ -0,0 +1,50 @@
|
||||
@ECHO OFF
|
||||
GOTO START
|
||||
|
||||
******************************************************************************
|
||||
*
|
||||
* File: Prep.bat
|
||||
*
|
||||
* Parameters: none
|
||||
*
|
||||
* Purpose: This batch file is called by MakeMovie.bat and sets the default
|
||||
* values for working folder, FFmpeg and JPEG2MOVIE path. It needs
|
||||
* to be adapted before MakeMovie.bat can be used.
|
||||
*
|
||||
******************************************************************************
|
||||
|
||||
:START
|
||||
|
||||
REM **************************************************************************
|
||||
REM
|
||||
REM Configuration: Default values for size, quality and framerate
|
||||
REM
|
||||
REM **************************************************************************
|
||||
|
||||
SET DEFAULT_SIZE=320x240
|
||||
SET DEFAULT_QUALITY=5
|
||||
SET DEFAULT_FRAMERATE=25
|
||||
|
||||
REM **************************************************************************
|
||||
REM
|
||||
REM Configuration: Working folder
|
||||
REM
|
||||
REM **************************************************************************
|
||||
|
||||
SET OUTPUT=C:\Movie\Output\
|
||||
|
||||
REM **************************************************************************
|
||||
REM
|
||||
REM Configuration: FFmpeg
|
||||
REM
|
||||
REM **************************************************************************
|
||||
|
||||
SET FFMPEG=C:\FFmpeg\ffmpeg.exe
|
||||
|
||||
REM **************************************************************************
|
||||
REM
|
||||
REM Configuration: JPEG2Movie
|
||||
REM
|
||||
REM **************************************************************************
|
||||
|
||||
SET JPEG2MOVIE=C:\Movie\JPEG2Movie.exe
|
BIN
components/gui/STemWin/Software/emVNC.exe
Normal file
BIN
components/gui/STemWin/Software/emVNC.exe
Normal file
Binary file not shown.
224
components/gui/STemWin/inc/BUTTON.h
Normal file
224
components/gui/STemWin/inc/BUTTON.h
Normal file
@@ -0,0 +1,224 @@
|
||||
/*********************************************************************
|
||||
* 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 : BUTTON.h
|
||||
Purpose : BUTTON public header file (API)
|
||||
--------------------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 BUTTON_H
|
||||
#define BUTTON_H
|
||||
|
||||
#include "WM.h"
|
||||
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
|
||||
#include "WIDGET.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { /* Make sure we have C-declarations in C++ programs */
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Create flags
|
||||
*/
|
||||
/* For compatibility only ! */
|
||||
#define BUTTON_CF_HIDE WM_CF_HIDE
|
||||
#define BUTTON_CF_SHOW WM_CF_SHOW
|
||||
#define BUTTON_CF_MEMDEV WM_CF_MEMDEV
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Color indices
|
||||
*/
|
||||
#define BUTTON_CI_UNPRESSED 0
|
||||
#define BUTTON_CI_PRESSED 1
|
||||
#define BUTTON_CI_DISABLED 2
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Bitmap indices
|
||||
*/
|
||||
#define BUTTON_BI_UNPRESSED 0
|
||||
#define BUTTON_BI_PRESSED 1
|
||||
#define BUTTON_BI_DISABLED 2
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* States
|
||||
*/
|
||||
#define BUTTON_STATE_FOCUS WIDGET_STATE_FOCUS
|
||||
#define BUTTON_STATE_PRESSED WIDGET_STATE_USER0
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Skinning property indices
|
||||
*/
|
||||
#define BUTTON_SKINFLEX_PI_PRESSED 0
|
||||
#define BUTTON_SKINFLEX_PI_FOCUSSED 1
|
||||
#define BUTTON_SKINFLEX_PI_ENABLED 2
|
||||
#define BUTTON_SKINFLEX_PI_DISABLED 3
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef WM_HMEM BUTTON_Handle;
|
||||
|
||||
typedef struct {
|
||||
GUI_COLOR aColorFrame[3];
|
||||
GUI_COLOR aColorUpper[2];
|
||||
GUI_COLOR aColorLower[2];
|
||||
int Radius;
|
||||
} BUTTON_SKINFLEX_PROPS;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Create function(s)
|
||||
|
||||
Note: the parameters to a create function may vary.
|
||||
Some widgets may have multiple create functions
|
||||
*/
|
||||
|
||||
BUTTON_Handle BUTTON_Create (int x0, int y0, int xSize, int ySize, int ID, int Flags);
|
||||
BUTTON_Handle BUTTON_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags);
|
||||
BUTTON_Handle BUTTON_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
|
||||
BUTTON_Handle BUTTON_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
|
||||
BUTTON_Handle BUTTON_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Managing default values
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
GUI_COLOR BUTTON_GetDefaultBkColor (unsigned Index);
|
||||
const GUI_FONT * BUTTON_GetDefaultFont (void);
|
||||
int BUTTON_GetDefaultTextAlign (void);
|
||||
GUI_COLOR BUTTON_GetDefaultTextColor (unsigned Index);
|
||||
void BUTTON_SetDefaultBkColor (GUI_COLOR Color, unsigned Index);
|
||||
GUI_COLOR BUTTON_SetDefaultFocusColor(GUI_COLOR Color);
|
||||
void BUTTON_SetDefaultFont (const GUI_FONT * pFont);
|
||||
void BUTTON_SetDefaultTextAlign (int Align);
|
||||
void BUTTON_SetDefaultTextColor (GUI_COLOR Color, unsigned Index);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* The callback ...
|
||||
*
|
||||
* Do not call it directly ! It is only to be used from within an
|
||||
* overwritten callback.
|
||||
*/
|
||||
void BUTTON_Callback(WM_MESSAGE *pMsg);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Member functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
GUI_COLOR BUTTON_GetBkColor (BUTTON_Handle hObj, unsigned int Index);
|
||||
const GUI_BITMAP * BUTTON_GetBitmap(BUTTON_Handle hObj,unsigned int Index);
|
||||
const GUI_FONT * BUTTON_GetFont (BUTTON_Handle hObj);
|
||||
GUI_COLOR BUTTON_GetFrameColor (BUTTON_Handle hObj);
|
||||
WIDGET * BUTTON_GetpWidget (BUTTON_Handle hObj);
|
||||
void BUTTON_GetText (BUTTON_Handle hObj, char * pBuffer, int MaxLen);
|
||||
GUI_COLOR BUTTON_GetTextColor (BUTTON_Handle hObj, unsigned int Index);
|
||||
int BUTTON_GetTextAlign (BUTTON_Handle hObj);
|
||||
int BUTTON_GetUserData (BUTTON_Handle hObj, void * pDest, int NumBytes);
|
||||
unsigned BUTTON_IsPressed (BUTTON_Handle hObj);
|
||||
void BUTTON_SetBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap);
|
||||
void BUTTON_SetBitmapEx (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap, int x, int y);
|
||||
void BUTTON_SetBkColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color);
|
||||
void BUTTON_SetBMP (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap);
|
||||
void BUTTON_SetBMPEx (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap, int x, int y);
|
||||
void BUTTON_SetFont (BUTTON_Handle hObj, const GUI_FONT * pfont);
|
||||
void BUTTON_SetFrameColor (BUTTON_Handle hObj, GUI_COLOR Color);
|
||||
void BUTTON_SetState (BUTTON_Handle hObj, int State); /* Not to be doc. */
|
||||
void BUTTON_SetPressed (BUTTON_Handle hObj, int State);
|
||||
GUI_COLOR BUTTON_SetFocusColor (BUTTON_Handle hObj, GUI_COLOR Color);
|
||||
void BUTTON_SetFocussable (BUTTON_Handle hObj, int State);
|
||||
void BUTTON_SetStreamedBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap);
|
||||
void BUTTON_SetStreamedBitmapEx(BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap, int x, int y);
|
||||
int BUTTON_SetText (BUTTON_Handle hObj, const char* s);
|
||||
void BUTTON_SetTextAlign (BUTTON_Handle hObj, int Align);
|
||||
void BUTTON_SetTextColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color);
|
||||
void BUTTON_SetTextOffset (BUTTON_Handle hObj, int xPos, int yPos);
|
||||
void BUTTON_SetSelfDrawEx (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw, int x, int y); /* Not to be doc. */
|
||||
void BUTTON_SetSelfDraw (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw); /* Not to be doc. */
|
||||
void BUTTON_SetReactOnLevel (void);
|
||||
void BUTTON_SetReactOnTouch (void);
|
||||
int BUTTON_SetUserData (BUTTON_Handle hObj, const void * pSrc, int NumBytes);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Member functions: Skinning
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
void BUTTON_GetSkinFlexProps (BUTTON_SKINFLEX_PROPS * pProps, int Index);
|
||||
void BUTTON_SetSkinClassic (BUTTON_Handle hObj);
|
||||
void BUTTON_SetSkin (BUTTON_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
|
||||
int BUTTON_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
|
||||
void BUTTON_SetSkinFlexProps (const BUTTON_SKINFLEX_PROPS * pProps, int Index);
|
||||
void BUTTON_SetDefaultSkinClassic(void);
|
||||
WIDGET_DRAW_ITEM_FUNC * BUTTON_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
|
||||
|
||||
#define BUTTON_SKIN_FLEX BUTTON_DrawSkinFlex
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // BUTTON_H
|
||||
|
||||
/*************************** End of file ****************************/
|
146
components/gui/STemWin/inc/BUTTON_Private.h
Normal file
146
components/gui/STemWin/inc/BUTTON_Private.h
Normal file
@@ -0,0 +1,146 @@
|
||||
/*********************************************************************
|
||||
* 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 : BUTTON_Private.h
|
||||
Purpose : BUTTON private header 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 BUTTON_PRIVATE_H
|
||||
#define BUTTON_PRIVATE_H
|
||||
|
||||
#include "WM.h"
|
||||
#include "BUTTON.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#ifndef BUTTON_3D_MOVE_X
|
||||
#define BUTTON_3D_MOVE_X 1
|
||||
#endif
|
||||
#ifndef BUTTON_3D_MOVE_Y
|
||||
#define BUTTON_3D_MOVE_Y 1
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Object definition
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef struct {
|
||||
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
|
||||
} BUTTON_SKIN_PRIVATE;
|
||||
|
||||
typedef struct {
|
||||
GUI_COLOR aBkColor[3];
|
||||
GUI_COLOR aTextColor[3];
|
||||
GUI_COLOR FocusColor;
|
||||
GUI_COLOR FrameColor;
|
||||
const GUI_FONT * pFont;
|
||||
BUTTON_SKIN_PRIVATE SkinPrivate;
|
||||
I16 Align;
|
||||
I16 xPosText, yPosText;
|
||||
} BUTTON_PROPS;
|
||||
|
||||
typedef struct {
|
||||
WIDGET Widget;
|
||||
BUTTON_PROPS Props;
|
||||
WIDGET_SKIN const * pWidgetSkin;
|
||||
WM_HMEM hpText;
|
||||
WM_HMEM ahDrawObj[3];
|
||||
} BUTTON_Obj;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Macros for internal use
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
|
||||
#define BUTTON_INIT_ID(p) (p->Widget.DebugId = BUTTON_ID)
|
||||
#else
|
||||
#define BUTTON_INIT_ID(p)
|
||||
#endif
|
||||
|
||||
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
|
||||
BUTTON_Obj * BUTTON_LockH(BUTTON_Handle h);
|
||||
#define BUTTON_LOCK_H(h) BUTTON_LockH(h)
|
||||
#else
|
||||
#define BUTTON_LOCK_H(h) (BUTTON_Obj *)GUI_LOCK_H(h)
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public data (internal defaults)
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
extern BUTTON_PROPS BUTTON__DefaultProps;
|
||||
|
||||
extern const WIDGET_SKIN BUTTON__SkinClassic;
|
||||
extern WIDGET_SKIN BUTTON__Skin;
|
||||
|
||||
extern WIDGET_SKIN const * BUTTON__pSkinDefault;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Private functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
void BUTTON__SetDrawObj(BUTTON_Handle hObj, int Index, GUI_DRAW_HANDLE hDrawObj);
|
||||
|
||||
|
||||
#endif /* GUI_WINSUPPORT */
|
||||
#endif /* BUTTON_H */
|
171
components/gui/STemWin/inc/CALENDAR.h
Normal file
171
components/gui/STemWin/inc/CALENDAR.h
Normal file
@@ -0,0 +1,171 @@
|
||||
/*********************************************************************
|
||||
* 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 : CALENDAR.h
|
||||
Purpose : Message box interface
|
||||
--------------------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 CALENDAR_H
|
||||
#define CALENDAR_H
|
||||
|
||||
#include "WM.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { /* Make sure we have C-declarations in C++ programs */
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#define CALENDAR_CI_WEEKEND 0
|
||||
#define CALENDAR_CI_WEEKDAY 1
|
||||
#define CALENDAR_CI_SEL 2
|
||||
|
||||
#define CALENDAR_CI_HEADER 3
|
||||
#define CALENDAR_CI_MONTH 4
|
||||
#define CALENDAR_CI_LABEL 5
|
||||
#define CALENDAR_CI_FRAME 6
|
||||
|
||||
#define CALENDAR_FI_CONTENT 0
|
||||
#define CALENDAR_FI_HEADER 1
|
||||
|
||||
#define CALENDAR_SI_HEADER 0
|
||||
#define CALENDAR_SI_CELL_X 1
|
||||
#define CALENDAR_SI_CELL_Y 2
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Notification codes
|
||||
*
|
||||
* The following is the list of notification codes specific to this widget,
|
||||
* Send with the WM_NOTIFY_PARENT message
|
||||
*/
|
||||
#define CALENDAR_NOTIFICATION_MONTH_CLICKED (WM_NOTIFICATION_WIDGET + 0)
|
||||
#define CALENDAR_NOTIFICATION_MONTH_RELEASED (WM_NOTIFICATION_WIDGET + 1)
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
/*********************************************************************
|
||||
*
|
||||
* CALENDAR_DATE
|
||||
*/
|
||||
typedef struct {
|
||||
int Year;
|
||||
int Month;
|
||||
int Day;
|
||||
} CALENDAR_DATE;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* CALENDAR_SKINFLEX_PROPS
|
||||
*/
|
||||
typedef struct {
|
||||
GUI_COLOR aColorFrame[3]; // Frame colors of buttons
|
||||
GUI_COLOR aColorUpper[2]; // Upper gradient colors of buttons
|
||||
GUI_COLOR aColorLower[2]; // Lower gradient colors of buttons
|
||||
GUI_COLOR ColorArrow; // Arrow colors
|
||||
} CALENDAR_SKINFLEX_PROPS;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public code
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
WM_HWIN CALENDAR_Create (WM_HWIN hParent, int xPos, int yPos, unsigned Year, unsigned Month, unsigned Day, unsigned FirstDayOfWeek, int Id, int Flags);
|
||||
void CALENDAR_GetDate (WM_HWIN hWin, CALENDAR_DATE * pDate);
|
||||
void CALENDAR_GetSel (WM_HWIN hWin, CALENDAR_DATE * pDate);
|
||||
void CALENDAR_SetDate (WM_HWIN hWin, CALENDAR_DATE * pDate);
|
||||
void CALENDAR_SetSel (WM_HWIN hWin, CALENDAR_DATE * pDate);
|
||||
void CALENDAR_ShowDate (WM_HWIN hWin, CALENDAR_DATE * pDate);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Default related
|
||||
*/
|
||||
void CALENDAR_SetDefaultBkColor(unsigned Index, GUI_COLOR Color);
|
||||
void CALENDAR_SetDefaultColor (unsigned Index, GUI_COLOR Color);
|
||||
void CALENDAR_SetDefaultDays (const char ** apDays);
|
||||
void CALENDAR_SetDefaultFont (unsigned Index, const GUI_FONT * pFont);
|
||||
void CALENDAR_SetDefaultMonths (const char ** apMonths);
|
||||
void CALENDAR_SetDefaultSize (unsigned Index, unsigned Size);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Skinning related
|
||||
*/
|
||||
void CALENDAR_GetSkinFlexProps (CALENDAR_SKINFLEX_PROPS * pProps, int Index);
|
||||
void CALENDAR_SetSkinFlexProps (const CALENDAR_SKINFLEX_PROPS * pProps, int Index);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* The callback ...
|
||||
*
|
||||
* Do not call it directly ! It is only to be used from within an
|
||||
* overwritten callback.
|
||||
*/
|
||||
void CALENDAR_Callback(WM_MESSAGE * pMsg);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // CALENDAR_H
|
||||
|
||||
/*************************** End of file ****************************/
|
218
components/gui/STemWin/inc/CHECKBOX.h
Normal file
218
components/gui/STemWin/inc/CHECKBOX.h
Normal file
@@ -0,0 +1,218 @@
|
||||
/*********************************************************************
|
||||
* 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 : CHECKBOX.h
|
||||
Purpose : CHECKBOX include
|
||||
--------------------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 CHECKBOX_H
|
||||
#define CHECKBOX_H
|
||||
|
||||
#include "WM.h"
|
||||
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
|
||||
#include "WIDGET.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { /* Make sure we have C-declarations in C++ programs */
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Color indices
|
||||
*/
|
||||
#define CHECKBOX_CI_DISABLED 0
|
||||
#define CHECKBOX_CI_ENABLED 1
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Bitmap indices
|
||||
*/
|
||||
#define CHECKBOX_BI_INACTIV_UNCHECKED 0
|
||||
#define CHECKBOX_BI_ACTIV_UNCHECKED 1
|
||||
#define CHECKBOX_BI_INACTIV_CHECKED 2
|
||||
#define CHECKBOX_BI_ACTIV_CHECKED 3
|
||||
#define CHECKBOX_BI_INACTIV_3STATE 4
|
||||
#define CHECKBOX_BI_ACTIV_3STATE 5
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Skinning property indices
|
||||
*/
|
||||
#define CHECKBOX_SKINFLEX_PI_ENABLED 0
|
||||
#define CHECKBOX_SKINFLEX_PI_DISABLED 1
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef WM_HMEM CHECKBOX_Handle;
|
||||
|
||||
typedef struct {
|
||||
GUI_COLOR aColorFrame[3];
|
||||
GUI_COLOR aColorInner[2];
|
||||
GUI_COLOR ColorCheck;
|
||||
int ButtonSize;
|
||||
} CHECKBOX_SKINFLEX_PROPS;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Create functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
CHECKBOX_Handle CHECKBOX_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags);
|
||||
CHECKBOX_Handle CHECKBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
|
||||
CHECKBOX_Handle CHECKBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
|
||||
CHECKBOX_Handle CHECKBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* The callback ...
|
||||
*
|
||||
* Do not call it directly ! It is only to be used from within an
|
||||
* overwritten callback.
|
||||
*/
|
||||
void CHECKBOX_Callback(WM_MESSAGE * pMsg);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Managing default values
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
int CHECKBOX_GetDefaultAlign (void);
|
||||
GUI_COLOR CHECKBOX_GetDefaultBkColor (void);
|
||||
const GUI_FONT * CHECKBOX_GetDefaultFont (void);
|
||||
int CHECKBOX_GetDefaultSpacing (void);
|
||||
int CHECKBOX_GetDefaultTextAlign (void);
|
||||
GUI_COLOR CHECKBOX_GetDefaultTextColor (void);
|
||||
int CHECKBOX_GetUserData (CHECKBOX_Handle hObj, void * pDest, int NumBytes);
|
||||
void CHECKBOX_SetDefaultAlign (int Align);
|
||||
void CHECKBOX_SetDefaultBkColor (GUI_COLOR Color);
|
||||
GUI_COLOR CHECKBOX_SetDefaultFocusColor(GUI_COLOR Color);
|
||||
void CHECKBOX_SetDefaultFont (const GUI_FONT * pFont);
|
||||
void CHECKBOX_SetDefaultImage (const GUI_BITMAP * pBitmap, unsigned int Index);
|
||||
void CHECKBOX_SetDefaultSpacing (int Spacing);
|
||||
void CHECKBOX_SetDefaultTextAlign (int Align);
|
||||
void CHECKBOX_SetDefaultTextColor (GUI_COLOR Color);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Member functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
int CHECKBOX_GetState (CHECKBOX_Handle hObj);
|
||||
int CHECKBOX_GetText (CHECKBOX_Handle hObj, char * pBuffer, int MaxLen);
|
||||
int CHECKBOX_IsChecked (CHECKBOX_Handle hObj);
|
||||
void CHECKBOX_SetBkColor (CHECKBOX_Handle hObj, GUI_COLOR Color);
|
||||
GUI_COLOR CHECKBOX_SetBoxBkColor(CHECKBOX_Handle hObj, GUI_COLOR Color, int Index);
|
||||
GUI_COLOR CHECKBOX_SetFocusColor(CHECKBOX_Handle hObj, GUI_COLOR Color);
|
||||
void CHECKBOX_SetFont (CHECKBOX_Handle hObj, const GUI_FONT * pFont);
|
||||
void CHECKBOX_SetImage (CHECKBOX_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index);
|
||||
void CHECKBOX_SetNumStates (CHECKBOX_Handle hObj, unsigned NumStates);
|
||||
void CHECKBOX_SetSpacing (CHECKBOX_Handle hObj, unsigned Spacing);
|
||||
void CHECKBOX_SetState (CHECKBOX_Handle hObj, unsigned State);
|
||||
void CHECKBOX_SetText (CHECKBOX_Handle hObj, const char * pText);
|
||||
void CHECKBOX_SetTextAlign (CHECKBOX_Handle hObj, int Align);
|
||||
void CHECKBOX_SetTextColor (CHECKBOX_Handle hObj, GUI_COLOR Color);
|
||||
int CHECKBOX_SetUserData (CHECKBOX_Handle hObj, const void * pSrc, int NumBytes);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Member functions: Skinning
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
void CHECKBOX_GetSkinFlexProps (CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
|
||||
void CHECKBOX_SetSkinClassic (CHECKBOX_Handle hObj);
|
||||
void CHECKBOX_SetSkin (CHECKBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
|
||||
int CHECKBOX_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
|
||||
void CHECKBOX_SetSkinFlexProps (const CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
|
||||
void CHECKBOX_SetDefaultSkinClassic (void);
|
||||
int CHECKBOX_GetSkinFlexButtonSize (CHECKBOX_Handle hObj);
|
||||
void CHECKBOX_SetSkinFlexButtonSize (CHECKBOX_Handle hObj, int ButtonSize);
|
||||
WIDGET_DRAW_ITEM_FUNC * CHECKBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
|
||||
|
||||
#define CHECKBOX_SKIN_FLEX CHECKBOX_DrawSkinFlex
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Macros for compatibility
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
#define CHECKBOX_Check(hObj) CHECKBOX_SetState(hObj, 1)
|
||||
#define CHECKBOX_Uncheck(hObj) CHECKBOX_SetState(hObj, 0)
|
||||
|
||||
#define CHECKBOX_BI_INACTIV CHECKBOX_BI_INACTIV_CHECKED
|
||||
#define CHECKBOX_BI_ACTIV CHECKBOX_BI_ACTIV_CHECKED
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // CHECKBOX_H
|
||||
|
||||
/*************************** End of file ****************************/
|
173
components/gui/STemWin/inc/CHECKBOX_Private.h
Normal file
173
components/gui/STemWin/inc/CHECKBOX_Private.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/*********************************************************************
|
||||
* 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 : CHECKBOX_Private.h
|
||||
Purpose : CHECKBOX private header 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 CHECKBOX_PRIVATE_H
|
||||
#define CHECKBOX_PRIVATE_H
|
||||
|
||||
#include "WM.h"
|
||||
#include "WIDGET.h"
|
||||
#include "CHECKBOX.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#ifndef CHECKBOX_BKCOLOR0_DEFAULT
|
||||
#define CHECKBOX_BKCOLOR0_DEFAULT 0x808080 /* Inactive color */
|
||||
#endif
|
||||
|
||||
#ifndef CHECKBOX_BKCOLOR1_DEFAULT
|
||||
#define CHECKBOX_BKCOLOR1_DEFAULT GUI_WHITE /* Active color */
|
||||
#endif
|
||||
|
||||
#ifndef CHECKBOX_FGCOLOR0_DEFAULT
|
||||
#define CHECKBOX_FGCOLOR0_DEFAULT 0x101010
|
||||
#endif
|
||||
|
||||
#ifndef CHECKBOX_FGCOLOR1_DEFAULT
|
||||
#define CHECKBOX_FGCOLOR1_DEFAULT GUI_BLACK
|
||||
#endif
|
||||
|
||||
#ifndef CHECKBOX_DEFAULT_SIZE
|
||||
#define CHECKBOX_DEFAULT_SIZE 15
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Object definition
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned (* pfGetButtonSize)(void);
|
||||
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
|
||||
} CHECKBOX_SKIN_PRIVATE;
|
||||
|
||||
typedef struct {
|
||||
const GUI_FONT * pFont;
|
||||
GUI_COLOR aBkColorBox[2]; /* Colors used to draw the box background */
|
||||
GUI_COLOR BkColor; /* Widget background color */
|
||||
GUI_COLOR TextColor;
|
||||
GUI_COLOR FocusColor;
|
||||
CHECKBOX_SKIN_PRIVATE SkinPrivate;
|
||||
I16 Align;
|
||||
U8 Spacing;
|
||||
const GUI_BITMAP * apBm[6];
|
||||
} CHECKBOX_PROPS;
|
||||
|
||||
typedef struct {
|
||||
WIDGET Widget;
|
||||
CHECKBOX_PROPS Props;
|
||||
WIDGET_SKIN const * pWidgetSkin;
|
||||
U8 NumStates;
|
||||
U8 CurrentState;
|
||||
WM_HMEM hpText;
|
||||
U32 ButtonSize;
|
||||
} CHECKBOX_Obj;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Macros for internal use
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
|
||||
#define CHECKBOX_INIT_ID(p) (p->Widget.DebugId = CHECKBOX_ID)
|
||||
#else
|
||||
#define CHECKBOX_INIT_ID(p)
|
||||
#endif
|
||||
|
||||
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
|
||||
CHECKBOX_Obj * CHECKBOX_LockH(CHECKBOX_Handle h);
|
||||
#define CHECKBOX_LOCK_H(h) CHECKBOX_LockH(h)
|
||||
#else
|
||||
#define CHECKBOX_LOCK_H(h) (CHECKBOX_Obj *)GUI_LOCK_H(h)
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Private functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
unsigned CHECKBOX__GetButtonSize(void);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public data (internal defaults)
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
extern CHECKBOX_PROPS CHECKBOX__DefaultProps;
|
||||
|
||||
extern const WIDGET_SKIN CHECKBOX__SkinClassic;
|
||||
extern WIDGET_SKIN CHECKBOX__Skin;
|
||||
|
||||
extern WIDGET_SKIN const * CHECKBOX__pSkinDefault;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Extern data
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
extern const GUI_BITMAP CHECKBOX__abmCheck[2];
|
||||
|
||||
#endif /* GUI_WINSUPPORT */
|
||||
#endif /* CHECKBOX_PRIVATE_H */
|
||||
|
||||
/*************************** End of file ****************************/
|
149
components/gui/STemWin/inc/CHOOSECOLOR.h
Normal file
149
components/gui/STemWin/inc/CHOOSECOLOR.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/*********************************************************************
|
||||
* 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 : CHOOSECOLOR.h
|
||||
Purpose : Message box interface
|
||||
--------------------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 CHOOSECOLOR_H
|
||||
#define CHOOSECOLOR_H
|
||||
|
||||
#include "WM.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { /* Make sure we have C-declarations in C++ programs */
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#define CHOOSECOLOR_CF_MOVEABLE FRAMEWIN_CF_MOVEABLE
|
||||
|
||||
#define CHOOSECOLOR_CI_FRAME 0
|
||||
#define CHOOSECOLOR_CI_FOCUS 1
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
/*********************************************************************
|
||||
*
|
||||
* CHOOSECOLOR_PROPS
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned aBorder[2];
|
||||
unsigned aSpace[2];
|
||||
unsigned aButtonSize[2];
|
||||
GUI_COLOR aColor[2];
|
||||
} CHOOSECOLOR_PROPS;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* CHOOSECOLOR_CONTEXT
|
||||
*/
|
||||
typedef struct {
|
||||
U32 LastColor;
|
||||
const GUI_COLOR * pColor;
|
||||
unsigned NumColors;
|
||||
unsigned NumColorsPerLine;
|
||||
int SelOld;
|
||||
int Sel;
|
||||
WM_HWIN hParent;
|
||||
CHOOSECOLOR_PROPS Props;
|
||||
} CHOOSECOLOR_CONTEXT;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public code
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
WM_HWIN CHOOSECOLOR_Create(WM_HWIN hParent,
|
||||
int xPos,
|
||||
int yPos,
|
||||
int xSize,
|
||||
int ySize,
|
||||
const GUI_COLOR * pColor,
|
||||
unsigned NumColors,
|
||||
unsigned NumColorsPerLine,
|
||||
int Sel,
|
||||
const char * sCaption,
|
||||
int Flags);
|
||||
|
||||
int CHOOSECOLOR_GetSel(WM_HWIN hObj);
|
||||
void CHOOSECOLOR_SetSel(WM_HWIN hObj, int Sel);
|
||||
|
||||
void CHOOSECOLOR_SetDefaultColor (unsigned Index, GUI_COLOR Color);
|
||||
void CHOOSECOLOR_SetDefaultSpace (unsigned Index, unsigned Space);
|
||||
void CHOOSECOLOR_SetDefaultBorder (unsigned Index, unsigned Border);
|
||||
void CHOOSECOLOR_SetDefaultButtonSize(unsigned Index, unsigned ButtonSize);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* The callback ...
|
||||
*
|
||||
* Do not call it directly ! It is only to be used from within an
|
||||
* overwritten callback.
|
||||
*/
|
||||
void CHOOSECOLOR_Callback(WM_MESSAGE * pMsg);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GUI_WINSUPPORT */
|
||||
|
||||
#endif /* CHOOSECOLOR_H */
|
144
components/gui/STemWin/inc/CHOOSEFILE.h
Normal file
144
components/gui/STemWin/inc/CHOOSEFILE.h
Normal file
@@ -0,0 +1,144 @@
|
||||
/*********************************************************************
|
||||
* 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 : CHOOSEFILE.h
|
||||
Purpose : File dialog interface
|
||||
--------------------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 CHOOSEFILE_H
|
||||
#define CHOOSEFILE_H
|
||||
|
||||
#include "WM.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { /* Make sure we have C-declarations in C++ programs */
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#define CHOOSEFILE_FINDFIRST 0
|
||||
#define CHOOSEFILE_FINDNEXT 1
|
||||
|
||||
#define CHOOSEFILE_FLAG_DIRECTORY (1 << 0)
|
||||
|
||||
#ifndef CHOOSEFILE_MAXLEN
|
||||
#define CHOOSEFILE_MAXLEN 256
|
||||
#endif
|
||||
|
||||
#define CHOOSEFILE_BI_CANCEL 0
|
||||
#define CHOOSEFILE_BI_OK 1
|
||||
#define CHOOSEFILE_BI_UP 2
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
/*********************************************************************
|
||||
*
|
||||
* CHOOSEFILE_INFO
|
||||
*/
|
||||
typedef struct CHOOSEFILE_INFO CHOOSEFILE_INFO;
|
||||
|
||||
struct CHOOSEFILE_INFO {
|
||||
int Cmd; // Command for GetData() function
|
||||
int Id; // Id of pressed button (for internal use only)
|
||||
const char * pMask; // Mask to be used for searching files
|
||||
char * pName; // (for internal use only)
|
||||
char * pExt; // (for internal use only)
|
||||
char * pAttrib; // (for internal use only)
|
||||
WM_TOOLTIP_HANDLE hToolTip; // (for internal use only)
|
||||
U32 SizeL; // FileSize low word
|
||||
U32 SizeH; // FileSize high word
|
||||
U32 Flags; // File flags
|
||||
char pRoot[CHOOSEFILE_MAXLEN]; // Buffer used internally and for passing result
|
||||
int (* pfGetData)(CHOOSEFILE_INFO * pInfo); // Pointer to GetData() function
|
||||
};
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
WM_HWIN CHOOSEFILE_Create(WM_HWIN hParent, // Parent window
|
||||
int xPos, // xPosition in window coordinates
|
||||
int yPos, // yPosition in window coordinates
|
||||
int xSize, // xSize in pixels
|
||||
int ySize, // ySize in pixels
|
||||
const char * apRoot[], // Pointers to root strings
|
||||
int NumRoot, // Number of roots
|
||||
int SelRoot, // Root to be selected at first
|
||||
const char * sCaption, // Shown in title bar
|
||||
int Flags, // Flags for FRAMEWINDOW
|
||||
CHOOSEFILE_INFO * pInfo // Pointer to CHOOSEFILE_INFO structure
|
||||
);
|
||||
|
||||
void CHOOSEFILE_Callback (WM_MESSAGE * pMsg);
|
||||
void CHOOSEFILE_EnableToolTips (void);
|
||||
void CHOOSEFILE_SetButtonText (WM_HWIN hWin, unsigned ButtonIndex, const char * pText);
|
||||
void CHOOSEFILE_SetDefaultButtonText(unsigned ButtonIndex, const char * pText);
|
||||
void CHOOSEFILE_SetDelim (char Delim);
|
||||
void CHOOSEFILE_SetToolTips (const TOOLTIP_INFO * pInfo, int NumItems);
|
||||
void CHOOSEFILE_SetTopMode (unsigned OnOff);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GUI_WINSUPPORT */
|
||||
|
||||
#endif /* CHOOSEFILE_H */
|
113
components/gui/STemWin/inc/DIALOG.h
Normal file
113
components/gui/STemWin/inc/DIALOG.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*********************************************************************
|
||||
* 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 : Dialog.h
|
||||
Purpose : Dialog box include
|
||||
--------------------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 DIALOG_H
|
||||
#define DIALOG_H
|
||||
|
||||
#include "WM.h"
|
||||
#include "BUTTON.h"
|
||||
#include "CALENDAR.h"
|
||||
#include "CHECKBOX.h"
|
||||
#include "CHOOSECOLOR.h"
|
||||
#include "CHOOSEFILE.h"
|
||||
#include "DROPDOWN.h"
|
||||
#include "EDIT.h"
|
||||
#include "FRAMEWIN.h"
|
||||
#include "GRAPH.h"
|
||||
#include "HEADER.h"
|
||||
#include "ICONVIEW.h"
|
||||
#include "IMAGE.h"
|
||||
#include "LISTBOX.h"
|
||||
#include "LISTVIEW.h"
|
||||
#include "LISTWHEEL.h"
|
||||
#include "MENU.h"
|
||||
#include "MULTIEDIT.h"
|
||||
#include "MULTIPAGE.h"
|
||||
#include "PROGBAR.h"
|
||||
#include "RADIO.h"
|
||||
#include "SCROLLBAR.h"
|
||||
#include "SLIDER.h"
|
||||
#include "SPINBOX.h"
|
||||
#include "TEXT.h"
|
||||
#include "TREEVIEW.h"
|
||||
#include "KNOB.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { /* Make sure we have C-declarations in C++ programs */
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* WINDOW API
|
||||
*/
|
||||
WM_HWIN WINDOW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, WM_CALLBACK * cb);
|
||||
WM_HWIN WINDOW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, WM_CALLBACK * cb, int NumExtraBytes);
|
||||
WM_HWIN WINDOW_CreateIndirect (const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
|
||||
GUI_COLOR WINDOW_GetDefaultBkColor(void);
|
||||
int WINDOW_GetUserData (WM_HWIN hObj, void * pDest, int NumBytes);
|
||||
void WINDOW_SetBkColor (WM_HWIN hObj, GUI_COLOR Color);
|
||||
void WINDOW_SetDefaultBkColor(GUI_COLOR Color);
|
||||
int WINDOW_SetUserData (WM_HWIN hObj, const void * pSrc, int NumBytes);
|
||||
|
||||
void WINDOW_Callback(WM_MESSAGE * pMsg);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // DIALOG_H
|
||||
|
||||
/*************************** End of file ****************************/
|
120
components/gui/STemWin/inc/DIALOG_Intern.h
Normal file
120
components/gui/STemWin/inc/DIALOG_Intern.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*********************************************************************
|
||||
* 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 : Dialog.h
|
||||
Purpose : Dialog box include
|
||||
--------------------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 DIALOG_INTERN_H
|
||||
#define DIALOG_INTERN_H
|
||||
|
||||
#include "WM.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { // Make sure we have C-declarations in C++ programs
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef struct GUI_WIDGET_CREATE_INFO_struct GUI_WIDGET_CREATE_INFO;
|
||||
typedef WM_HWIN GUI_WIDGET_CREATE_FUNC (const GUI_WIDGET_CREATE_INFO * pCreate, WM_HWIN hWin, int x0, int y0, WM_CALLBACK * cb);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Structures
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
struct GUI_WIDGET_CREATE_INFO_struct {
|
||||
GUI_WIDGET_CREATE_FUNC * pfCreateIndirect;
|
||||
const char * pName; // Text ... Not used on all widgets
|
||||
I16 Id; // ID ... should be unique in a dialog
|
||||
I16 x0; // x position
|
||||
I16 y0; // y position
|
||||
I16 xSize; // x size
|
||||
I16 ySize; // y size
|
||||
U16 Flags; // Widget specific create flags (opt.)
|
||||
I32 Para; // Widget specific parameter (opt.)
|
||||
U32 NumExtraBytes; // Number of extra bytes usable with <WIDGET>_SetUserData & <WIDGET>_GetUserData
|
||||
};
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Public API functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
WM_HWIN GUI_CreateDialogBox (const GUI_WIDGET_CREATE_INFO * paWidget, int NumWidgets, WM_CALLBACK * cb, WM_HWIN hParent, int x0, int y0);
|
||||
void GUI_EndDialog (WM_HWIN hWin, int r);
|
||||
int GUI_ExecDialogBox (const GUI_WIDGET_CREATE_INFO * paWidget, int NumWidgets, WM_CALLBACK * cb, WM_HWIN hParent, int x0, int y0);
|
||||
int GUI_ExecCreatedDialog (WM_HWIN hDialog);
|
||||
WM_DIALOG_STATUS * GUI_GetDialogStatusPtr(WM_HWIN hDialog); // Not to be documented
|
||||
void GUI_SetDialogStatusPtr(WM_HWIN hDialog, WM_DIALOG_STATUS * pDialogStatus); // Not to be documented
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Obsolete
|
||||
*/
|
||||
LCD_COLOR DIALOG_GetBkColor(void);
|
||||
LCD_COLOR DIALOG_SetBkColor(LCD_COLOR BkColor);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // DIALOG_INTERN_H
|
||||
|
||||
/*************************** End of file ****************************/
|
211
components/gui/STemWin/inc/DROPDOWN.h
Normal file
211
components/gui/STemWin/inc/DROPDOWN.h
Normal file
@@ -0,0 +1,211 @@
|
||||
/*********************************************************************
|
||||
* 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 : DROPDOWN.h
|
||||
Purpose : Multiple choice object include
|
||||
--------------------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 DROPDOWN_H
|
||||
#define DROPDOWN_H
|
||||
|
||||
#include "WM.h"
|
||||
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
|
||||
#include "LISTBOX.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { /* Make sure we have C-declarations in C++ programs */
|
||||
#endif
|
||||
|
||||
/************************************************************
|
||||
*
|
||||
* Create flags
|
||||
*/
|
||||
#define DROPDOWN_CF_AUTOSCROLLBAR (1 << 0)
|
||||
#define DROPDOWN_CF_UP (1 << 1)
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Color indices
|
||||
*/
|
||||
#define DROPDOWN_CI_UNSEL 0
|
||||
#define DROPDOWN_CI_SEL 1
|
||||
#define DROPDOWN_CI_SELFOCUS 2
|
||||
|
||||
#define DROPDOWN_CI_ARROW 0
|
||||
#define DROPDOWN_CI_BUTTON 1
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Skinning property indices
|
||||
*/
|
||||
#define DROPDOWN_SKINFLEX_PI_EXPANDED 0
|
||||
#define DROPDOWN_SKINFLEX_PI_FOCUSSED 1
|
||||
#define DROPDOWN_SKINFLEX_PI_ENABLED 2
|
||||
#define DROPDOWN_SKINFLEX_PI_DISABLED 3
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef WM_HMEM DROPDOWN_Handle;
|
||||
|
||||
typedef struct {
|
||||
GUI_COLOR aColorFrame[3];
|
||||
GUI_COLOR aColorUpper[2];
|
||||
GUI_COLOR aColorLower[2];
|
||||
GUI_COLOR ColorArrow;
|
||||
GUI_COLOR ColorText;
|
||||
GUI_COLOR ColorSep;
|
||||
int Radius;
|
||||
} DROPDOWN_SKINFLEX_PROPS;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Create functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
DROPDOWN_Handle DROPDOWN_Create (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags);
|
||||
DROPDOWN_Handle DROPDOWN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
|
||||
DROPDOWN_Handle DROPDOWN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
|
||||
DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* The callback ...
|
||||
*
|
||||
* Do not call it directly ! It is only to be used from within an
|
||||
* overwritten callback.
|
||||
*/
|
||||
void DROPDOWN_Callback(WM_MESSAGE * pMsg);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Member functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
void DROPDOWN_AddKey (DROPDOWN_Handle hObj, int Key);
|
||||
void DROPDOWN_AddString (DROPDOWN_Handle hObj, const char* s);
|
||||
void DROPDOWN_Collapse (DROPDOWN_Handle hObj);
|
||||
void DROPDOWN_DecSel (DROPDOWN_Handle hObj);
|
||||
void DROPDOWN_DecSelExp (DROPDOWN_Handle hObj);
|
||||
void DROPDOWN_DeleteItem (DROPDOWN_Handle hObj, unsigned int Index);
|
||||
void DROPDOWN_Expand (DROPDOWN_Handle hObj);
|
||||
unsigned DROPDOWN_GetItemDisabled (DROPDOWN_Handle hObj, unsigned Index);
|
||||
unsigned DROPDOWN_GetItemSpacing (DROPDOWN_Handle hObj);
|
||||
int DROPDOWN_GetItemText (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize);
|
||||
LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj);
|
||||
int DROPDOWN_GetNumItems (DROPDOWN_Handle hObj);
|
||||
int DROPDOWN_GetSel (DROPDOWN_Handle hObj);
|
||||
int DROPDOWN_GetSelExp (DROPDOWN_Handle hObj);
|
||||
int DROPDOWN_GetUserData (DROPDOWN_Handle hObj, void * pDest, int NumBytes);
|
||||
void DROPDOWN_IncSel (DROPDOWN_Handle hObj);
|
||||
void DROPDOWN_IncSelExp (DROPDOWN_Handle hObj);
|
||||
void DROPDOWN_InsertString (DROPDOWN_Handle hObj, const char* s, unsigned int Index);
|
||||
void DROPDOWN_SetAutoScroll (DROPDOWN_Handle hObj, int OnOff);
|
||||
void DROPDOWN_SetBkColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color);
|
||||
void DROPDOWN_SetColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color);
|
||||
void DROPDOWN_SetFont (DROPDOWN_Handle hObj, const GUI_FONT * pfont);
|
||||
void DROPDOWN_SetItemDisabled (DROPDOWN_Handle hObj, unsigned Index, int OnOff);
|
||||
void DROPDOWN_SetItemSpacing (DROPDOWN_Handle hObj, unsigned Value);
|
||||
int DROPDOWN_SetListHeight (DROPDOWN_Handle hObj, unsigned Height);
|
||||
void DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color);
|
||||
void DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width);
|
||||
void DROPDOWN_SetSel (DROPDOWN_Handle hObj, int Sel);
|
||||
void DROPDOWN_SetSelExp (DROPDOWN_Handle hObj, int Sel);
|
||||
void DROPDOWN_SetTextAlign (DROPDOWN_Handle hObj, int Align);
|
||||
void DROPDOWN_SetTextColor (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color);
|
||||
void DROPDOWN_SetTextHeight (DROPDOWN_Handle hObj, unsigned TextHeight);
|
||||
int DROPDOWN_SetUpMode (DROPDOWN_Handle hObj, int OnOff);
|
||||
int DROPDOWN_SetUserData (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Member functions: Skinning
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
void DROPDOWN_GetSkinFlexProps (DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
|
||||
void DROPDOWN_SetSkinClassic (DROPDOWN_Handle hObj);
|
||||
void DROPDOWN_SetSkin (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
|
||||
int DROPDOWN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
|
||||
void DROPDOWN_SetSkinFlexProps (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
|
||||
void DROPDOWN_SetDefaultSkinClassic(void);
|
||||
WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
|
||||
|
||||
#define DROPDOWN_SKIN_FLEX DROPDOWN_DrawSkinFlex
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Managing default values
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
GUI_COLOR DROPDOWN_GetDefaultBkColor (int Index);
|
||||
GUI_COLOR DROPDOWN_GetDefaultColor (int Index);
|
||||
const GUI_FONT * DROPDOWN_GetDefaultFont (void);
|
||||
GUI_COLOR DROPDOWN_GetDefaultScrollbarColor(int Index);
|
||||
void DROPDOWN_SetDefaultFont (const GUI_FONT * pFont);
|
||||
GUI_COLOR DROPDOWN_SetDefaultBkColor (int Index, GUI_COLOR Color);
|
||||
GUI_COLOR DROPDOWN_SetDefaultColor (int Index, GUI_COLOR Color);
|
||||
GUI_COLOR DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // DROPDOWN_H
|
||||
|
||||
/*************************** End of file ****************************/
|
154
components/gui/STemWin/inc/DROPDOWN_Private.h
Normal file
154
components/gui/STemWin/inc/DROPDOWN_Private.h
Normal file
@@ -0,0 +1,154 @@
|
||||
/*********************************************************************
|
||||
* 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 : DROPDOWN_Private.h
|
||||
Purpose : DROPDOWN private header 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 DROPDOWN_PRIVATE_H
|
||||
#define DROPDOWN_PRIVATE_H
|
||||
|
||||
#include "DROPDOWN.h"
|
||||
#include "WIDGET.h"
|
||||
#include "GUI_ARRAY.h"
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#define DROPDOWN_SF_AUTOSCROLLBAR DROPDOWN_CF_AUTOSCROLLBAR
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Object definition
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef struct {
|
||||
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
|
||||
} DROPDOWN_SKIN_PRIVATE;
|
||||
|
||||
typedef struct {
|
||||
const GUI_FONT * pFont;
|
||||
GUI_COLOR aBackColor[3];
|
||||
GUI_COLOR aTextColor[3];
|
||||
GUI_COLOR aColor[2];
|
||||
GUI_COLOR aScrollbarColor[3];
|
||||
DROPDOWN_SKIN_PRIVATE SkinPrivate;
|
||||
I16 TextBorderSize;
|
||||
I16 Align;
|
||||
} DROPDOWN_PROPS;
|
||||
|
||||
typedef struct {
|
||||
WIDGET Widget;
|
||||
I16 Sel; // Current selection
|
||||
I16 ySizeLB; // ySize of assigned LISTBOX in expanded state
|
||||
I16 TextHeight;
|
||||
GUI_ARRAY Handles;
|
||||
WM_SCROLL_STATE ScrollState;
|
||||
DROPDOWN_PROPS Props;
|
||||
WIDGET_SKIN const * pWidgetSkin;
|
||||
WM_HWIN hListWin;
|
||||
U8 Flags;
|
||||
U16 ItemSpacing;
|
||||
U8 ScrollbarWidth;
|
||||
char IsPressed;
|
||||
WM_HMEM hDisabled;
|
||||
} DROPDOWN_Obj;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Macros for internal use
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
|
||||
#define DROPDOWN_INIT_ID(p) (p->Widget.DebugId = DROPDOWN_ID)
|
||||
#else
|
||||
#define DROPDOWN_INIT_ID(p)
|
||||
#endif
|
||||
|
||||
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
|
||||
DROPDOWN_Obj * DROPDOWN_LockH(DROPDOWN_Handle h);
|
||||
#define DROPDOWN_LOCK_H(h) DROPDOWN_LockH(h)
|
||||
#else
|
||||
#define DROPDOWN_LOCK_H(h) (DROPDOWN_Obj *)GUI_LOCK_H(h)
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Private (module internal) data
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
extern DROPDOWN_PROPS DROPDOWN__DefaultProps;
|
||||
|
||||
extern const WIDGET_SKIN DROPDOWN__SkinClassic;
|
||||
extern WIDGET_SKIN DROPDOWN__Skin;
|
||||
|
||||
extern WIDGET_SKIN const * DROPDOWN__pSkinDefault;
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Private functions
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
|
||||
void DROPDOWN__AdjustHeight(DROPDOWN_Handle hObj);
|
||||
int DROPDOWN__GetNumItems (DROPDOWN_Obj * pObj);
|
||||
const char * DROPDOWN__GetpItemLocked(DROPDOWN_Handle hObj, int Index);
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // DROPDOWN_PRIVATE_H
|
236
components/gui/STemWin/inc/EDIT.h
Normal file
236
components/gui/STemWin/inc/EDIT.h
Normal file
@@ -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 : EDIT.h
|
||||
Purpose : EDIT include
|
||||
--------------------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 EDIT_H
|
||||
#define EDIT_H
|
||||
|
||||
#include "WM.h"
|
||||
#include "DIALOG_Intern.h" // Required for Create indirect data structure
|
||||
|
||||
#if GUI_WINSUPPORT
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" { // Make sure we have C-declarations in C++ programs
|
||||
#endif
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defaults for configuration switches
|
||||
*
|
||||
* The following are defaults for config switches which affect the
|
||||
* interface specified in this module
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
/*********************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
//
|
||||
// Create / Status flags
|
||||
//
|
||||
#define EDIT_CF_LEFT GUI_TA_LEFT
|
||||
#define EDIT_CF_RIGHT GUI_TA_RIGHT
|
||||
#define EDIT_CF_HCENTER GUI_TA_HCENTER
|
||||
#define EDIT_CF_VCENTER GUI_TA_VCENTER
|
||||
#define EDIT_CF_TOP GUI_TA_TOP
|
||||
#define EDIT_CF_BOTTOM GUI_TA_BOTTOM
|
||||
|
||||
//
|
||||
// Color indices
|
||||
//
|
||||
#define EDIT_CI_DISABLED 0
|
||||
#define EDIT_CI_ENABLED 1
|
||||
#define EDIT_CI_CURSOR 2
|
||||
|
||||
//
|
||||
// Signed or normal mode
|
||||
//
|
||||
#define GUI_EDIT_NORMAL (0 << 0)
|
||||
#define GUI_EDIT_SIGNED (1 << 0)
|
||||
#define GUI_EDIT_SUPPRESS_LEADING_ZEROES (1 << 1)
|
||||
|
||||
//
|
||||
// Cursor coloring
|
||||
//
|
||||
#define GUI_EDIT_SHOWCURSOR (1 << 2)
|
||||
#define GUI_EDIT_CUSTCOLORMODE (1 << 3)
|
||||
|
||||
//
|
||||
// Edit modes
|
||||
//
|
||||
#define GUI_EDIT_MODE_INSERT 0
|
||||
#define GUI_EDIT_MODE_OVERWRITE 1
|
||||
|
||||
//
|
||||
// Compatibility macros
|
||||
//
|
||||
#define EDIT_CI_DISABELD EDIT_CI_DISABLED
|
||||
#define EDIT_CI_ENABELD EDIT_CI_ENABLED
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Types
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
typedef WM_HMEM EDIT_Handle;
|
||||
typedef void tEDIT_AddKeyEx (EDIT_Handle hObj, int Key);
|
||||
typedef void tEDIT_UpdateBuffer(EDIT_Handle hObj);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Create functions
|
||||
*/
|
||||
EDIT_Handle EDIT_Create (int x0, int y0, int xSize, int ySize, int Id, int MaxLen, int Flags);
|
||||
EDIT_Handle EDIT_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int MaxLen);
|
||||
EDIT_Handle EDIT_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen);
|
||||
EDIT_Handle EDIT_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen, int NumExtraBytes);
|
||||
EDIT_Handle EDIT_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* The callback ...
|
||||
*
|
||||
* Do not call it directly ! It is only to be used from within an
|
||||
* overwritten callback.
|
||||
*/
|
||||
void EDIT_Callback(WM_MESSAGE * pMsg);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Managing default values
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
void EDIT_SetDefaultBkColor (unsigned int Index, GUI_COLOR Color);
|
||||
void EDIT_SetDefaultFont (const GUI_FONT * pFont);
|
||||
void EDIT_SetDefaultTextAlign(int Align);
|
||||
void EDIT_SetDefaultTextColor(unsigned int Index, GUI_COLOR Color);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Individual member functions
|
||||
*/
|
||||
//
|
||||
// Query preferences
|
||||
//
|
||||
GUI_COLOR EDIT_GetDefaultBkColor(unsigned int Index);
|
||||
const GUI_FONT * EDIT_GetDefaultFont(void);
|
||||
int EDIT_GetDefaultTextAlign(void);
|
||||
GUI_COLOR EDIT_GetDefaultTextColor(unsigned int Index);
|
||||
//
|
||||
// Methods changing properties
|
||||
//
|
||||
void EDIT_AddKey (EDIT_Handle hObj, int Key);
|
||||
void EDIT_EnableBlink (EDIT_Handle hObj, int Period, int OnOff);
|
||||
GUI_COLOR EDIT_GetBkColor (EDIT_Handle hObj, unsigned int Index);
|
||||
void EDIT_SetBkColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR color);
|
||||
void EDIT_SetCursorAtChar (EDIT_Handle hObj, int Pos);
|
||||
void EDIT_SetCursorAtPixel (EDIT_Handle hObj, int xPos);
|
||||
void EDIT_SetFocussable (EDIT_Handle hObj, int State);
|
||||
void EDIT_SetFont (EDIT_Handle hObj, const GUI_FONT * pFont);
|
||||
int EDIT_SetInsertMode (EDIT_Handle hObj, int OnOff);
|
||||
void EDIT_SetMaxLen (EDIT_Handle hObj, int MaxLen);
|
||||
void EDIT_SetpfAddKeyEx (EDIT_Handle hObj, tEDIT_AddKeyEx * pfAddKeyEx);
|
||||
void EDIT_SetpfUpdateBuffer(EDIT_Handle hObj, tEDIT_UpdateBuffer * pfUpdateBuffer);
|
||||
void EDIT_SetText (EDIT_Handle hObj, const char * s);
|
||||
void EDIT_SetTextAlign (EDIT_Handle hObj, int Align);
|
||||
GUI_COLOR EDIT_GetTextColor(EDIT_Handle hObj, unsigned int Index);
|
||||
void EDIT_SetTextColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR Color);
|
||||
void EDIT_SetSel (EDIT_Handle hObj, int FirstChar, int LastChar);
|
||||
int EDIT_SetUserData (EDIT_Handle hObj, const void * pSrc, int NumBytes);
|
||||
int EDIT_EnableInversion (EDIT_Handle hObj, int OnOff);
|
||||
//
|
||||
// Get/Set user input
|
||||
//
|
||||
int EDIT_GetCursorCharPos (EDIT_Handle hObj);
|
||||
void EDIT_GetCursorPixelPos (EDIT_Handle hObj, int * pxPos, int * pyPos);
|
||||
float EDIT_GetFloatValue (EDIT_Handle hObj);
|
||||
const GUI_FONT * EDIT_GetFont(EDIT_Handle hObj);
|
||||
int EDIT_GetNumChars (EDIT_Handle hObj);
|
||||
void EDIT_GetText (EDIT_Handle hObj, char * sDest, int MaxLen);
|
||||
I32 EDIT_GetValue (EDIT_Handle hObj);
|
||||
void EDIT_SetFloatValue (EDIT_Handle hObj, float Value);
|
||||
int EDIT_GetUserData (EDIT_Handle hObj, void * pDest, int NumBytes);
|
||||
void EDIT_SetValue (EDIT_Handle hObj, I32 Value);
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Routines for editing values
|
||||
*
|
||||
**********************************************************************
|
||||
*/
|
||||
void EDIT_SetHexMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
|
||||
void EDIT_SetBinMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
|
||||
void EDIT_SetDecMode (EDIT_Handle hEdit, I32 Value, I32 Min, I32 Max, int Shift, U8 Flags);
|
||||
void EDIT_SetFloatMode(EDIT_Handle hEdit, float Value, float Min, float Max, int Shift, U8 Flags);
|
||||
void EDIT_SetTextMode (EDIT_Handle hEdit);
|
||||
void EDIT_SetUlongMode(EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
|
||||
|
||||
U32 GUI_EditHex (U32 Value, U32 Min, U32 Max, int Len, int xSize);
|
||||
U32 GUI_EditBin (U32 Value, U32 Min, U32 Max, int Len, int xSize);
|
||||
I32 GUI_EditDec (I32 Value, I32 Min, I32 Max, int Len, int xSize, int Shift, U8 Flags);
|
||||
float GUI_EditFloat (float Value, float Min, float Max, int Len, int xSize, int Shift, U8 Flags);
|
||||
void GUI_EditString (char * pString, int Len, int xSize);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GUI_WINSUPPORT
|
||||
#endif // EDIT_H
|
||||
|
||||
/*************************** End of file ****************************/
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user