倒立摆1.zip

  • dyh2
    了解作者
  • C/C++
    开发工具
  • 321KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2020-06-17 15:50
    上传日期
关于倒立摆在无人车方面的应用及代码源码,很完整
倒立摆1.zip
  • 倒立摆1
  • STM32F10x_FWLib
  • inc
  • stm32f10x_spi.h
    17.3KB
  • stm32f10x_crc.h
    2.1KB
  • stm32f10x_tim.h
    51.2KB
  • stm32f10x_usart.h
    16.2KB
  • stm32f10x_dma.h
    20.3KB
  • stm32f10x_fsmc.h
    26.4KB
  • stm32f10x_i2c.h
    29.3KB
  • stm32f10x_dac.h
    14.9KB
  • stm32f10x_iwdg.h
    3.7KB
  • misc.h
    8.8KB
  • stm32f10x_bkp.h
    7.4KB
  • stm32f10x_pwr.h
    4.3KB
  • stm32f10x_dbgmcu.h
    3.7KB
  • stm32f10x_exti.h
    6.7KB
  • stm32f10x_can.h
    26.9KB
  • stm32f10x_adc.h
    21.2KB
  • stm32f10x_cec.h
    6.4KB
  • stm32f10x_rcc.h
    29.7KB
  • stm32f10x_rtc.h
    3.8KB
  • stm32f10x_flash.h
    24.8KB
  • stm32f10x_sdio.h
    21.4KB
  • stm32f10x_wwdg.h
    2.9KB
  • stm32f10x_gpio.h
    19.7KB
  • src
  • stm32f10x_adc.c
    46.1KB
  • stm32f10x_fsmc.c
    34.7KB
  • misc.c
    6.9KB
  • stm32f10x_flash.c
    61.1KB
  • stm32f10x_rcc.c
    50.1KB
  • stm32f10x_wwdg.c
    5.6KB
  • stm32f10x_tim.c
    106.6KB
  • stm32f10x_iwdg.c
    4.8KB
  • stm32f10x_gpio.c
    22.7KB
  • stm32f10x_dbgmcu.c
    5KB
  • stm32f10x_pwr.c
    8.6KB
  • stm32f10x_crc.c
    3.3KB
  • stm32f10x_dac.c
    18.6KB
  • stm32f10x_sdio.c
    28.3KB
  • stm32f10x_can.c
    44KB
  • stm32f10x_bkp.c
    8.3KB
  • stm32f10x_cec.c
    11.4KB
  • stm32f10x_rtc.c
    8.4KB
  • stm32f10x_usart.c
    37.4KB
  • stm32f10x_i2c.c
    44.7KB
  • stm32f10x_spi.c
    29.5KB
  • stm32f10x_exti.c
    6.8KB
  • stm32f10x_dma.c
    28.9KB
  • SYSTEM
  • usart
  • usart.c
    5KB
  • usart.h
    1.3KB
  • delay
  • delay.c
    7.7KB
  • delay.h
    1.9KB
  • sys
  • sys.c
    876B
  • sys.h
    2.7KB
  • CORE
  • core_cm3.c
    16.9KB
  • core_cm3.h
    83.7KB
  • startup_stm32f10x_hd.s
    15.1KB
  • OBJ
  • LED.hex
    33.2KB
  • USER
  • Objects
  • Listings
  • system_stm32f10x.h
    2KB
  • stm32f10x.h
    619.1KB
  • main.c
    7KB
  • JLinkSettings.ini
    671B
  • stm32f10x_it.c
    2.4KB
  • stm32f10x_conf.h
    3.2KB
  • LED.uvoptx
    15.8KB
  • LED.uvguix.Administrator
    68.2KB
  • LED.uvguix.dell
    75KB
  • LED.uvprojx
    19.8KB
  • system_stm32f10x.c
    35.7KB
  • stm32f10x_it.h
    1.9KB
  • HARDWARE
  • EXTI
  • exti.c
    1.6KB
  • exti.h
    142B
  • KEY
  • key.h
    449B
  • key.c
    791B
  • ENCODE
  • encode.h
    177B
  • encode.c
    4KB
  • NVIC
  • nvic.c
    2.6KB
  • nvic.h
    145B
  • Derastreo
  • Derastreo.c
    1.6KB
  • Derastreo.h
    446B
  • 12864OLED
  • LCD_ZK.c
    19KB
  • LCD_ZK.h
    3.7KB
