From f7412f7ada300219b4b01c302e84f3657fdc24a0 Mon Sep 17 00:00:00 2001 From: zhaohe <1013909206@qq.com> Date: Mon, 27 Dec 2021 11:34:50 +0800 Subject: [PATCH] update --- .gitattributes | 63 ----- .gitignore | 363 ----------------------------- README.md | 0 linux/.gitignore | 1 + linux/README.md | 38 +++ linux/build.sh | 1 + linux/main.c | 142 +++++++++++ release/stm32_pwm_computer.exe | Bin 0 -> 65536 bytes stm32_pwm_computer.cpp | 100 -------- stm32_pwm_computer.sln | 31 --- stm32_pwm_computer.vcxproj | 147 ------------ stm32_pwm_computer.vcxproj.filters | 22 -- windows/.gitattributes | 63 +++++ windows/.gitignore | 363 +++++++++++++++++++++++++++++ windows/README.md | 42 ++++ windows/stm32_pwm_computer.cpp | 100 ++++++++ windows/stm32_pwm_computer.sln | 31 +++ windows/stm32_pwm_computer.vcxproj | 147 ++++++++++++ windows/stm32_pwm_computer.vcxproj.filters | 22 ++ 19 files changed, 950 insertions(+), 726 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore create mode 100644 README.md create mode 100644 linux/.gitignore create mode 100644 linux/README.md create mode 100644 linux/build.sh create mode 100644 linux/main.c create mode 100644 release/stm32_pwm_computer.exe delete mode 100644 stm32_pwm_computer.cpp delete mode 100644 stm32_pwm_computer.sln delete mode 100644 stm32_pwm_computer.vcxproj delete mode 100644 stm32_pwm_computer.vcxproj.filters create mode 100644 windows/.gitattributes create mode 100644 windows/.gitignore create mode 100644 windows/README.md create mode 100644 windows/stm32_pwm_computer.cpp create mode 100644 windows/stm32_pwm_computer.sln create mode 100644 windows/stm32_pwm_computer.vcxproj create mode 100644 windows/stm32_pwm_computer.vcxproj.filters diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1ff0c42..0000000 --- a/.gitattributes +++ /dev/null @@ -1,63 +0,0 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9491a2f..0000000 --- a/.gitignore +++ /dev/null @@ -1,363 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Oo]ut/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/linux/.gitignore b/linux/.gitignore new file mode 100644 index 0000000..fa92975 --- /dev/null +++ b/linux/.gitignore @@ -0,0 +1 @@ +*.out \ No newline at end of file diff --git a/linux/README.md b/linux/README.md new file mode 100644 index 0000000..cabac63 --- /dev/null +++ b/linux/README.md @@ -0,0 +1,38 @@ + +# README + +## 编译 + +```bash +./build.sh +``` + +## 使用 + +```bash + +# Usage: ././stm32_timer_pwm_computer.out system_clk(mhz) expect_freq(khz) + +➜ stm32_timer_pwm_computer ./stm32_timer_pwm_computer.out 168 38 +systemclk : 168.000000 mhz +expect freq: 38.000000 khz +****************************************************** +* APB1: TIM2 TIM3 TIM4 TIM5 TIM6 TIM7 TIM12 TIM13 TIM14 +* +* timer_module_clk: 84.000000 mhz +* freq : 38.009051 khz +* period : 0.026310 ms +* prescaler : 0 +* autoreload : 2209 +* +** +* APB2: TIM1 TIM8 TIM9 TIM10 TIM11 +* +* timer_module_clk: 168.000000 mhz +* freq : 38.000453 khz +* period : 0.026315 ms +* prescaler : 0 +* autoreload : 4420 +*** + +``` diff --git a/linux/build.sh b/linux/build.sh new file mode 100644 index 0000000..b1800ac --- /dev/null +++ b/linux/build.sh @@ -0,0 +1 @@ +gcc main.c -o stm32_timer_pwm_computer.out \ No newline at end of file diff --git a/linux/main.c b/linux/main.c new file mode 100644 index 0000000..6739423 --- /dev/null +++ b/linux/main.c @@ -0,0 +1,142 @@ +#include +#include +#include +#if 0 +void trigger_pwm(int32_t freq, float duty, int32_t pluse_num) { + //无论怎样先停止PWM输 + HAL_TIM_PWM_Stop_IT(&htim3, TIM_CHANNEL_1); + if (freq == 0) { + LOGE("E:trigger pwm fail,freq == 0\n"); + return; + } + // 确定预分频参数,重载值 + float psc_x_arr = 90 * 1000 /*系统时钟*/ * 1000 / freq; + uint32_t psc = 0; + uint32_t arr = 65534; + for (; arr > 2; arr--) { + psc = psc_x_arr / arr; + if (psc >= 1) { + uint32_t tmparr = psc_x_arr / psc; + if (tmparr >= 65534) continue; + break; + } + } + if (psc == 0) return; + if (arr <= 3) return; //定时器一周期的分辨率太小了 + arr = psc_x_arr / psc; + + arr = arr - 1; + psc = psc - 1; + + __HAL_TIM_SET_AUTORELOAD(&htim3, arr); + __HAL_TIM_SET_PRESCALER(&htim3, psc); + // 确定PWM通道占空比 + uint16_t comparevalue = duty * arr; + __HAL_TIM_SET_COMPARE(&htim3, TIM_CHANNEL_1, comparevalue); + if (pluse_num == 0) { + g_continue_output_mode = true; + } else { + g_pulse_num = pluse_num - 1; + g_continue_output_mode = false; + } + __HAL_TIM_SET_COUNTER(&htim3, 0); + LOGD("a[%d] p[%d]c[%d]\r\n", arr, psc, comparevalue); + HAL_TIM_PWM_Start_IT(&htim3, TIM_CHANNEL_1); +} +#endif + +typedef struct +{ + int autoreload; + int prescaler; + float realfreq; +} timer_config_t; + +bool compute_timer_parameter(timer_config_t *config, int timer_in_clk /*mhz*/, int infreq /*hz*/) +{ + float psc_x_arr = timer_in_clk * 1000 /*定时器模块时钟*/ * 1000 / infreq; + uint32_t psc = 0; + uint32_t arr = 65534; + for (; arr > 2; arr--) + { + psc = psc_x_arr / arr; + if (psc >= 1) + { + uint32_t tmparr = psc_x_arr / psc; + if (tmparr >= 65534) + continue; + break; + } + } + if (psc == 0) + return false; + if (arr <= 3) + return false; //定时器一周期的分辨率太小了 + + arr = psc_x_arr / psc; + + int psc_x_arr_real = arr * psc; + float realfreq = timer_in_clk * 1000.0 /*定时器模块时钟*/ * 1000 / psc_x_arr_real; + + arr = arr - 1; + psc = psc - 1; + + config->autoreload = arr; + config->prescaler = psc; + config->realfreq = realfreq; + // config->compare = arr / 2; + + return false; +} + +void dumpconfig_info(timer_config_t *config) +{ + printf("* freq : %f \n", config->realfreq); + printf("* prescaler : %d \n", config->prescaler); + printf("* autoreload: %d \n", config->autoreload); +} + +int main(int argc, char const *argv[]) +{ + if (argc != 3) + { + printf("%s system_clk mhz expect_freq khz\n", argv[0]); + return -1; + } + + float expect_freq = 0; + float systemclk = 0; + sscanf(argv[1], "%f", &systemclk); + sscanf(argv[2], "%f", &expect_freq); + printf("systemclk : %f mhz\n", systemclk); + printf("expect freq: %f khz\n", expect_freq); + + int32_t infreq = (int32_t)(expect_freq * 1000); + timer_config_t timerconfig_apb1; + timer_config_t timerconfig_apb2; + + //apb1 + compute_timer_parameter(&timerconfig_apb1, systemclk / 2, infreq); + //apb2 + compute_timer_parameter(&timerconfig_apb2, systemclk, infreq); + + printf("******************************************************\n"); + printf("* APB1: TIM2 TIM3 TIM4 TIM5 TIM6 TIM7 TIM12 TIM13 TIM14\n"); + printf("*\n"); + printf("* timer_module_clk: %f mhz\n", systemclk / 2); + printf("* freq : %f khz\n", timerconfig_apb1.realfreq / 1000.0); + printf("* period : %f ms\n", (1.0 / timerconfig_apb1.realfreq * 1000)); + printf("* prescaler : %d \n", timerconfig_apb1.prescaler); + printf("* autoreload : %d \n", timerconfig_apb1.autoreload); + printf("*\n"); + printf("**\n"); + printf("* APB2: TIM1 TIM8 TIM9 TIM10 TIM11\n"); + printf("*\n"); + printf("* timer_module_clk: %f mhz\n", systemclk); + printf("* freq : %f khz\n", timerconfig_apb2.realfreq / 1000.0); + printf("* period : %f ms\n", (1.0 / timerconfig_apb2.realfreq * 1000)); + printf("* prescaler : %d \n", timerconfig_apb2.prescaler); + printf("* autoreload : %d \n", timerconfig_apb2.autoreload); + printf("***\n"); + return 0; +} diff --git a/release/stm32_pwm_computer.exe b/release/stm32_pwm_computer.exe new file mode 100644 index 0000000000000000000000000000000000000000..3ccb889e9980835c120b66a34353070aa9dd8f7f GIT binary patch literal 65536 zcmeHQ3w#vS)xVSMCQC@z2tWRXZ`(qWC~<-S29LbTC?0m!L&MnpL!KDjCODrM zU0Pk^7rnlQl|FZ!SmCa(ZwQDhJfbgHFV@tHj*AzHbq$rC$!TdRHcj-wEAAI>&wtUc zUj-MvQ+rZ%~z8`V;0;g|W@{(^0=YPrn5@0>}e!^jvUxf#GenCw|HOY*( zz*WRp<#$rpoay`Adf6d1h7C;^b|(7{DA%ggtA`7WrE}a4OvMuzOHzv?ka zs8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j4krP=*6?&_Wp<6SxA$BQo}T-DZ`Q zb9&g5ss{C*HFPYc2PXw_9e5X!P7}=-X%*geWjJmuo8#^P;nn2TKxIsC`qkb<;jVst zLZiXg&#O3@kW>rM5slC*#tN-OKM9PzNq+KF-~@!SewB8?7K|;`M%JO{%B~F7RIE~+ z!!9yY2h`MqiQS%9wx-U#%HzcVAnn_b_j_?PpGK%Ouc`2BRt6z?g&XHT@^PG%fC(~J zom{2d$HkR+IgnWF=ch2N^!QwKN*V@6wP}I7#*g!wXwLFOus%vG!C{RxbJhhsr437J zDm^$r(8o?n($Ug}NI84Xv>;GB*X<2pM9$Ub=*vWNHZ-gXdgo~;Ll)Hsd^r5+uT-+Q z#uvc(f{W_uYzUlcYhF~ZhLp;P4w%z$0%O;i7kUCmEf!;Jbom-8aI_lxskv15o=#$$ zV6~QM@XhnMNmt$a1txxEmCNJ9NrH9m`U+Tq;>IR1smXoam{?fzCK*wP4($(s`5e z#)mY!)&K#wWn6BrLaH%<)J z6jsnevS3`5yVma+Cr*jT$)9rcR`RFx(nL+x)AQ>L`f9-*-_zn*T zr2pK0hwIL+doA0g?HjjS?#sL{`@X#UEdRrH;F~tecWiCj+P<}GYxmZJTifnxzpLx6 z?z;}&)qZ!^-5c-Sdhgx$O50uAmu@fL&f0N~2>7Kt*51YJ3H -#include -#include - -typedef struct -{ - int autoreload; - int prescaler; - float realfreq; -} timer_config_t; - -bool compute_timer_parameter(timer_config_t* config, int timer_in_clk /*mhz*/, int infreq /*hz*/) -{ - float psc_x_arr =(float) timer_in_clk * 1000 /*定时器模块时钟*/ * 1000 / infreq; - uint32_t psc = 0; - uint32_t arr = 65534; - for (; arr > 2; arr--) - { - psc =(uint32_t)( psc_x_arr / arr); - if (psc >= 1) - { - uint32_t tmparr = psc_x_arr / psc; - if (tmparr >= 65534) - continue; - break; - } - } - if (psc == 0) - return false; - if (arr <= 3) - return false; //定时器一周期的分辨率太小了 - arr = psc_x_arr / psc; - - int psc_x_arr_real = arr * psc; - float realfreq = timer_in_clk * 1000.0 /*定时器模块时钟*/ * 1000 / psc_x_arr_real; - - arr = arr - 1; - psc = psc - 1; - - config->autoreload = arr; - config->prescaler = psc; - config->realfreq = realfreq; - // config->compare = arr / 2; - return false; -} - -void dumpconfig_info(timer_config_t* config) -{ - printf("* freq : %f \n", config->realfreq); - printf("* prescaler : %d \n", config->prescaler); - printf("* autoreload: %d \n", config->autoreload); -} - -int main(int argc, char const* argv[]) -{ - if (argc != 3) - { - printf("%s system_clk mhz expect_freq khz\n", argv[0]); - return -1; - } - - float expect_freq = 0; - float systemclk = 0; - - sscanf(argv[1], "%f", &systemclk); - sscanf(argv[2], "%f", &expect_freq); - - printf("systemclk : %f mhz\n", systemclk); - printf("expect freq: %f khz\n", expect_freq); - - int32_t infreq = (int32_t)(expect_freq * 1000); - timer_config_t timerconfig_apb1; - timer_config_t timerconfig_apb2; - - //apb1 - compute_timer_parameter(&timerconfig_apb1, systemclk / 2, infreq); - //apb2 - compute_timer_parameter(&timerconfig_apb2, systemclk, infreq); - - printf("******************************************************\n"); - printf("* APB1: TIM2 TIM3 TIM4 TIM5 TIM6 TIM7 TIM12 TIM13 TIM14\n"); - printf("*\n"); - printf("* timer_module_clk: %f mhz\n", systemclk / 2); - printf("* freq : %f khz\n", timerconfig_apb1.realfreq / 1000.0); - printf("* period : %f ms\n", (1.0 / timerconfig_apb1.realfreq * 1000)); - printf("* prescaler : %d \n", timerconfig_apb1.prescaler); - printf("* autoreload : %d \n", timerconfig_apb1.autoreload); - printf("*\n"); - printf("**\n"); - printf("* APB2: TIM1 TIM8 TIM9 TIM10 TIM11\n"); - printf("*\n"); - printf("* timer_module_clk: %f mhz\n", systemclk); - printf("* freq : %f khz\n", timerconfig_apb2.realfreq / 1000.0); - printf("* period : %f ms\n", (1.0 / timerconfig_apb2.realfreq * 1000)); - printf("* prescaler : %d \n", timerconfig_apb2.prescaler); - printf("* autoreload : %d \n", timerconfig_apb2.autoreload); - printf("***\n"); - return 0; -} \ No newline at end of file diff --git a/stm32_pwm_computer.sln b/stm32_pwm_computer.sln deleted file mode 100644 index 31d04d5..0000000 --- a/stm32_pwm_computer.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.32014.148 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stm32_pwm_computer", "stm32_pwm_computer.vcxproj", "{855C915D-29AE-4273-80AA-3374E8B9803F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x64.ActiveCfg = Debug|x64 - {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x64.Build.0 = Debug|x64 - {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x86.ActiveCfg = Debug|Win32 - {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x86.Build.0 = Debug|Win32 - {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x64.ActiveCfg = Release|x64 - {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x64.Build.0 = Release|x64 - {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x86.ActiveCfg = Release|Win32 - {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F94697A8-537D-4F75-9A90-2916196874F0} - EndGlobalSection -EndGlobal diff --git a/stm32_pwm_computer.vcxproj b/stm32_pwm_computer.vcxproj deleted file mode 100644 index 88604b0..0000000 --- a/stm32_pwm_computer.vcxproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {855c915d-29ae-4273-80aa-3374e8b9803f} - stm32pwmcomputer - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/stm32_pwm_computer.vcxproj.filters b/stm32_pwm_computer.vcxproj.filters deleted file mode 100644 index 70724f6..0000000 --- a/stm32_pwm_computer.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - 源文件 - - - \ No newline at end of file diff --git a/windows/.gitattributes b/windows/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/windows/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/windows/.gitignore b/windows/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/windows/.gitignore @@ -0,0 +1,363 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/windows/README.md b/windows/README.md new file mode 100644 index 0000000..2d88757 --- /dev/null +++ b/windows/README.md @@ -0,0 +1,42 @@ + +# README + +## TODO + +支持windows图形界面 + +## 编译 + +```bash +./build.sh +``` + +## 使用 + +```bash + +# Usage: ././stm32_timer_pwm_computer.out system_clk(mhz) expect_freq(khz) + +➜ stm32_timer_pwm_computer ./stm32_timer_pwm_computer.out 168 38 +systemclk : 168.000000 mhz +expect freq: 38.000000 khz +****************************************************** +* APB1: TIM2 TIM3 TIM4 TIM5 TIM6 TIM7 TIM12 TIM13 TIM14 +* +* timer_module_clk: 84.000000 mhz +* freq : 38.009051 khz +* period : 0.026310 ms +* prescaler : 0 +* autoreload : 2209 +* +** +* APB2: TIM1 TIM8 TIM9 TIM10 TIM11 +* +* timer_module_clk: 168.000000 mhz +* freq : 38.000453 khz +* period : 0.026315 ms +* prescaler : 0 +* autoreload : 4420 +*** + +``` diff --git a/windows/stm32_pwm_computer.cpp b/windows/stm32_pwm_computer.cpp new file mode 100644 index 0000000..804258d --- /dev/null +++ b/windows/stm32_pwm_computer.cpp @@ -0,0 +1,100 @@ +#define _CRT_SECURE_NO_DEPRECATE +#include +#include +#include + +typedef struct +{ + int autoreload; + int prescaler; + float realfreq; +} timer_config_t; + +bool compute_timer_parameter(timer_config_t* config, int timer_in_clk /*mhz*/, int infreq /*hz*/) +{ + float psc_x_arr =(float) timer_in_clk * 1000 /*定时器模块时钟*/ * 1000 / infreq; + uint32_t psc = 0; + uint32_t arr = 65534; + for (; arr > 2; arr--) + { + psc =(uint32_t)( psc_x_arr / arr); + if (psc >= 1) + { + uint32_t tmparr = psc_x_arr / psc; + if (tmparr >= 65534) + continue; + break; + } + } + if (psc == 0) + return false; + if (arr <= 3) + return false; //定时器一周期的分辨率太小了 + arr = psc_x_arr / psc; + + int psc_x_arr_real = arr * psc; + float realfreq = timer_in_clk * 1000.0 /*定时器模块时钟*/ * 1000 / psc_x_arr_real; + + arr = arr - 1; + psc = psc - 1; + + config->autoreload = arr; + config->prescaler = psc; + config->realfreq = realfreq; + // config->compare = arr / 2; + return false; +} + +void dumpconfig_info(timer_config_t* config) +{ + printf("* freq : %f \n", config->realfreq); + printf("* prescaler : %d \n", config->prescaler); + printf("* autoreload: %d \n", config->autoreload); +} + +int main(int argc, char const* argv[]) +{ + if (argc != 3) + { + printf("%s system_clk mhz expect_freq khz\n", argv[0]); + return -1; + } + + float expect_freq = 0; + float systemclk = 0; + + sscanf(argv[1], "%f", &systemclk); + sscanf(argv[2], "%f", &expect_freq); + + printf("systemclk : %f mhz\n", systemclk); + printf("expect freq: %f khz\n", expect_freq); + + int32_t infreq = (int32_t)(expect_freq * 1000); + timer_config_t timerconfig_apb1; + timer_config_t timerconfig_apb2; + + //apb1 + compute_timer_parameter(&timerconfig_apb1, systemclk / 2, infreq); + //apb2 + compute_timer_parameter(&timerconfig_apb2, systemclk, infreq); + + printf("******************************************************\n"); + printf("* APB1: TIM2 TIM3 TIM4 TIM5 TIM6 TIM7 TIM12 TIM13 TIM14\n"); + printf("*\n"); + printf("* timer_module_clk: %f mhz\n", systemclk / 2); + printf("* freq : %f khz\n", timerconfig_apb1.realfreq / 1000.0); + printf("* period : %f ms\n", (1.0 / timerconfig_apb1.realfreq * 1000)); + printf("* prescaler : %d \n", timerconfig_apb1.prescaler); + printf("* autoreload : %d \n", timerconfig_apb1.autoreload); + printf("*\n"); + printf("**\n"); + printf("* APB2: TIM1 TIM8 TIM9 TIM10 TIM11\n"); + printf("*\n"); + printf("* timer_module_clk: %f mhz\n", systemclk); + printf("* freq : %f khz\n", timerconfig_apb2.realfreq / 1000.0); + printf("* period : %f ms\n", (1.0 / timerconfig_apb2.realfreq * 1000)); + printf("* prescaler : %d \n", timerconfig_apb2.prescaler); + printf("* autoreload : %d \n", timerconfig_apb2.autoreload); + printf("***\n"); + return 0; +} \ No newline at end of file diff --git a/windows/stm32_pwm_computer.sln b/windows/stm32_pwm_computer.sln new file mode 100644 index 0000000..31d04d5 --- /dev/null +++ b/windows/stm32_pwm_computer.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stm32_pwm_computer", "stm32_pwm_computer.vcxproj", "{855C915D-29AE-4273-80AA-3374E8B9803F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x64.ActiveCfg = Debug|x64 + {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x64.Build.0 = Debug|x64 + {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x86.ActiveCfg = Debug|Win32 + {855C915D-29AE-4273-80AA-3374E8B9803F}.Debug|x86.Build.0 = Debug|Win32 + {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x64.ActiveCfg = Release|x64 + {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x64.Build.0 = Release|x64 + {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x86.ActiveCfg = Release|Win32 + {855C915D-29AE-4273-80AA-3374E8B9803F}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F94697A8-537D-4F75-9A90-2916196874F0} + EndGlobalSection +EndGlobal diff --git a/windows/stm32_pwm_computer.vcxproj b/windows/stm32_pwm_computer.vcxproj new file mode 100644 index 0000000..88604b0 --- /dev/null +++ b/windows/stm32_pwm_computer.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {855c915d-29ae-4273-80aa-3374e8b9803f} + stm32pwmcomputer + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/windows/stm32_pwm_computer.vcxproj.filters b/windows/stm32_pwm_computer.vcxproj.filters new file mode 100644 index 0000000..70724f6 --- /dev/null +++ b/windows/stm32_pwm_computer.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file