实例介绍
【实例简介】
【实例截图】
【核心代码】
目录 TM4C 库函数指南 ..................................................................................................................................... 1 1 编程模型.............................................................................................................................................. 1 1.1 概述...................................................................................................................................... 1 1.2 直接寄存器访问模型...................................................................................................... 1 1.3 软件驱动模式................................................................................................................... 3 2 GPIO 模块............................................................................................................................................ 4 2.1 概述...................................................................................................................................... 4 2.2 API 函数.............................................................................................................................. 4 2.2.1 详细说明.................................................................................................................... 6 2.2.2 函数功能.................................................................................................................... 6 2.2.2.1 GPIOADCTriggerDisable.............................................................................. 6 2.2.2.2 GPIOADCTriggerEnable............................................................................... 7 2.2.2.3 GPIODirModeGet........................................................................................... 7 2.2.2.4 GPIODirModeSet............................................................................................ 8 2.2.2.5 GPIODMATriggerDisable............................................................................. 8 2.2.2.6 GPIODMATriggerEnable.............................................................................. 9 2.2.2.7 GPIOIntClear.................................................................................................... 9 2.2.2.8 GPIOIntDisable..............................................................................................10 2.2.2.9 GPIOIntEnable...............................................................................................11 2.2.2.10 GPIOIntRegister...................................................................................11 2.2.2.11 GPIOIntStatus .......................................................................................12 2.2.2.12 GPIOIntTypeGet...................................................................................12 2.2.2.13 GPIOIntTypeSet....................................................................................13 2.2.2.14 GPIOIntUnregister...............................................................................14 2.2.2.15 GPIOPadConfigGet...........................................................................14 2.2.2.16 GPIOPadConfigSet.............................................................................15 编程模型 2016-5-8 2 TIVA 库函数指南 2.2.2.17 GPIOPinConfigure.............................................................................16 2.2.2.18 GPIOPinRead ........................................................................................16 2.2.2.19 GPIOPinTypeADC................................................................................17 2.2.2.20 GPIOPinTypeCAN................................................................................17 2.2.2.21 GPIOPinTypeComparator.................................................................18 2.2.2.22 GPIOPinTypeEPI...................................................................................18 2.2.2.23 GPIOPinTypeEthernetLED.................................................................19 2.2.2.24 GPIOPinTypeEthernetMII..................................................................19 2.2.2.25 GPIOPinTypeFan..................................................................................20 2.2.2.26 GPIOPinTypeGPIOInput....................................................................20 2.2.2.27 GPIOPinTypeGPIOOutput ................................................................21 2.2.2.28 GPIOPinTypeGPIOOutputOD..........................................................21 2.2.2.29 GPIOPinTypeI2C ..................................................................................22 2.2.2.30 GPIOPinTypeI2CSCL...........................................................................22 2.2.2.31 GPIOPinTypeLPC.................................................................................23 2.2.2.32 GPIOPinTypePECIRx ...........................................................................23 2.2.2.33 GPIOPinTypePECITx............................................................................24 2.2.2.34 GPIOPinTypePWM..............................................................................24 2.2.2.35 GPIOPinTypeQEI..................................................................................25 2.2.2.36 GPIOPinTypeSSI...................................................................................25 2.2.2.37 GPIOPinTypeTimer..............................................................................26 2.2.2.38 GPIOPinTypeUART..............................................................................26 2.2.2.39 GPIOPinTypeUSBAnalog...................................................................27 2.2.2.40 GPIOPinTypeUSBDigital ....................................................................28 2.2.2.41 GPIOPinWrite........................................................................................29 2.3 编程举例 ..........................................................................................................................29 3 系统控制模块...................................................................................................................................31 3.1 概述....................................................................................................................................31 目录 2016-5-8 3 TIVA 库函数指南 3.2 API 函数...........................................................................................................................32 3.2.1 详细说明..................................................................................................................33 3.2.2 函数功能..................................................................................................................34 3.2.2.1 SysCtlADCSpeedGet ...................................................................................34 3.2.2.2 SysCtlADCSpeedSet....................................................................................34 3.2.2.3 SysCtlClockGet..............................................................................................35 3.2.2.4 SysCtlClockSet...............................................................................................35 3.2.2.5 SysCtlDeepSleep ..........................................................................................37 3.2.2.6 SysCtlDeepSleepClockSet .........................................................................37 3.2.2.7 SysCtlDelay.....................................................................................................38 3.2.2.8 SysCtlFlashSizeGet.......................................................................................38 3.2.2.9 SysCtlGPIOAHBDisable ..............................................................................38 3.2.2.10 SysCtlGPIOAHBEnable.......................................................................39 3.2.2.11 SysCtlIntClear........................................................................................40 3.2.2.12 SysCtlIntDisable ...................................................................................40 3.2.2.13 SysCtlIntEnable.....................................................................................41 3.2.2.14 SysCtlIntRegister..................................................................................41 3.2.2.15 SysCtlIntStatus......................................................................................42 3.2.2.16 SysCtlIntUnregister .............................................................................43 3.2.2.17 SysCtlMOSCConfigSet.......................................................................43 3.2.2.18 SysCtlPeripheralClockGating ...........................................................44 3.2.2.19 SysCtlPeripheralDeepSleepDisable ...............................................44 3.2.2.20 SysCtlPeripheralDeepSleepEnable.................................................45 3.2.2.21 SysCtlPeripheralDisable.....................................................................46 3.2.2.22 SysCtlPeripheralEnable......................................................................47 3.2.2.23 SysCtlPeripheralPowerOff.................................................................48 3.2.2.24 SysCtlPeripheralPowerOn.................................................................49 3.2.2.25 SysCtlPeripheralPresent ....................................................................50 编程模型 2016-5-8 4 TIVA 库函数指南 3.2.2.26 SysCtlPeripheralReady.......................................................................51 3.2.2.27 SysCtlPeripheralReset ........................................................................52 3.2.2.28 SysCtlPeripheralSleepDisable..........................................................53 3.2.2.29 SysCtlPeripheralSleepEnable...........................................................54 3.2.2.30 SysCtlPIOSCCalibrate.........................................................................55 3.2.2.31 SysCtlPWMClockGet...........................................................................56 3.2.2.32 SysCtlReset............................................................................................57 3.2.2.33 SysCtlResetCauseClear......................................................................57 3.2.2.34 SysCtlResetCauseGet .........................................................................58 3.2.2.35 SysCtlSleep............................................................................................58 3.2.2.36 SysCtlSRAMSizeGet............................................................................58 3.2.2.37 SysCtlUSBPLLDisable..........................................................................59 3.2.2.38 SysCtlUSBPLLEnable...........................................................................59 4 模拟数字转换器(ADC)............................................................................................................60 4.1 概述....................................................................................................................................60 4.2 API 函数............................................................................................................................61 4.2.1 详细说明..................................................................................................................62 4.2.2 函数功能..................................................................................................................62 4.2.2.1 ADCComparatorConfigure.....................................................................62 4.2.2.2 ADCComparatorIntClear ...........................................................................64 4.2.2.3 ADCComparatorIntDisable .......................................................................65 4.2.2.4 ADCComparatorIntEnable ........................................................................65 4.2.2.5 ADCComparatorIntStatus..........................................................................65 4.2.2.6 ADCComparatorRegionSet.......................................................................66 4.2.2.7 ADCComparatorReset................................................................................66 4.2.2.8 ADCHardwareOversampleConfigure..................................................67 4.2.2.9 ADCIntClear...................................................................................................67 4.2.2.10 ADCIntDisable ......................................................................................68 目录 2016-5-8 5 TIVA 库函数指南 4.2.2.11 ADCIntEnable .......................................................................................68 4.2.2.12 ADCIntRegister.....................................................................................69 4.2.2.13 ADCIntStatus.........................................................................................69 4.2.2.14 ADCIntUnregister................................................................................70 4.2.2.15 ADCPhaseDelayGet............................................................................70 4.2.2.16 ADCPhaseDelaySet.............................................................................71 4.2.2.17 ADCProcessorTrigger ........................................................................71 4.2.2.18 ADCReferenceGet...............................................................................72 4.2.2.19 ADCReferenceSet................................................................................72 4.2.2.20 ADCSequenceConfigure.................................................................73 4.2.2.21 ADCSequenceDataGet ......................................................................74 4.2.2.22 ADCSequenceDisable........................................................................74 4.2.2.23 ADCSequenceEnable .........................................................................75 4.2.2.24 ADCSequenceOverflow.....................................................................75 4.2.2.25 ADCSequenceOverflowClear...........................................................76 4.2.2.26 ADCSequenceStepConfigure ..........................................................76 4.2.2.27 ADCSequenceUnderflow..................................................................77 4.2.2.28 ADCSequenceUnderflowClear........................................................78 4.2.2.29 ADCSoftwareOversampleConfigure ...........................................78 4.2.2.30 ADCSoftwareOversampleDataGet.................................................79 4.2.2.31 ADCSoftwareOversampleStepConfigure ..................................79 4.3 编程举例 ..........................................................................................................................80 5 定时器.................................................................................................................................................82 5.1 概述....................................................................................................................................82 5.2 API 函数............................................................................................................................83 5.2.1 详细说明..................................................................................................................84 5.2.2 函数功能..................................................................................................................84 5.2.2.1 TimerConfigure.............................................................................................84 编程模型 2016-5-8 6 TIVA 库函数指南 5.2.2.2 TimerControlEvent.......................................................................................85 5.2.2.3 TimerControlLevel .......................................................................................86 5.2.2.4 TimerControlStall .........................................................................................86 5.2.2.5 TimerControlTrigger...................................................................................87 5.2.2.6 TimerControlWaitOnTrigger ....................................................................87 5.2.2.7 TimerDisable..................................................................................................88 5.2.2.8 TimerEnable...................................................................................................88 5.2.2.9 TimerIntClear.................................................................................................89 5.2.2.10 TimerIntDisable....................................................................................89 5.2.2.11 TimerIntEnable.....................................................................................90 5.2.2.12 TimerIntStatus ......................................................................................91 5.2.2.13 TimerIntUnregister..............................................................................91 5.2.2.14 TimerLoadGet.......................................................................................92 5.2.2.15 TimerLoadGet64..................................................................................92 5.2.2.16 TimerLoadSet........................................................................................93 5.2.2.17 TimerLoadSet64...................................................................................93 5.2.2.18 TimerMatchGet....................................................................................94 5.2.2.19 TimerMatchGet64 ...............................................................................94 5.2.2.20 TimerMatchSet.....................................................................................95 5.2.2.21 TimerMatchSet64................................................................................95 5.2.2.22 TimerPrescaleGet ................................................................................96 5.2.2.23 TimerPrescaleMatchGet....................................................................96 5.2.2.24 TimerPrescaleMatchSet.....................................................................97 5.2.2.25 TimerPrescaleSet.................................................................................97 5.2.2.26 TimerRTCDisable .................................................................................98 5.2.2.27 TimerRTCEnable ..................................................................................98 5.2.2.28 TimerSynchronize................................................................................99 5.2.2.29 TimerValueGet ...................................................................................100 目录 2016-5-8 7 TIVA 库函数指南 5.2.2.30 TimerValueGet64...............................................................................100 5.2.3 编程举例................................................................................................................101 6 NVIC..................................................................................................................................................102 6.1 概述..................................................................................................................................102 6.2 API 函数..........................................................................................................................103 6.2.1 详细说明................................................................................................................103 6.2.2 函数功能................................................................................................................104 6.2.2.1 IntDisable......................................................................................................104 6.2.2.2 IntEnable.......................................................................................................104 6.2.2.3 IntIsEnabled .................................................................................................105 6.2.2.4 IntMasterDisable ........................................................................................105 6.2.2.5 IntMasterEnable..........................................................................................105 6.2.2.6 IntPendClear................................................................................................106 6.2.2.7 IntPendSet....................................................................................................106 6.2.2.8 IntPriorityGet ...............................................................................................107 6.2.2.9 IntPriorityGroupingGet.............................................................................107 6.2.2.10 IntPriorityGroupingSet.....................................................................107 6.2.2.11 IntPriorityMaskGet ............................................................................108 6.2.2.12 IntPriorityMaskSet.............................................................................108 6.2.2.13 IntPrioritySet .......................................................................................109 6.2.2.14 IntRegister............................................................................................109 6.2.2.15 IntTrigger.............................................................................................110 6.2.2.16 IntUnregister.......................................................................................110 6.3 编程举例 ........................................................................................................................111
好例子网口号:伸出你的我的手 — 分享!
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论