資源簡介
之前自己看別人的編碼器代碼,自己仿照寫,但一直出不來,因為自己用的編碼器不是AB相的,直接輸出脈沖和方向,不用兩相比較,遇到各種問題,拋棄使用定時器的編碼器模式,說實話沒看懂編碼器模式到底是怎么用的,后來用ETR進行脈沖計數,然后設置定時器中斷,進行定時采集。

代碼片段和文件信息
/**************************************************************************//**
?*?@file?????core_cm3.c
?*?@brief????CMSIS?Cortex-M3?Core?Peripheral?Access?layer?Source?File
?*?@version??V1.30
?*?@date?????30.?October?2009
?*
?*?@note
?*?Copyright?(C)?2009?ARM?Limited.?All?rights?reserved.
?*
?*?@par
?*?ARM?Limited?(ARM)?is?supplying?this?software?for?use?with?Cortex-M?
?*?processor?based?microcontrollers.??This?file?can?be?freely?distributed?
?*?within?development?tools?that?are?supporting?such?ARM?based?processors.?
?*
?*?@par
?*?THIS?SOFTWARE?IS?PROVIDED?“AS?IS“.??NO?WARRANTIES?WHETHER?EXPRESS?IMPLIED
?*?OR?STATUTORY?INCLUDING?BUT?NOT?LIMITED?TO?IMPLIED?WARRANTIES?OF
?*?MERCHANTABILITY?AND?FITNESS?FOR?A?PARTICULAR?PURPOSE?APPLY?TO?THIS?SOFTWARE.
?*?ARM?SHALL?NOT?IN?ANY?CIRCUMSTANCES?BE?LIABLE?FOR?SPECIAL?INCIDENTAL?OR
?*?CONSEQUENTIAL?DAMAGES?FOR?ANY?REASON?WHATSOEVER.
?*
?******************************************************************************/
#include?
/*?define?compiler?specific?symbols?*/
#if?defined?(?__CC_ARM???)
??#define?__ASM????????????__asm??????????????????????????????????????/*!??#define?__INLINE?????????__inline???????????????????????????????????/*!
#elif?defined?(?__ICCARM__?)
??#define?__ASM???????????__asm???????????????????????????????????????/*!??#define?__INLINE????????inline??????????????????????????????????????/*!
#elif?defined???(??__GNUC__??)
??#define?__ASM????????????__asm??????????????????????????????????????/*!??#define?__INLINE?????????inline?????????????????????????????????????/*!
#elif?defined???(??__TASKING__??)
??#define?__ASM????????????__asm??????????????????????????????????????/*!??#define?__INLINE?????????inline?????????????????????????????????????/*!
#endif
/*?###################??Compiler?specific?Intrinsics??###########################?*/
#if?defined?(?__CC_ARM???)?/*------------------RealView?Compiler?-----------------*/
/*?ARM?armcc?specific?functions?*/
/**
?*?@brief??Return?the?Process?Stack?Pointer
?*
?*?@return?ProcessStackPointer
?*
?*?Return?the?actual?process?stack?pointer
?*/
__ASM?uint32_t?__get_PSP(void)
{
??mrs?r0?psp
??bx?lr
}
/**
?*?@brief??Set?the?Process?Stack?Pointer
?*
?*?@param??topOfProcStack??Process?Stack?Pointer
?*
?*?Assign?the?value?ProcessStackPointer?to?the?MSP?
?*?(process?stack?pointer)?Cortex?processor?register
?*/
__ASM?void?__set_PSP(uint32_t?topOfProcStack)
{
??msr?psp?r0
??bx?lr
}
/**
?*?@brief??Return?the?Main?Stack?Pointer
?*
?*?@return?Main?Stack?Pointer
?*
?*?Return?the?curren
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-04-24?15:28??001\
?????目錄???????????0??2018-04-24?15:28??001\core\
?????文件???????17273??2010-06-07?10:25??001\core\core_cm3.c
?????文件???????85714??2011-02-09?14:59??001\core\core_cm3.h
?????文件???????15503??2011-03-10?10:52??001\core\startup_stm32f10x_hd.s
?????目錄???????????0??2018-04-24?15:28??001\hardware\
?????文件????????1545??2018-04-21?21:35??001\hardware\deal.c
?????文件?????????257??2018-04-21?21:35??001\hardware\deal.h
?????文件????????3001??2018-04-24?10:47??001\hardware\encoder.c
?????文件?????????278??2018-04-24?10:41??001\hardware\encoder.h
?????文件????????1295??2018-04-23?08:25??001\hardware\exti.c
?????文件?????????125??2018-04-20?17:07??001\hardware\exti.h
?????文件????????1977??2017-07-28?17:45??001\hardware\key.c
?????文件????????1013??2017-07-27?16:46??001\hardware\key.h
?????文件?????????505??2018-04-21?10:57??001\hardware\led.c
?????文件?????????117??2018-04-21?10:57??001\hardware\led.h
?????文件????????2139??2018-04-21?21:05??001\hardware\ocsctl.c
?????文件?????????217??2014-07-09?19:15??001\hardware\ocsctl.h
?????文件????????1752??2018-04-21?21:15??001\hardware\printf.c
?????文件????????1544??2018-04-23?09:30??001\hardware\pwm.c
?????文件?????????105??2018-04-21?19:11??001\hardware\pwm.h
?????文件????????2752??2018-04-21?21:35??001\hardware\usart1.c
?????文件?????????242??2018-04-21?21:35??001\hardware\usart1.h
?????目錄???????????0??2018-04-24?15:28??001\stm32f10x_fwlib\
?????目錄???????????0??2018-04-24?15:28??001\stm32f10x_fwlib\inc\
?????文件????????8982??2011-03-10?10:47??001\stm32f10x_fwlib\inc\misc.h
?????文件???????21690??2011-03-10?10:47??001\stm32f10x_fwlib\inc\stm32f10x_adc.h
?????文件????????7555??2011-03-10?10:47??001\stm32f10x_fwlib\inc\stm32f10x_bkp.h
?????文件???????27559??2011-03-10?10:47??001\stm32f10x_fwlib\inc\stm32f10x_can.h
?????文件????????6573??2011-03-10?10:47??001\stm32f10x_fwlib\inc\stm32f10x_cec.h
?????文件????????2162??2011-03-10?10:47??001\stm32f10x_fwlib\inc\stm32f10x_crc.h
............此處省略148個文件信息
- 上一篇:城市生長插件的使用方法附插件
- 下一篇:Multisim恒流源電路仿真
評論
共有 條評論