add rgb lib

This commit is contained in:
graduateDesign 2021-09-21 10:30:26 +08:00
parent 93cc02d409
commit 86e7d7d109
18 changed files with 1027 additions and 167 deletions

View File

@ -0,0 +1,403 @@
<?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>stm32g030c8</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32G030C8Tx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32G0xx_DFP.1.3.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000-0x20001FFF) IROM(0x8000000-0x800FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+") TZ</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll></FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile></RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>$$Device:STM32G030C8Tx$CMSIS\SVD\STM32G030.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>stm32g030c8\</OutputDirectory>
<OutputName>stm32g030c8</OutputName>
<CreateExecutable>0</CreateExecutable>
<CreateLib>1</CreateLib>
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath></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>1</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</SimDllArguments>
<SimDlgDll>DARMCM1.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM0+</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments> </TargetDllArguments>
<TargetDlgDll>TARMCM1.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM0+</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>4096</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-M0+"</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>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<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>4</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>0x2000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x10000</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>0x10000</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>0x2000</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>3</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>3</v6Lang>
<v6LangP>3</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>USE_HAL_DRIVER,STM32G030xx,HAL_ADC_MODULE_ENABLED,HAL_UART_MODULE_ENABLED,HAL_USART_MODULE_ENABLED,HAL_TIM_MODULE_ENABLED</Define>
<Undefine></Undefine>
<IncludePath>../Core/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy; ../Drivers/CMSIS/Device/ST/STM32G0xx/Include; ../Drivers/CMSIS/Include; ..\pikascript\pikascript-core; ..\pikascript\pikascript-api; ..\pikascript\pikascript-lib\STM32</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>
<ClangAsOpt>4</ClangAsOpt>
<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></TextAddressRange>
<DataAddressRange></DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile></ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
<Group>
<GroupName>RGB_ASM</GroupName>
<Files>
<File>
<FileName>RGB_ASM.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-lib\PikaPiZero\RGB_ASM.c</FilePath>
</File>
</Files>
</Group>
</Groups>
</Target>
</Targets>
<RTE>
<apis/>
<components/>
<files/>
</RTE>
</Project>

View File

@ -0,0 +1,473 @@
<?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>stm32g030c8</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32G030C8Tx</Device>
<Vendor>STMicroelectronics</Vendor>
<PackID>Keil.STM32G0xx_DFP.1.3.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000-0x20001FFF) IROM(0x8000000-0x800FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+") TZ</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll></FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile></RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>$$Device:STM32G030C8Tx$CMSIS\SVD\STM32G030.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>stm32g030c8\</OutputDirectory>
<OutputName>stm32g030c8</OutputName>
<CreateExecutable>0</CreateExecutable>
<CreateLib>1</CreateLib>
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath></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>1</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</SimDllArguments>
<SimDlgDll>DARMCM1.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM0+</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments> </TargetDllArguments>
<TargetDlgDll>TARMCM1.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM0+</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>4096</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-M0+"</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>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<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>4</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>0x2000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x8000000</StartAddress>
<Size>0x10000</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>0x10000</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>0x2000</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>3</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>3</v6Lang>
<v6LangP>3</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>USE_HAL_DRIVER,STM32G030xx,HAL_ADC_MODULE_ENABLED,HAL_UART_MODULE_ENABLED,HAL_USART_MODULE_ENABLED,HAL_TIM_MODULE_ENABLED</Define>
<Undefine></Undefine>
<IncludePath>../Core/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc; ../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy; ../Drivers/CMSIS/Device/ST/STM32G0xx/Include; ../Drivers/CMSIS/Include; ..\pikascript\pikascript-core; ..\pikascript\pikascript-api; ..\pikascript\pikascript-lib\STM32</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>
<ClangAsOpt>4</ClangAsOpt>
<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></TextAddressRange>
<DataAddressRange></DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile></ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
<Group>
<GroupName>pikascript-core</GroupName>
<Files>
<File>
<FileName>BaseObj.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\BaseObj.c</FilePath>
</File>
<File>
<FileName>dataArg.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataArg.c</FilePath>
</File>
<File>
<FileName>dataArgs.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataArgs.c</FilePath>
</File>
<File>
<FileName>dataLink.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataLink.c</FilePath>
</File>
<File>
<FileName>dataLinkNode.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataLinkNode.c</FilePath>
</File>
<File>
<FileName>dataMemory.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataMemory.c</FilePath>
</File>
<File>
<FileName>dataString.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataString.c</FilePath>
</File>
<File>
<FileName>dataStrs.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataStrs.c</FilePath>
</File>
<File>
<FileName>method.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\method.c</FilePath>
</File>
<File>
<FileName>PikaBlock.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaBlock.c</FilePath>
</File>
<File>
<FileName>PikaIf.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaIf.c</FilePath>
</File>
<File>
<FileName>PikaInvoke.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaInvoke.c</FilePath>
</File>
<File>
<FileName>PikaObj.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaObj.c</FilePath>
</File>
<File>
<FileName>PikaWhile.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaWhile.c</FilePath>
</File>
<File>
<FileName>TinyObj.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\TinyObj.c</FilePath>
</File>
</Files>
</Group>
</Groups>
</Target>
</Targets>
<RTE>
<apis/>
<components/>
<files/>
</RTE>
</Project>

View File

@ -313,7 +313,7 @@
</ArmAdsMisc> </ArmAdsMisc>
<Cads> <Cads>
<interw>1</interw> <interw>1</interw>
<Optim>7</Optim> <Optim>1</Optim>
<oTime>0</oTime> <oTime>0</oTime>
<SplitLS>0</SplitLS> <SplitLS>0</SplitLS>
<OneElfS>1</OneElfS> <OneElfS>1</OneElfS>
@ -332,7 +332,7 @@
<v6LangP>3</v6LangP> <v6LangP>3</v6LangP>
<vShortEn>1</vShortEn> <vShortEn>1</vShortEn>
<vShortWch>1</vShortWch> <vShortWch>1</vShortWch>
<v6Lto>1</v6Lto> <v6Lto>0</v6Lto>
<v6WtE>0</v6WtE> <v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti> <v6Rtti>0</v6Rtti>
<VariousControls> <VariousControls>
@ -642,86 +642,6 @@
</File> </File>
</Files> </Files>
</Group> </Group>
<Group>
<GroupName>pikascript-core</GroupName>
<Files>
<File>
<FileName>BaseObj.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\BaseObj.c</FilePath>
</File>
<File>
<FileName>dataArg.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataArg.c</FilePath>
</File>
<File>
<FileName>dataArgs.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataArgs.c</FilePath>
</File>
<File>
<FileName>dataLink.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataLink.c</FilePath>
</File>
<File>
<FileName>dataLinkNode.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataLinkNode.c</FilePath>
</File>
<File>
<FileName>dataMemory.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataMemory.c</FilePath>
</File>
<File>
<FileName>dataString.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataString.c</FilePath>
</File>
<File>
<FileName>dataStrs.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\dataStrs.c</FilePath>
</File>
<File>
<FileName>method.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\method.c</FilePath>
</File>
<File>
<FileName>PikaBlock.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaBlock.c</FilePath>
</File>
<File>
<FileName>PikaIf.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaIf.c</FilePath>
</File>
<File>
<FileName>PikaInvoke.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaInvoke.c</FilePath>
</File>
<File>
<FileName>PikaObj.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaObj.c</FilePath>
</File>
<File>
<FileName>PikaWhile.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\PikaWhile.c</FilePath>
</File>
<File>
<FileName>TinyObj.c</FileName>
<FileType>1</FileType>
<FilePath>..\pikascript\pikascript-core\TinyObj.c</FilePath>
</File>
</Files>
</Group>
<Group> <Group>
<GroupName>pikascript-api</GroupName> <GroupName>pikascript-api</GroupName>
<Files> <Files>
@ -875,6 +795,21 @@
<FileType>1</FileType> <FileType>1</FileType>
<FilePath>..\pikascript\pikascript-lib\PikaPiZero\PikaPiZero_RGB.c</FilePath> <FilePath>..\pikascript\pikascript-lib\PikaPiZero\PikaPiZero_RGB.c</FilePath>
</File> </File>
<File>
<FileName>RGB_ASM.lib</FileName>
<FileType>4</FileType>
<FilePath>..\pikascript\pikascript-lib\PikaPiZero\RGB_ASM.lib</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>pikascript-core</GroupName>
<Files>
<File>
<FileName>pikascript-core.lib</FileName>
<FileType>4</FileType>
<FilePath>..\pikascript\pikascript-core\pikascript-core.lib</FilePath>
</File>
</Files> </Files>
</Group> </Group>
<Group> <Group>
@ -887,8 +822,8 @@
<RTE> <RTE>
<apis/> <apis/>
<components> <components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.3.0" condition="ARMv6_7_8-M Device"> <component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.5.0" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.6.0"/> <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.8.0"/>
<targetInfos> <targetInfos>
<targetInfo name="stm32g030c8"/> <targetInfo name="stm32g030c8"/>
</targetInfos> </targetInfos>

View File

@ -0,0 +1,16 @@
--create stm32g030c8\stm32g030c8.lib
stm32g030c8\baseobj.o
stm32g030c8\dataarg.o
stm32g030c8\dataargs.o
stm32g030c8\datalink.o
stm32g030c8\datalinknode.o
stm32g030c8\datamemory.o
stm32g030c8\datastring.o
stm32g030c8\datastrs.o
stm32g030c8\method.o
stm32g030c8\pikablock.o
stm32g030c8\pikaif.o
stm32g030c8\pikainvoke.o
stm32g030c8\pikaobj.o
stm32g030c8\pikawhile.o
stm32g030c8\tinyobj.o

Binary file not shown.

Binary file not shown.

View File

@ -10,4 +10,10 @@ class RGB(PikaStdLib.SysObj):
pass pass
def red(): def red():
pass pass
def green():
pass
def blue():
pass
def white():
pass

View File

@ -4,18 +4,9 @@ import PikaStdLib
time = STM32.Time() time = STM32.Time()
uart = STM32.UART() uart = STM32.UART()
<<<<<<< HEAD
uart.init() uart.init()
uart.setId() uart.setId(1)
uart.enable() uart.enable()
=======
pwm = STM32.PWM()
pwm.init()
pwm.setPin('PA8')
pwm.setFrequency(2000)
pwm.setDuty(0.5)
pwm.enable()
>>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c
print('initing rgb...') print('initing rgb...')
rgb = PikaPiZero.RGB() rgb = PikaPiZero.RGB()
@ -27,7 +18,11 @@ mem = PikaStdLib.MemChecker()
print('mem max:') print('mem max:')
mem.max() mem.max()
while True: while True:
time.sleep_ms(500) time.sleep_ms(250)
rgb.red()
time.sleep_ms(500)
rgb.red() rgb.red()
time.sleep_ms(250)
rgb.green()
time.sleep_ms(250)
rgb.white()
time.sleep_ms(250)
rgb.blue()

View File

@ -3,29 +3,23 @@
/* ******************************** */ /* ******************************** */
#include "PikaMain.h" #include "PikaMain.h"
#include "PikaStdLib_SysObj.h" #include "PikaStdLib_SysObj.h"
<<<<<<< HEAD
#include "PikaStdLib_MemChecker.h" #include "PikaStdLib_MemChecker.h"
#include "PikaPiZero_RGB.h" #include "PikaPiZero_RGB.h"
=======
#include "STM32_PWM.h"
>>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c
#include "STM32_Time.h" #include "STM32_Time.h"
#include "STM32_UART.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "BaseObj.h" #include "BaseObj.h"
PikaObj *New_PikaMain(Args *args){ PikaObj *New_PikaMain(Args *args){
PikaObj *self = New_PikaStdLib_SysObj(args); PikaObj *self = New_PikaStdLib_SysObj(args);
<<<<<<< HEAD
obj_import(self, "PikaStdLib_MemChecker", New_PikaStdLib_MemChecker); obj_import(self, "PikaStdLib_MemChecker", New_PikaStdLib_MemChecker);
obj_newObj(self, "mem", "PikaStdLib_MemChecker"); obj_newObj(self, "mem", "PikaStdLib_MemChecker");
obj_import(self, "PikaPiZero_RGB", New_PikaPiZero_RGB); obj_import(self, "PikaPiZero_RGB", New_PikaPiZero_RGB);
obj_newObj(self, "rgb", "PikaPiZero_RGB"); obj_newObj(self, "rgb", "PikaPiZero_RGB");
=======
obj_import(self, "STM32_PWM", New_STM32_PWM);
obj_newObj(self, "pwm", "STM32_PWM");
>>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c
obj_import(self, "STM32_Time", New_STM32_Time); obj_import(self, "STM32_Time", New_STM32_Time);
obj_newObj(self, "time", "STM32_Time"); obj_newObj(self, "time", "STM32_Time");
obj_import(self, "STM32_UART", New_STM32_UART);
obj_newObj(self, "uart", "STM32_UART");
return self; return self;
} }

View File

@ -8,10 +8,18 @@
#include <stdlib.h> #include <stdlib.h>
#include "BaseObj.h" #include "BaseObj.h"
void PikaPiZero_RGB_blueMethod(PikaObj *self, Args *args){
PikaPiZero_RGB_blue(self);
}
void PikaPiZero_RGB_enableMethod(PikaObj *self, Args *args){ void PikaPiZero_RGB_enableMethod(PikaObj *self, Args *args){
PikaPiZero_RGB_enable(self); PikaPiZero_RGB_enable(self);
} }
void PikaPiZero_RGB_greenMethod(PikaObj *self, Args *args){
PikaPiZero_RGB_green(self);
}
void PikaPiZero_RGB_initMethod(PikaObj *self, Args *args){ void PikaPiZero_RGB_initMethod(PikaObj *self, Args *args){
PikaPiZero_RGB_init(self); PikaPiZero_RGB_init(self);
} }
@ -20,12 +28,19 @@ void PikaPiZero_RGB_redMethod(PikaObj *self, Args *args){
PikaPiZero_RGB_red(self); PikaPiZero_RGB_red(self);
} }
void PikaPiZero_RGB_whiteMethod(PikaObj *self, Args *args){
PikaPiZero_RGB_white(self);
}
PikaObj *New_PikaPiZero_RGB(Args *args){ PikaObj *New_PikaPiZero_RGB(Args *args){
PikaObj *self = New_PikaStdLib_SysObj(args); PikaObj *self = New_PikaStdLib_SysObj(args);
obj_import(self, "STM32_GPIO", New_STM32_GPIO); obj_import(self, "STM32_GPIO", New_STM32_GPIO);
obj_newObj(self, "pin", "STM32_GPIO"); obj_newObj(self, "pin", "STM32_GPIO");
class_defineMethod(self, "blue()", PikaPiZero_RGB_blueMethod);
class_defineMethod(self, "enable()", PikaPiZero_RGB_enableMethod); class_defineMethod(self, "enable()", PikaPiZero_RGB_enableMethod);
class_defineMethod(self, "green()", PikaPiZero_RGB_greenMethod);
class_defineMethod(self, "init()", PikaPiZero_RGB_initMethod); class_defineMethod(self, "init()", PikaPiZero_RGB_initMethod);
class_defineMethod(self, "red()", PikaPiZero_RGB_redMethod); class_defineMethod(self, "red()", PikaPiZero_RGB_redMethod);
class_defineMethod(self, "white()", PikaPiZero_RGB_whiteMethod);
return self; return self;
} }

