This commit is contained in:
许晟昊 2024-12-23 13:59:08 +08:00
parent a8ca2d69f1
commit 87a7d76f6d
9 changed files with 1463 additions and 1301 deletions

View File

@ -89,6 +89,10 @@ void Error_Handler(void);
#define TMC2240_MISO_GPIO_Port GPIOA #define TMC2240_MISO_GPIO_Port GPIOA
#define TMC2240_MOSI_Pin LL_GPIO_PIN_7 #define TMC2240_MOSI_Pin LL_GPIO_PIN_7
#define TMC2240_MOSI_GPIO_Port GPIOA #define TMC2240_MOSI_GPIO_Port GPIOA
#define TMC2240_STEP_Pin LL_GPIO_PIN_0
#define TMC2240_STEP_GPIO_Port GPIOB
#define TMC2240_DIR_Pin LL_GPIO_PIN_1
#define TMC2240_DIR_GPIO_Port GPIOB
#define OLED_SDA_Pin LL_GPIO_PIN_12 #define OLED_SDA_Pin LL_GPIO_PIN_12
#define OLED_SDA_GPIO_Port GPIOB #define OLED_SDA_GPIO_Port GPIOB
#define OLDE_SCK_Pin LL_GPIO_PIN_13 #define OLDE_SCK_Pin LL_GPIO_PIN_13

View File

@ -59,7 +59,7 @@ void MX_GPIO_Init(void)
LL_GPIO_ResetOutputPin(GPIOA, TMC2240_EN_Pin|TMC2240_CS_Pin); LL_GPIO_ResetOutputPin(GPIOA, TMC2240_EN_Pin|TMC2240_CS_Pin);
/**/ /**/
LL_GPIO_ResetOutputPin(GPIOB, OLED_SDA_Pin|OLDE_SCK_Pin); LL_GPIO_ResetOutputPin(GPIOB, TMC2240_STEP_Pin|TMC2240_DIR_Pin|OLED_SDA_Pin|OLDE_SCK_Pin);
/**/ /**/
GPIO_InitStruct.Pin = LED_BLUE_Pin; GPIO_InitStruct.Pin = LED_BLUE_Pin;
@ -96,10 +96,16 @@ void MX_GPIO_Init(void)
LL_GPIO_Init(TMC2240_CS_GPIO_Port, &GPIO_InitStruct); LL_GPIO_Init(TMC2240_CS_GPIO_Port, &GPIO_InitStruct);
/**/ /**/
GPIO_InitStruct.Pin = LL_GPIO_PIN_0|LL_GPIO_PIN_1|LL_GPIO_PIN_2|LL_GPIO_PIN_10 GPIO_InitStruct.Pin = TMC2240_STEP_Pin|TMC2240_DIR_Pin;
|LL_GPIO_PIN_11|LL_GPIO_PIN_14|LL_GPIO_PIN_15|LL_GPIO_PIN_3 GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
|LL_GPIO_PIN_4|LL_GPIO_PIN_5|LL_GPIO_PIN_6|LL_GPIO_PIN_7 GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
|LL_GPIO_PIN_8|LL_GPIO_PIN_9; GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
LL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/**/
GPIO_InitStruct.Pin = LL_GPIO_PIN_2|LL_GPIO_PIN_10|LL_GPIO_PIN_11|LL_GPIO_PIN_14
|LL_GPIO_PIN_15|LL_GPIO_PIN_3|LL_GPIO_PIN_4|LL_GPIO_PIN_5
|LL_GPIO_PIN_6|LL_GPIO_PIN_7|LL_GPIO_PIN_8|LL_GPIO_PIN_9;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG; GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG;
LL_GPIO_Init(GPIOB, &GPIO_InitStruct); LL_GPIO_Init(GPIOB, &GPIO_InitStruct);

View File

