• 大小: 1.38MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-28
  • 语言: 其他
  • 标签: 超声波  

资源简介

stm32模拟IIC驱动,高精度超声波KS103模块代码

资源截图

代码片段和文件信息

#include “common.h“

void GPIO_SetInit(GPIO_TypeDef *GPIOx
uint32_t RCC_APB2Periph
uint16_t GPIO_Pin
GPIOMode_TypeDef GPIO_Mode

{
GPIO_InitTypeDef GPIO_InitStructure;

RCC_APB2PeriphClockCmd(RCC_APB2Periph ENABLE);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode; 
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_Init(GPIOx &GPIO_InitStructure);
}

void EXTIx_Config(uint32_t EXTI_Line
EXTIMode_TypeDef EXTI_Mode
EXTITrigger_TypeDef EXTI_Trigger)
{
EXTI_InitTypeDef EXTI_InitStructure;

EXTI_InitStructure.EXTI_Line = EXTI_Line;
  EXTI_InitStructure.EXTI_Mode = EXTI_Mode;
  EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger;
  EXTI_InitStructure.EXTI_LineCmd = ENABLE;

  EXTI_Init(&EXTI_InitStructure);
}

void NVIC_InitSet(uint8_t IRQChannel
 uint8_t IRQChannelPreemptionPriority
 uint8_t IRQChannelSubPriority

{
NVIC_InitTypeDef NVIC_InitStructure;

NVIC_InitStructure.NVIC_IRQChannel = IRQChannel;
  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = IRQChannelPreemptionPriority;
  NVIC_InitStructure.NVIC_IRQChannelSubPriority = IRQChannelSubPriority;
  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

  NVIC_Init(&NVIC_InitStructure);
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-04-06 20:26  KS103__\
     目录           0  2015-04-05 19:16  KS103__\Auto\
     目录           0  2015-04-05 19:16  KS103__\Auto\C\
     文件        1328  2015-01-01 11:25  KS103__\Auto\C\common.c
     文件         831  2014-11-22 00:34  KS103__\Auto\C\delay.c
     文件         660  2014-10-06 22:36  KS103__\Auto\C\led.c
     文件        1693  2015-01-09 20:44  KS103__\Auto\C\mynvic.c
     文件        2839  2015-01-09 20:44  KS103__\Auto\C\mytimx.c
     文件        1215  2014-10-06 23:01  KS103__\Auto\C\usart1.c
     目录           0  2015-04-05 19:16  KS103__\Auto\H\
     文件         482  2015-01-01 11:25  KS103__\Auto\H\common.h
     文件         664  2014-11-22 00:34  KS103__\Auto\H\delay.h
     文件         631  2014-10-06 22:36  KS103__\Auto\H\led.h
     文件         103  2014-10-06 21:33  KS103__\Auto\H\mynvic.h
     文件         103  2015-01-09 20:44  KS103__\Auto\H\mytimx.h
     文件         187  2014-10-06 23:01  KS103__\Auto\H\usart1.h
     目录           0  2015-04-05 19:16  KS103__\CMSIS\
     文件       17273  2010-06-07 10:25  KS103__\CMSIS\core_cm3.c
     文件       85714  2011-02-09 14:59  KS103__\CMSIS\core_cm3.h
     目录           0  2015-04-05 19:16  KS103__\CMSIS\startup\
     文件       15766  2011-03-10 10:52  KS103__\CMSIS\startup\startup_stm32f10x_cl.s
     文件       15503  2011-03-10 10:52  KS103__\CMSIS\startup\startup_stm32f10x_hd.s
     文件       15692  2011-03-10 10:52  KS103__\CMSIS\startup\startup_stm32f10x_hd_vl.s
     文件       12376  2011-03-10 10:52  KS103__\CMSIS\startup\startup_stm32f10x_ld.s
     文件       13656  2011-03-10 10:52  KS103__\CMSIS\startup\startup_stm32f10x_ld_vl.s
     文件       12765  2011-03-10 10:52  KS103__\CMSIS\startup\startup_stm32f10x_md.s
     文件       14073  2011-03-10 10:51  KS103__\CMSIS\startup\startup_stm32f10x_md_vl.s
     文件       15955  2011-03-10 10:51  KS103__\CMSIS\startup\startup_stm32f10x_xl.s
     文件      633941  2011-03-10 10:51  KS103__\CMSIS\stm32f10x.h
     文件       36557  2011-03-10 10:51  KS103__\CMSIS\system_stm32f10x.c
     文件        2085  2011-03-10 10:51  KS103__\CMSIS\system_stm32f10x.h
............此处省略73个文件信息

评论

共有 条评论