首页下载资源硬件开发STM32C8T6库函数实现SG90和SH04扫描测距完整代码工程

ZIPSTM32C8T6库函数实现SG90和SH04扫描测距完整代码工程

wda_lon327.49KB需要积分:1

资源文件列表:

超声波雷达 大约有92个文件
  1. 超声波雷达/
  2. 超声波雷达/DebugConfig/
  3. 超声波雷达/DebugConfig/Target_1_STM32F103C8_1.0.0.dbgconf 6.79KB
  4. 超声波雷达/Hardware/
  5. 超声波雷达/Hardware/Key.c 1.74KB
  6. 超声波雷达/Hardware/Key.h 95B
  7. 超声波雷达/Hardware/LED.c 2.53KB
  8. 超声波雷达/Hardware/LED.h 200B
  9. 超声波雷达/Hardware/OLED.c 7.72KB
  10. 超声波雷达/Hardware/OLED.h 567B
  11. 超声波雷达/Hardware/OLED_Font.h 8.94KB
  12. 超声波雷达/Hardware/SG90.c 1.58KB
  13. 超声波雷达/Hardware/SG90.h 105B
  14. 超声波雷达/Hardware/SR04.c 5.56KB
  15. 超声波雷达/Hardware/SR04.h 631B
  16. 超声波雷达/keilkill.bat 399B
  17. 超声波雷达/Library/
  18. 超声波雷达/Library/misc.c 6.88KB
  19. 超声波雷达/Library/misc.h 8.77KB
  20. 超声波雷达/Library/stm32f10x_adc.c 46.09KB
  21. 超声波雷达/Library/stm32f10x_adc.h 21.18KB
  22. 超声波雷达/Library/stm32f10x_bkp.c 8.26KB
  23. 超声波雷达/Library/stm32f10x_bkp.h 7.38KB
  24. 超声波雷达/Library/stm32f10x_can.c 44.05KB
  25. 超声波雷达/Library/stm32f10x_can.h 26.91KB
  26. 超声波雷达/Library/stm32f10x_cec.c 11.38KB
  27. 超声波雷达/Library/stm32f10x_cec.h 6.42KB
  28. 超声波雷达/Library/stm32f10x_crc.c 3.27KB
  29. 超声波雷达/Library/stm32f10x_crc.h 2.11KB
  30. 超声波雷达/Library/stm32f10x_dac.c 18.64KB
  31. 超声波雷达/Library/stm32f10x_dac.h 14.88KB
  32. 超声波雷达/Library/stm32f10x_dbgmcu.c 5.03KB
  33. 超声波雷达/Library/stm32f10x_dbgmcu.h 3.73KB
  34. 超声波雷达/Library/stm32f10x_dma.c 28.91KB
  35. 超声波雷达/Library/stm32f10x_dma.h 20.27KB
  36. 超声波雷达/Library/stm32f10x_exti.c 6.8KB
  37. 超声波雷达/Library/stm32f10x_exti.h 6.66KB
  38. 超声波雷达/Library/stm32f10x_flash.c 61.08KB
  39. 超声波雷达/Library/stm32f10x_flash.h 24.85KB
  40. 超声波雷达/Library/stm32f10x_fsmc.c 34.65KB
  41. 超声波雷达/Library/stm32f10x_fsmc.h 26.38KB
  42. 超声波雷达/Library/stm32f10x_gpio.c 22.68KB
  43. 超声波雷达/Library/stm32f10x_gpio.h 19.7KB
  44. 超声波雷达/Library/stm32f10x_i2c.c 44.71KB
  45. 超声波雷达/Library/stm32f10x_i2c.h 29.33KB
  46. 超声波雷达/Library/stm32f10x_iwdg.c 4.8KB
  47. 超声波雷达/Library/stm32f10x_iwdg.h 3.74KB
  48. 超声波雷达/Library/stm32f10x_pwr.c 8.55KB
  49. 超声波雷达/Library/stm32f10x_pwr.h 4.28KB
  50. 超声波雷达/Library/stm32f10x_rcc.c 50.07KB
  51. 超声波雷达/Library/stm32f10x_rcc.h 29.74KB
  52. 超声波雷达/Library/stm32f10x_rtc.c 8.4KB
  53. 超声波雷达/Library/stm32f10x_rtc.h 3.77KB
  54. 超声波雷达/Library/stm32f10x_sdio.c 28.25KB
  55. 超声波雷达/Library/stm32f10x_sdio.h 21.35KB
  56. 超声波雷达/Library/stm32f10x_spi.c 29.52KB
  57. 超声波雷达/Library/stm32f10x_spi.h 17.31KB
  58. 超声波雷达/Library/stm32f10x_tim.c 106.6KB
  59. 超声波雷达/Library/stm32f10x_tim.h 51.2KB
  60. 超声波雷达/Library/stm32f10x_usart.c 37.41KB
  61. 超声波雷达/Library/stm32f10x_usart.h 16.16KB
  62. 超声波雷达/Library/stm32f10x_wwdg.c 5.6KB
  63. 超声波雷达/Library/stm32f10x_wwdg.h 2.9KB
  64. 超声波雷达/Listings/
  65. 超声波雷达/Objects/
  66. 超声波雷达/Objects/Project.hex 25.1KB
  67. 超声波雷达/Project.uvguix.Admin 87.48KB
  68. 超声波雷达/Project.uvguix.wdada 85.98KB
  69. 超声波雷达/Project.uvoptx 32.44KB
  70. 超声波雷达/Project.uvprojx 26.38KB
  71. 超声波雷达/Start/
  72. 超声波雷达/Start/core_cm3.c 16.87KB
  73. 超声波雷达/Start/core_cm3.h 83.71KB
  74. 超声波雷达/Start/startup_stm32f10x_cl.s 15.4KB
  75. 超声波雷达/Start/startup_stm32f10x_hd.s 15.14KB
  76. 超声波雷达/Start/startup_stm32f10x_hd_vl.s 15.32KB
  77. 超声波雷达/Start/startup_stm32f10x_ld.s 12.09KB
  78. 超声波雷达/Start/startup_stm32f10x_ld_vl.s 13.34KB
  79. 超声波雷达/Start/startup_stm32f10x_md.s 12.47KB
  80. 超声波雷达/Start/startup_stm32f10x_md_vl.s 13.74KB
  81. 超声波雷达/Start/startup_stm32f10x_xl.s 15.58KB
  82. 超声波雷达/Start/stm32f10x.h 619.08KB
  83. 超声波雷达/Start/system_stm32f10x.c 35.7KB
  84. 超声波雷达/Start/system_stm32f10x.h 2.04KB
  85. 超声波雷达/System/
  86. 超声波雷达/System/Delay.c 838B
  87. 超声波雷达/System/Delay.h 135B
  88. 超声波雷达/User/
  89. 超声波雷达/User/main.c 689B
  90. 超声波雷达/User/stm32f10x_conf.h 3.18KB
  91. 超声波雷达/User/stm32f10x_it.c 4.3KB
  92. 超声波雷达/User/stm32f10x_it.h 2.04KB

资源介绍:

包含超声波模块和舵机模块配合实现扫描测距功能的代码
/** ****************************************************************************** * @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. * *

© COPYRIGHT 2011 STMicroelectronics

****************************************************************************** */ /* 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
100+评论
captcha