@ -64,7 +64,7 @@ void MX_SPI1_Init(void)
SPI_InitStruct.ClockPolarity = LL_SPI_POLARITY_HIGH; SPI_InitStruct.ClockPolarity = LL_SPI_POLARITY_HIGH;
SPI_InitStruct.ClockPhase = LL_SPI_PHASE_2EDGE; SPI_InitStruct.ClockPhase = LL_SPI_PHASE_2EDGE;
SPI_InitStruct.NSS = LL_SPI_NSS_SOFT; SPI_InitStruct.NSS = LL_SPI_NSS_SOFT;
SPI_InitStruct.BaudRate = LL_SPI_BAUDRATEPRESCALER_DIV32; SPI_InitStruct.BaudRate = LL_SPI_BAUDRATEPRESCALER_DIV256;
SPI_InitStruct.BitOrder = LL_SPI_MSB_FIRST; SPI_InitStruct.BitOrder = LL_SPI_MSB_FIRST;
SPI_InitStruct.CRCCalculation = LL_SPI_CRCCALCULATION_DISABLE; SPI_InitStruct.CRCCalculation = LL_SPI_CRCCALCULATION_DISABLE;
SPI_InitStruct.CRCPoly = 10; SPI_InitStruct.CRCPoly = 10;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd"> <ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion> <SchemaVersion>1.0</SchemaVersion>
@ -26,7 +26,7 @@
<ToolsetNumber>0x4</ToolsetNumber> <ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName> <ToolsetName>ARM-ADS</ToolsetName>
<TargetOption> <TargetOption>
<CLKADS>8000000</CLKADS> <CLKADS>12000000</CLKADS>
<OPTTT> <OPTTT>
<gFlags>1</gFlags> <gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd> <BeepAtEnd>1</BeepAtEnd>
@ -45,7 +45,7 @@
<PageWidth>79</PageWidth> <PageWidth>79</PageWidth>
<PageLength>66</PageLength> <PageLength>66</PageLength>
<TabStop>8</TabStop> <TabStop>8</TabStop>
<ListingPath /> <ListingPath></ListingPath>
</OPTLEX> </OPTLEX>
<ListingPage> <ListingPage>
<CreateCListing>1</CreateCListing> <CreateCListing>1</CreateCListing>
@ -104,16 +104,16 @@
<bSchkAxf>0</bSchkAxf> <bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf> <bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel> <nTsel>3</nTsel>
<sDll /> <sDll></sDll>
<sDllPa /> <sDllPa></sDllPa>
<sDlgDll /> <sDlgDll></sDlgDll>
<sDlgPa /> <sDlgPa></sDlgPa>
<sIfile /> <sIfile></sIfile>
<tDll /> <tDll></tDll>
<tDllPa /> <tDllPa></tDllPa>
<tDlgDll /> <tDlgDll></tDlgDll>
<tDlgPa /> <tDlgPa></tDlgPa>
<tIfile /> <tIfile></tIfile>
<pMon>BIN\CMSIS_AGDI.dll</pMon> <pMon>BIN\CMSIS_AGDI.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
@ -140,15 +140,15 @@
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>ARMDBGFLAGS</Key> <Key>ARMDBGFLAGS</Key>
<Name /> <Name></Name>
</SetRegEntry> </SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>DLGUARM</Key> <Key>DLGUARM</Key>
<Name /> <Name></Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint /> <Breakpoint/>
<WatchWindow1> <WatchWindow1>
<Ww> <Ww>
<count>0</count> <count>0</count>
@ -218,19 +218,19 @@
<newCpu>0</newCpu> <newCpu>0</newCpu>
<uProt>0</uProt> <uProt>0</uProt>
</DebugFlag> </DebugFlag>
<LintExecutable /> <LintExecutable></LintExecutable>
<LintConfigFile /> <LintConfigFile></LintConfigFile>
<bLintAuto>0</bLintAuto> <bLintAuto>0</bLintAuto>
<bAutoGenD>0</bAutoGenD> <bAutoGenD>0</bAutoGenD>
<LntExFlags>0</LntExFlags> <LntExFlags>0</LntExFlags>
<pMisraName /> <pMisraName></pMisraName>
<pszMrule /> <pszMrule></pszMrule>
<pSingCmds /> <pSingCmds></pSingCmds>
<pMultCmds /> <pMultCmds></pMultCmds>
<pMisraNamep /> <pMisraNamep></pMisraNamep>
<pszMrulep /> <pszMrulep></pszMrulep>
<pSingCmdsp /> <pSingCmdsp></pSingCmdsp>
<pMultCmdsp /> <pMultCmdsp></pMultCmdsp>
</TargetOption> </TargetOption>
</Target> </Target>