View File

@ -9,8 +9,11 @@
PikaObj *New_PikaPiZero_RGB(Args *args); PikaObj *New_PikaPiZero_RGB(Args *args);
void PikaPiZero_RGB_blue(PikaObj *self);
void PikaPiZero_RGB_enable(PikaObj *self); void PikaPiZero_RGB_enable(PikaObj *self);
void PikaPiZero_RGB_green(PikaObj *self);
void PikaPiZero_RGB_init(PikaObj *self); void PikaPiZero_RGB_init(PikaObj *self);
void PikaPiZero_RGB_red(PikaObj *self); void PikaPiZero_RGB_red(PikaObj *self);
void PikaPiZero_RGB_white(PikaObj *self);
#endif #endif

File diff suppressed because one or more lines are too long

View File

@ -7,9 +7,8 @@
PikaObj * pikaScriptInit(){ PikaObj * pikaScriptInit(){
PikaObj * pikaMain = newRootObj("pikaMain", New_PikaMain); PikaObj * pikaMain = newRootObj("pikaMain", New_PikaMain);
<<<<<<< HEAD
obj_run(pikaMain, "uart.init()"); obj_run(pikaMain, "uart.init()");
obj_run(pikaMain, "uart.setId()"); obj_run(pikaMain, "uart.setId(1)");
obj_run(pikaMain, "uart.enable()"); obj_run(pikaMain, "uart.enable()");
obj_run(pikaMain, "print('initing rgb...')"); obj_run(pikaMain, "print('initing rgb...')");
obj_run(pikaMain, "rgb.init()"); obj_run(pikaMain, "rgb.init()");
@ -18,22 +17,14 @@ PikaObj * pikaScriptInit(){
obj_run(pikaMain, "print('mem max:')"); obj_run(pikaMain, "print('mem max:')");
obj_run(pikaMain, "mem.max()"); obj_run(pikaMain, "mem.max()");
obj_run(pikaMain, "while True:"); obj_run(pikaMain, "while True:");
obj_run(pikaMain, " time.sleep_ms(500)"); obj_run(pikaMain, " time.sleep_ms(250)");
obj_run(pikaMain, " rgb.red()"); obj_run(pikaMain, " rgb.red()");
obj_run(pikaMain, " time.sleep_ms(500)"); obj_run(pikaMain, " time.sleep_ms(250)");
obj_run(pikaMain, " rgb.red()"); obj_run(pikaMain, " rgb.green()");
======= obj_run(pikaMain, " time.sleep_ms(250)");
obj_run(pikaMain, "pwm.init()"); obj_run(pikaMain, " rgb.white()");
obj_run(pikaMain, "pwm.setPin('PA8')"); obj_run(pikaMain, " time.sleep_ms(250)");
obj_run(pikaMain, "pwm.setFrequency(2000)"); obj_run(pikaMain, " rgb.blue()");
obj_run(pikaMain, "pwm.setDuty(0.5)");
obj_run(pikaMain, "pwm.enable()");
obj_run(pikaMain, "while True:");
obj_run(pikaMain, " time.sleep_ms(500)");
obj_run(pikaMain, " pwm.setDuty(0.5)");
obj_run(pikaMain, " time.sleep_ms(500)");
obj_run(pikaMain, " pwm.setDuty(0.3)");
>>>>>>> 75642075742a22be2a2f4f20354f9ee028543b7c
obj_run(pikaMain, ""); obj_run(pikaMain, "");
return pikaMain; return pikaMain;
} }

View File

@ -3,29 +3,7 @@
#include "BaseObj.h" #include "BaseObj.h"
#include "STM32_common.h" #include "STM32_common.h"
#include "dataStrs.h" #include "dataStrs.h"
#include "RGB_ASM.h"
void RGB_setUp(){
GPIOB->BSRR = GPIO_PIN_12; // set
int i;
i++;
i++;
i++;
i++;
i++;
i++;
i++;
i++;
GPIOB->BRR = GPIO_PIN_12; // reset
}
void RGB_setDown(){
GPIOB->BSRR = GPIO_PIN_12; // set
int i;
i++;
i++;
i++;
GPIOB->BRR = GPIO_PIN_12;
}
void RGB_reset(){ void RGB_reset(){
GPIOB->BRR = GPIO_PIN_12; // reset GPIOB->BRR = GPIO_PIN_12; // reset
@ -38,21 +16,14 @@ void RGB_reset(){
#define WHITE 0x0F0F0F #define WHITE 0x0F0F0F
#define CUTDOWN 0x000000 #define CUTDOWN 0x000000
void RGB_set(uint32_t G8R8B8) void RGB_setVoid(){
{ __asm(
int i; "nop"
uint8_t byte = 0; );
for(i = 23; i>=0 ;i--){
byte = ((G8R8B8 >> i) & 0x01);
if(byte){
RGB_setUp();
}
else{
RGB_setDown();
}
}
} }
void PikaPiZero_RGB_enable(PikaObj *self){ void PikaPiZero_RGB_enable(PikaObj *self){
obj_run(self, "pin.init()"); obj_run(self, "pin.init()");
obj_run(self, "pin.setPin('PB12')"); obj_run(self, "pin.setPin('PB12')");
@ -62,9 +33,31 @@ void PikaPiZero_RGB_enable(PikaObj *self){
void PikaPiZero_RGB_init(PikaObj *self){ void PikaPiZero_RGB_init(PikaObj *self){
} }
void PikaPiZero_RGB_red(PikaObj *self){ void PikaPiZero_RGB_red(PikaObj *self){
RGB_set(RED); RGB_set(RED);
RGB_set(GREEN); RGB_set(RED);
RGB_set(BLUE); RGB_set(RED);
RGB_set(WHITE); RGB_set(RED);
} }
void PikaPiZero_RGB_blue(PikaObj *self){
RGB_set(BLUE);
RGB_set(BLUE);
RGB_set(BLUE);
RGB_set(BLUE);
}
void PikaPiZero_RGB_green(PikaObj *self){
RGB_set(GREEN);
RGB_set(GREEN);
RGB_set(GREEN);
RGB_set(GREEN);
}
void PikaPiZero_RGB_white(PikaObj *self){
RGB_set(WHITE);
RGB_set(WHITE);
RGB_set(WHITE);
RGB_set(WHITE);
}

View File

@ -0,0 +1,37 @@
#include "RGB_ASM.h"
#include "STM32_common.h"
void RGB_set(uint32_t G8R8B8)
{
int i = 23;
uint8_t byte = 0;
while( i>0 ){
byte = ((G8R8B8 >> i) & 0x01);
if(byte){
GPIOB->BSRR = GPIO_PIN_12; // set
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
GPIOB->BRR = GPIO_PIN_12; // reset
}
else{
GPIOB->BSRR = GPIO_PIN_12; // set
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
__ASM ("nop");__ASM ("nop");__ASM ("nop");
GPIOB->BRR = GPIO_PIN_12;
}
i -- ;
}
}

View File

@ -0,0 +1,3 @@
#include <stdint.h>
void RGB_set(uint32_t G8R8B8);