内容介绍
/** ****************************************************************************** * @file stm32f10x_tim.c * @author MCD Application Team * @version V3.5.0 * @date 11-March-2011 * @brief This file provides all the TIM firmware functions. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32f10x_tim.h" #include "stm32f10x_rcc.h" /** @addtogroup STM32F10x_StdPeriph_Driver * @{ */ /** @defgroup TIM * @brief TIM driver modules * @{ */ /** @defgroup TIM_Private_TypesDefinitions * @{ */ /** * @} */ /** @defgroup TIM_Private_Defines * @{ */ /* ---------------------- TIM registers bit mask ------------------------ */ #define SMCR_ETR_Mask ((uint16_t)0x00FF) #define CCMR_Offset ((uint16_t)0x0018) #define CCER_CCE_Set ((uint16_t)0x0001) #define CCER_CCNE_Set ((uint16_t)0x0004) /** * @} */ /** @defgroup TIM_Private_Macros * @{ */ /** * @} */ /** @defgroup TIM_Private_Variables * @{ */ /** * @} */ /** @defgroup TIM_Private_FunctionPrototypes * @{ */ static void TI1_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); static void TI2_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); static void TI3_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); static void TI4_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter); /** * @} */ /** @defgroup TIM_Private_Macros * @{ */ /** * @} */ /** @defgroup TIM_Private_Variables * @{ */ /** * @} */ /** @defgroup TIM_Private_FunctionPrototypes * @{ */ /** * @} */ /** @defgroup TIM_Private_Functions * @{ */ /** * @brief Deinitializes the TIMx peripheral registers to their default reset values. * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. * @retval None */ void TIM_DeInit(TIM_TypeDef* TIMx) { /* Check the parameters */ assert_param(IS_TIM_ALL_PERIPH(TIMx)); if (TIMx == TIM1) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM1, DISABLE); } else if (TIMx == TIM2) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM2, DISABLE); } else if (TIMx == TIM3) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM3, DISABLE); } else if (TIMx == TIM4) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM4, DISABLE); } else if (TIMx == TIM5) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM5, DISABLE); } else if (TIMx == TIM6) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM6, DISABLE); } else if (TIMx == TIM7) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM7, DISABLE); } else if (TIMx == TIM8) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM8, DISABLE); } else if (TIMx == TIM9) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM9, DISABLE); } else if (TIMx == TIM10) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM10, DISABLE); } else if (TIMx == TIM11) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM11, DISABLE); } else if (TIMx == TIM12) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM12, DISABLE); } else if (TIMx == TIM13) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM13, DISABLE); } else if (TIMx == TIM14) { RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, ENABLE); RCC_APB1PeriphResetCmd(RCC_APB1Periph_TIM14, DISABLE); } else if (TIMx == TIM15) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM15, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM15, DISABLE); } else if (TIMx == TIM16) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM16, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM16, DISABLE); } else { if (TIMx == TIM17) { RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM17, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_TIM17, DISABLE); } } } /** * @brief Initializes the TIMx Time Base Unit peripheral according to * the specified parameters in the TIM_TimeBaseInitStruct. * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. * @param TIM_TimeBaseInitStruct: pointer to a TIM_TimeBaseInitTypeDef * structure that contains the configuration information for the * specified TIM peripheral. * @retval None */ void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct) { uint16_t tmpcr1 = 0; /* Check the parameters */ assert_param(IS_TIM_ALL_PERIPH(TIMx)); assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode)); assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision)); tmpcr1 = TIMx->CR1; if((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM2) || (TIMx == TIM3)|| (TIMx == TIM4) || (TIMx == TIM5)) { /* Select the Counter Mode */ tmpcr1 &= (uint16_t)(~((uint16_t)(TIM_CR1_DIR | TIM_CR1_CMS))); tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode; } if((TIMx != TIM6) && (TIMx != TIM7)) { /* Set the clock division */ tmpcr1 &= (uint16_t)(~((uint16_t)TIM_CR1_CKD)); tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; } TIMx->CR1 = tmpcr1; /* Set the Autoreload value */ TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; /* Set the Prescaler value */ TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; if ((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM15)|| (TIMx == TIM16) || (TIMx == TIM17)) { /* Set the Repetition Counter value */ TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter; } /* Generate an update event to reload the Prescaler and the Repetition counter values immediately */ TIMx->EGR = TIM_PSCReloadMode_Immediate; } /** * @brief Initializes the TIMx Channel1 according to the specified * parameters in the TIM_OCInitStruct. * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. * @param TIM_OCInitStru
评论
    相关推荐
    • pendulum.rar
      这是一个倒单摆的模糊控制程序。用C++写的程序。
    • timed-pendulum.zip
      用VC++6.0制做的一个可计时的单摆的程序(内附源码的)
    • Angle-detection-of-Inverted-pendulum.zip
      使用霍夫变换对倒立摆摆角检测,并显示检测结果和时间
    • Pendulum.rar
      Inverted pendulum source code LQR algorithm
    • Box2D_v2.2.1
      Box2D是一个用于模拟2D刚体物体的C++引擎。是一个强大的开源物理游戏引擎,用来模拟2D刚体物体运动和碰撞。Box2D集成了大量的物理力学和运动学的计算,并将物理模拟过程封装到类对象中,将对物体的操作,以简单友好...
    • Coin3D+Qt+C++碰撞检测
      环境:Qt4.8.6+VS2008+Coin3D3.1.3 语言:C++ 功能:检测两个物体之间的碰撞并打印出来;用户通过按钮可以控制是否进行检测。
    • 詹姆斯·格里克(James Gleick)的《混沌:软件》-C/C++开发
      James Gleick的CHAOS:软件这是1991年Autodesk DOS程序的源代码,手册和可执行文件的免费版本,该程序称为“ James Gleick的CHAOS:软件”。 该软件由Josh Gordon,Rudy R James Gleick的CHAOS:软件编写。...
    • libbipedal:用于模式生成和稳定的双足步行算法库
      这个库是用 C++11 编写的,但仍然使用 boost::shared_ptr 来更好地与Simox集成。 libBipedal 在简化的 BSD 2 条款许可下获得许可。 如何构建 mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release make ...
    • Hope.zip
      rotary inverted pendulum control STM32 package doing
    • libiconv-1.1.tar.gz
      字符集转换程序