View File

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" noNamespaceSchemaLocation="project_projx.xsd"> <Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
<SchemaVersion>2.1</SchemaVersion> <SchemaVersion>2.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header> <Header>### uVision Project, (C) Keil Software</Header>
<Targets> <Targets>
<Target> <Target>
<TargetName>motor</TargetName> <TargetName>motor</TargetName>
@ -11,33 +14,33 @@
<uAC6>0</uAC6> <uAC6>0</uAC6>
<TargetOption> <TargetOption>
<TargetCommonOption> <TargetCommonOption>
<Device>STM32F103C8</Device> <Device>CS32F103C8</Device>
<Vendor>AutoChips</Vendor> <Vendor>AutoChips</Vendor>
<PackID>Keil.CS32F1xx_DFP.1.0.0</PackID> <PackID>Keil.CS32F1xx_DFP.1.0.0</PackID>
<PackURL>http://www.keil.com/pack/</PackURL> <PackURL>http://www.keil.com/pack/</PackURL>
<Cpu>IRAM(0x20000000,0x5000) IROM(0x08000000,0x10000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu> <Cpu>IRAM(0x20000000,0x5000) IROM(0x08000000,0x10000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec /> <FlashUtilSpec></FlashUtilSpec>
<StartupFile /> <StartupFile></StartupFile>
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0CS32F10x_128 -FS08000000 -FL020000 -FP0($$Device:CS32F103C8$Flash\CS32F10x_128.FLM))</FlashDriverDll> <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0CS32F10x_128 -FS08000000 -FL020000 -FP0($$Device:CS32F103C8$Flash\CS32F10x_128.FLM))</FlashDriverDll>
<DeviceId>0</DeviceId> <DeviceId>0</DeviceId>
<RegisterFile>$$Device:CS32F103C8$Device\Include\cs32f10x.h</RegisterFile> <RegisterFile>$$Device:CS32F103C8$Device\Include\cs32f10x.h</RegisterFile>
<MemoryEnv /> <MemoryEnv></MemoryEnv>
<Cmp /> <Cmp></Cmp>
<Asm /> <Asm></Asm>
<Linker /> <Linker></Linker>
<OHString /> <OHString></OHString>
<InfinionOptionDll /> <InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc /> <SLE66CMisc></SLE66CMisc>
<SLE66AMisc /> <SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc /> <SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>$$Device:CS32F103C8$SVD\CS32F103xx.svd</SFDFile> <SFDFile>$$Device:CS32F103C8$SVD\CS32F103xx.svd</SFDFile>
<bCustSvd>0</bCustSvd> <bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv> <UseEnv>0</UseEnv>
<BinPath /> <BinPath></BinPath>
<IncludePath /> <IncludePath></IncludePath>
<LibPath /> <LibPath></LibPath>
<RegisterFilePath /> <RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath /> <DBRegisterFilePath></DBRegisterFilePath>
<TargetStatus> <TargetStatus>
<Error>0</Error> <Error>0</Error>
<ExitCodeStop>0</ExitCodeStop> <ExitCodeStop>0</ExitCodeStop>
@ -52,15 +55,15 @@
<CreateHexFile>1</CreateHexFile> <CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation> <DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation> <BrowseInformation>1</BrowseInformation>
<ListingPath /> <ListingPath></ListingPath>
<HexFormatSelection>1</HexFormatSelection> <HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K> <Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile> <CreateBatchFile>0</CreateBatchFile>
<BeforeCompile> <BeforeCompile>
<RunUserProg1>0</RunUserProg1> <RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2> <RunUserProg2>0</RunUserProg2>
<UserProg1Name /> <UserProg1Name></UserProg1Name>
<UserProg2Name /> <UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode> <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode> <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X> <nStopU1X>0</nStopU1X>
@ -69,8 +72,8 @@
<BeforeMake> <BeforeMake>
<RunUserProg1>0</RunUserProg1> <RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2> <RunUserProg2>0</RunUserProg2>
<UserProg1Name /> <UserProg1Name></UserProg1Name>
<UserProg2Name /> <UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode> <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode> <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X> <nStopB1X>0</nStopB1X>
@ -79,15 +82,15 @@
<AfterMake> <AfterMake>
<RunUserProg1>0</RunUserProg1> <RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2> <RunUserProg2>0</RunUserProg2>
<UserProg1Name /> <UserProg1Name></UserProg1Name>
<UserProg2Name /> <UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode> <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode> <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X> <nStopA1X>0</nStopA1X>
<nStopA2X>0</nStopA2X> <nStopA2X>0</nStopA2X>
</AfterMake> </AfterMake>
<SelectedForBatchBuild>1</SelectedForBatchBuild> <SelectedForBatchBuild>1</SelectedForBatchBuild>
<SVCSIdString /> <SVCSIdString></SVCSIdString>
</TargetCommonOption> </TargetCommonOption>
<CommonProperty> <CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler> <UseCPPCompiler>0</UseCPPCompiler>
@ -101,17 +104,17 @@
<AssembleAssemblyFile>0</AssembleAssemblyFile> <AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly> <PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode> <StopOnExitCode>3</StopOnExitCode>
<CustomArgument /> <CustomArgument></CustomArgument>
<IncludeLibraryModules /> <IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>0</ComprImg> <ComprImg>0</ComprImg>
</CommonProperty> </CommonProperty>
<DllOption> <DllOption>
<SimDllName>SARMCM3.DLL</SimDllName> <SimDllName>SARMCM3.DLL</SimDllName>
<SimDllArguments>-REMAP</SimDllArguments> <SimDllArguments> -REMAP</SimDllArguments>
<SimDlgDll>DCM.DLL</SimDlgDll> <SimDlgDll>DCM.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM3</SimDlgDllArguments> <SimDlgDllArguments>-pCM3</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName> <TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments /> <TargetDllArguments></TargetDllArguments>
<TargetDlgDll>TCM.DLL</TargetDlgDll> <TargetDlgDll>TCM.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments> <TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
</DllOption> </DllOption>
@ -135,11 +138,11 @@
</Flash1> </Flash1>
<bUseTDR>1</bUseTDR> <bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2> <Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3 /> <Flash3></Flash3>
<Flash4 /> <Flash4></Flash4>
<pFcarmOut /> <pFcarmOut></pFcarmOut>
<pFcarmGrp /> <pFcarmGrp></pFcarmGrp>
<pFcArmRoot /> <pFcArmRoot></pFcArmRoot>
<FcArmLst>0</FcArmLst> <FcArmLst>0</FcArmLst>
</Utilities> </Utilities>
<TargetArmAds> <TargetArmAds>
@ -172,7 +175,7 @@
<RvctClst>0</RvctClst> <RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst> <GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M3"</AdsCpuType> <AdsCpuType>"Cortex-M3"</AdsCpuType>
<RvctDeviceName /> <RvctDeviceName></RvctDeviceName>
<mOS>0</mOS> <mOS>0</mOS>
<uocRom>0</uocRom> <uocRom>0</uocRom>
<uocRam>0</uocRam> <uocRam>0</uocRam>
@ -306,7 +309,7 @@
<Size>0x0</Size> <Size>0x0</Size>
</OCR_RVCT10> </OCR_RVCT10>
</OnChipMemories> </OnChipMemories>
<RvctStartVector /> <RvctStartVector></RvctStartVector>
</ArmAdsMisc> </ArmAdsMisc>
<Cads> <Cads>
<interw>1</interw> <interw>1</interw>
@ -333,9 +336,9 @@
<v6WtE>0</v6WtE> <v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti> <v6Rtti>0</v6Rtti>
<VariousControls> <VariousControls>
<MiscControls /> <MiscControls></MiscControls>
<Define>STM32,STM32F103xB,USE_FULL_LL_DRIVER,HSE_VALUE=8000000,HSE_STARTUP_TIMEOUT=100,LSE_STARTUP_TIMEOUT=5000,LSE_VALUE=32768,HSI_VALUE=8000000,LSI_VALUE=40000,VDD_VALUE=3300,PREFETCH_ENABLE=1</Define> <Define>STM32,STM32F103xB,USE_FULL_LL_DRIVER,HSE_VALUE=8000000,HSE_STARTUP_TIMEOUT=100,LSE_STARTUP_TIMEOUT=5000,LSE_VALUE=32768,HSI_VALUE=8000000,LSI_VALUE=40000,VDD_VALUE=3300,PREFETCH_ENABLE=1</Define>
<Undefine /> <Undefine></Undefine>
<IncludePath>../Core/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../Drivers/CMSIS/Include;../User;../User/application;../User/board;../User/system/inc;../User/system/bsp;../User/lib/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/driver</IncludePath> <IncludePath>../Core/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc;../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../Drivers/CMSIS/Include;../User;../User/application;../User/board;../User/system/inc;../User/system/bsp;../User/lib/inc;../User/lib/flow;../User/lib/control/inc;../User/lib/driver</IncludePath>
</VariousControls> </VariousControls>
</Cads> </Cads>
@ -351,10 +354,10 @@
<useXO>0</useXO> <useXO>0</useXO>
<ClangAsOpt>1</ClangAsOpt> <ClangAsOpt>1</ClangAsOpt>
<VariousControls> <VariousControls>
<MiscControls /> <MiscControls></MiscControls>
<Define /> <Define></Define>
<Undefine /> <Undefine></Undefine>
<IncludePath /> <IncludePath></IncludePath>
</VariousControls> </VariousControls>
</Aads> </Aads>
<LDads> <LDads>
@ -364,15 +367,15 @@
<noStLib>0</noStLib> <noStLib>0</noStLib>
<RepFail>1</RepFail> <RepFail>1</RepFail>
<useFile>0</useFile> <useFile>0</useFile>
<TextAddressRange /> <TextAddressRange></TextAddressRange>
<DataAddressRange /> <DataAddressRange></DataAddressRange>
<pXoBase /> <pXoBase></pXoBase>
<ScatterFile /> <ScatterFile></ScatterFile>
<IncludeLibs /> <IncludeLibs></IncludeLibs>
<IncludeLibsPath /> <IncludeLibsPath></IncludeLibsPath>
<Misc /> <Misc></Misc>
<LinkerInputFile /> <LinkerInputFile></LinkerInputFile>
<DisabledWarnings /> <DisabledWarnings></DisabledWarnings>
</LDads> </LDads>
</TargetArmAds> </TargetArmAds>
</TargetOption> </TargetOption>
@ -417,6 +420,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -444,6 +449,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -465,6 +476,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -492,6 +505,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -513,6 +532,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -540,6 +561,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -561,6 +588,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -588,6 +617,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -764,6 +799,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<GroupArmAds> <GroupArmAds>
@ -791,6 +828,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
<Aads> <Aads>
<interw>2</interw> <interw>2</interw>
@ -803,6 +846,12 @@
<uSurpInc>2</uSurpInc> <uSurpInc>2</uSurpInc>
<useXO>2</useXO> <useXO>2</useXO>
<ClangAsOpt>1</ClangAsOpt> <ClangAsOpt>1</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads> </Aads>
</GroupArmAds> </GroupArmAds>
</GroupOption> </GroupOption>
@ -824,6 +873,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -851,6 +902,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -872,6 +929,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -899,6 +958,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -920,6 +985,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -947,6 +1014,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -968,6 +1041,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -995,6 +1070,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -1016,6 +1097,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -1043,6 +1126,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -1064,6 +1153,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -1091,6 +1182,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -1112,6 +1209,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -1139,6 +1238,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -1160,6 +1265,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -1187,6 +1294,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -1208,6 +1321,8 @@
<AssembleAssemblyFile>2</AssembleAssemblyFile> <AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly> <PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode> <StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg> <ComprImg>1</ComprImg>
</CommonProperty> </CommonProperty>
<FileArmAds> <FileArmAds>
@ -1235,6 +1350,12 @@
<v6Lto>2</v6Lto> <v6Lto>2</v6Lto>
<v6WtE>2</v6WtE> <v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti> <v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads> </Cads>
</FileArmAds> </FileArmAds>
</FileOption> </FileOption>
@ -1297,18 +1418,20 @@
</Groups> </Groups>
</Target> </Target>
</Targets> </Targets>
<RTE> <RTE>
<apis /> <apis/>
<components> <components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.5.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.8.0" /> <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.8.0"/>
<targetInfos> <targetInfos>
<targetInfo name="motor" /> <targetInfo name="motor"/>
</targetInfos> </targetInfos>
</component> </component>
</components> </components>
<files /> <files/>
</RTE> </RTE>
<LayerInfo> <LayerInfo>
<Layers> <Layers>
<Layer> <Layer>
@ -1317,5 +1440,5 @@
</Layer> </Layer>
</Layers> </Layers>
</LayerInfo> </LayerInfo>
</Project>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,10 @@ void board_init(void)
ssd1306_init(); ssd1306_init();
{ {
GPIO_SET(TMC2240_EN_GPIO_Port, TMC2240_EN_Pin); GPIO_RESET(TMC2240_EN_GPIO_Port, TMC2240_EN_Pin);
GPIO_SET(TMC2240_CS_GPIO_Port, TMC2240_CS_Pin);
GPIO_RESET(TMC2240_STEP_GPIO_Port, TMC2240_STEP_Pin);
GPIO_RESET(TMC2240_DIR_GPIO_Port, TMC2240_DIR_Pin);
delay_ms(100); delay_ms(100);
spi_gpio_group_t gpios; spi_gpio_group_t gpios;
gpios.cs = gpio_create(TMC2240_CS_GPIO_Port, TMC2240_CS_Pin); gpios.cs = gpio_create(TMC2240_CS_GPIO_Port, TMC2240_CS_Pin);

View File

@ -25,6 +25,17 @@ static void tmc2240_read(tmc2240_index_e index, uint8_t *wdata, uint8_t *rdata)
rdata[i] = tmc->spi->interface.u.normal.spi_send(tmc->spi, wdata[i]); rdata[i] = tmc->spi->interface.u.normal.spi_send(tmc->spi, wdata[i]);
} }
tmc->spi->gpios.cs->set(*tmc->spi->gpios.cs); tmc->spi->gpios.cs->set(*tmc->spi->gpios.cs);
__NOP();
__NOP();
__NOP();
tmc->spi->gpios.cs->reset(*tmc->spi->gpios.cs);
for (uint16_t i = 0; i < 5; i++) // 循环读取数据
{
rdata[i] = tmc->spi->interface.u.normal.spi_send(tmc->spi, wdata[i]);
}
tmc->spi->gpios.cs->set(*tmc->spi->gpios.cs);
} }
void tmc2240_init(tmc2240_index_e index, SPI_TypeDef *SPIx, spi_gpio_group_t *gpios) void tmc2240_init(tmc2240_index_e index, SPI_TypeDef *SPIx, spi_gpio_group_t *gpios)
@ -49,15 +60,10 @@ void tmc2240_config(tmc2240_index_e index)
wdata[1] = 0x00; wdata[1] = 0x00;
wdata[2] = 0x00; wdata[2] = 0x00;
wdata[3] = 0x00; wdata[3] = 0x00;
wdata[4] = 0x04; wdata[4] = 0x02;
tmc2240_write(index, wdata); tmc2240_write(index, wdata);
osel_memset(wdata, 0, 5); osel_memset(wdata, 0, 5);
__NOP(); delay_ms(100);
__NOP();
__NOP();
__NOP();
__NOP();
__NOP();
// 读取 GCONF 寄存器 // 读取 GCONF 寄存器
uint8_t rdata[5] = {0}; uint8_t rdata[5] = {0};
wdata[0] = TMC2240_REG_GCONF; wdata[0] = TMC2240_REG_GCONF;

