資源簡介
使用DMA映射SPI,發現非常好用,節省不少CPU資源,SPI操作智能插座例程,統計電量、功率、電壓等

代碼片段和文件信息
/**
??******************************************************************************
??*?@file????system_stm32f0xx.c
??*?@author??MCD?Application?Team
??*?@version?V1.4.0
??*?@date????24-July-2014
??*?@brief???CMSIS?Cortex-M0?Device?Peripheral?Access?layer?System?Source?File.
??*??????????This?file?contains?the?system?clock?configuration?for?STM32F0xx?devices
??*??????????and?is?generated?by?the?clock?configuration?tool??
??*??????????STM32F0xx_Clock_Configuration_V1.0.1.xls
??*
??*?1.??This?file?provides?two?functions?and?one?global?variable?to?be?called?from?
??*?????user?application:
??*??????-?SystemInit():?Setups?the?system?clock?(System?clock?source?PLL?Multiplier
??*??????????????????????and?Divider?factors?AHB/APBx?prescalers?and?Flash?settings)
??*??????????????????????depending?on?the?configuration?made?in?the?clock?xls?tool.
??*??????????????????????This?function?is?called?at?startup?just?after?reset?and?
??*??????????????????????before?branch?to?main?program.?This?call?is?made?inside
??*??????????????????????the?“startup_stm32f0xx.s“?file.
??*
??*??????-?SystemCoreClock?variable:?Contains?the?core?clock?(HCLK)?it?can?be?used
??*??????????????????????????????????by?the?user?application?to?setup?the?SysTick?
??*??????????????????????????????????timer?or?configure?other?parameters.
??*
??*??????-?SystemCoreClockUpdate():?Updates?the?variable?SystemCoreClock?and?must
??*?????????????????????????????????be?called?whenever?the?core?clock?is?changed
??*?????????????????????????????????during?program?execution.
??*
??*?2.?After?each?device?reset?the?HSI?(8?MHz?Range)?is?used?as?system?clock?source.
??*????Then?SystemInit()?function?is?called?in?“startup_stm32f0xx.s“?file?to
??*????configure?the?system?clock?before?to?branch?to?main?program.
??*
??*?3.?If?the?system?clock?source?selected?by?user?fails?to?startup?the?SystemInit()
??*????function?will?do?nothing?and?HSI?still?used?as?system?clock?source.?User?can?
??*????add?some?code?to?deal?with?this?issue?inside?the?SetSysClock()?function.
??*
??*?4.?The?default?value?of?HSE?crystal?is?set?to?8MHz?refer?to?“HSE_VALUE“?define
??*????in?“stm32f0xx.h“?file.?When?HSE?is?used?as?system?clock?source?directly?or
??*????through?PLL?and?you?are?using?different?crystal?you?have?to?adapt?the?HSE
??*????value?to?your?own?configuration.
??*
??*?5.?This?file?configures?the?system?clock?as?follows:
??*=============================================================================
??*=============================================================================
??*????????System?Clock?source????????????????????|?PLL(HSE)
??*-----------------------------------------------------------------------------
??*????????SYSCLK(Hz)?????????????????????????????|?48000000
??*-----------------------------------------------------------------------------
??*????????HCLK(Hz)???????????????????????????????|?48000000
??*--------------------------------------------------
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4676??2015-02-11?10:19??NewPlug\Cmsis\Core\arm_common_tables.h
?????文件???????3666??2015-02-11?10:19??NewPlug\Cmsis\Core\arm_const_structs.h
?????文件?????242444??2015-02-11?10:19??NewPlug\Cmsis\Core\arm_math.h
?????文件??????33042??2015-02-11?10:19??NewPlug\Cmsis\Core\core_cm0.h
?????文件??????40429??2015-02-11?10:19??NewPlug\Cmsis\Core\core_cm0plus.h
?????文件??????99832??2015-02-11?10:19??NewPlug\Cmsis\Core\core_cm3.h
?????文件?????109142??2015-02-11?10:19??NewPlug\Cmsis\Core\core_cm4.h
?????文件??????22735??2015-02-11?10:19??NewPlug\Cmsis\Core\core_cm4_simd.h
?????文件??????17146??2015-02-11?10:19??NewPlug\Cmsis\Core\core_cmFunc.h
?????文件??????20513??2015-02-11?10:19??NewPlug\Cmsis\Core\core_cmInstr.h
?????文件??????41744??2015-02-11?10:19??NewPlug\Cmsis\Core\core_sc000.h
?????文件??????98211??2015-02-11?10:19??NewPlug\Cmsis\Core\core_sc300.h
?????文件??????11308??2015-08-29?16:49??NewPlug\Cmsis\Startup\startup_stm32f051.s
?????文件?????449861??2015-02-11?10:19??NewPlug\Cmsis\Startup\stm32f0xx.h
?????文件??????12586??2015-02-11?10:19??NewPlug\Cmsis\Startup\system_stm32f0xx.c
?????文件???????2219??2015-02-11?10:19??NewPlug\Cmsis\Startup\system_stm32f0xx.h
?????文件????1179648??2016-02-25?17:01??NewPlug\CodeView\NewPlug.IAB
?????文件??????11848??2016-02-25?17:01??NewPlug\CodeView\NewPlug.IAD
?????文件?????315392??2015-10-16?11:41??NewPlug\CodeView\NewPlug.IMB
?????文件???????3408??2016-01-14?11:25??NewPlug\CodeView\NewPlug.IMD
?????文件????????352??2017-03-16?12:07??NewPlug\CodeView\NewPlug.PFI
?????文件????????776??2017-03-16?12:07??NewPlug\CodeView\NewPlug.PO
?????文件??????27968??2016-07-19?14:33??NewPlug\CodeView\NewPlug.PR
?????文件?????178624??2016-07-19?14:33??NewPlug\CodeView\NewPlug.PRI
?????文件????2223096??2016-07-19?15:35??NewPlug\CodeView\NewPlug.PS
?????文件????????351??2016-12-02?14:59??NewPlug\CodeView\NewPlug.SearchResults
?????文件??????74167??2017-03-16?15:27??NewPlug\CodeView\NewPlug.WK3
?????文件??????21116??2015-02-11?10:19??NewPlug\Library\inc\stm32f0xx_adc.h
?????文件??????27294??2015-02-11?10:19??NewPlug\Library\inc\stm32f0xx_can.h
?????文件??????12416??2015-02-11?10:19??NewPlug\Library\inc\stm32f0xx_cec.h
............此處省略191個文件信息
- 上一篇:管理學 羅斯賓 中文版
- 下一篇:PN532讀寫CUID
評論
共有 條評論