View File

@ -42,24 +42,26 @@ Mcu.Name=STM32F103C(8-B)Tx
Mcu.Package=LQFP48 Mcu.Package=LQFP48
Mcu.Pin0=PC13-TAMPER-RTC Mcu.Pin0=PC13-TAMPER-RTC
Mcu.Pin1=PD0-OSC_IN Mcu.Pin1=PD0-OSC_IN
Mcu.Pin10=PB13 Mcu.Pin10=PB1
Mcu.Pin11=PA9 Mcu.Pin11=PB12
Mcu.Pin12=PA10 Mcu.Pin12=PB13
Mcu.Pin13=PA13 Mcu.Pin13=PA9
Mcu.Pin14=PA14 Mcu.Pin14=PA10
Mcu.Pin15=VP_SYS_VS_Systick Mcu.Pin15=PA13
Mcu.Pin16=VP_TIM1_VS_ClockSourceINT Mcu.Pin16=PA14
Mcu.Pin17=VP_TIM2_VS_ClockSourceINT Mcu.Pin17=VP_SYS_VS_Systick
Mcu.Pin18=VP_TIM3_VS_ClockSourceINT Mcu.Pin18=VP_TIM1_VS_ClockSourceINT
Mcu.Pin19=VP_TIM2_VS_ClockSourceINT
Mcu.Pin2=PD1-OSC_OUT Mcu.Pin2=PD1-OSC_OUT
Mcu.Pin20=VP_TIM3_VS_ClockSourceINT
Mcu.Pin3=PA1 Mcu.Pin3=PA1
Mcu.Pin4=PA3 Mcu.Pin4=PA3
Mcu.Pin5=PA4 Mcu.Pin5=PA4
Mcu.Pin6=PA5 Mcu.Pin6=PA5
Mcu.Pin7=PA6 Mcu.Pin7=PA6
Mcu.Pin8=PA7 Mcu.Pin8=PA7
Mcu.Pin9=PB12 Mcu.Pin9=PB0
Mcu.PinsNb=19 Mcu.PinsNb=21
Mcu.ThirdParty0=RealThread.RT-Thread.3.1.5 Mcu.ThirdParty0=RealThread.RT-Thread.3.1.5
Mcu.ThirdPartyNb=1 Mcu.ThirdPartyNb=1
Mcu.UserConstants= Mcu.UserConstants=
@ -111,6 +113,14 @@ PA7.Mode=Full_Duplex_Master
PA7.Signal=SPI1_MOSI PA7.Signal=SPI1_MOSI
PA9.Mode=Asynchronous PA9.Mode=Asynchronous
PA9.Signal=USART1_TX PA9.Signal=USART1_TX
PB0.GPIOParameters=GPIO_Label
PB0.GPIO_Label=TMC2240_STEP
PB0.Locked=true
PB0.Signal=GPIO_Output
PB1.GPIOParameters=GPIO_Label
PB1.GPIO_Label=TMC2240_DIR
PB1.Locked=true
PB1.Signal=GPIO_Output
PB12.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP PB12.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
PB12.GPIO_Label=OLED_SDA PB12.GPIO_Label=OLED_SDA
PB12.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP PB12.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
@ -195,10 +205,10 @@ RealThread.RT-Thread.3.1.5.RT_USING_DEVICE=1
RealThread.RT-Thread.3.1.5_SwParameter=RTOSJjkernel\:true;RTOSJjshell\:true;RTOSJjdevice\:true; RealThread.RT-Thread.3.1.5_SwParameter=RTOSJjkernel\:true;RTOSJjshell\:true;RTOSJjdevice\:true;
SH.S_TIM2_CH2.0=TIM2_CH2,PWM Generation2 CH2 SH.S_TIM2_CH2.0=TIM2_CH2,PWM Generation2 CH2
SH.S_TIM2_CH2.ConfNb=1 SH.S_TIM2_CH2.ConfNb=1
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_32 SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_256
SPI1.CLKPhase=SPI_PHASE_2EDGE SPI1.CLKPhase=SPI_PHASE_2EDGE
SPI1.CLKPolarity=SPI_POLARITY_HIGH SPI1.CLKPolarity=SPI_POLARITY_HIGH
SPI1.CalculateBaudRate=2.25 MBits/s SPI1.CalculateBaudRate=281.25 KBits/s
SPI1.Direction=SPI_DIRECTION_2LINES SPI1.Direction=SPI_DIRECTION_2LINES
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler,CLKPolarity,CLKPhase SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler,CLKPolarity,CLKPhase
SPI1.Mode=SPI_MODE_MASTER SPI1.Mode=SPI_MODE_MASTER