91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

STM32F4驅(qū)動人體紅外傳感器HC-SR501,使用STM32F4的外部中斷,代碼里文件夾是傳感器的驅(qū)動移植文件,一個是最終修改工程,上傳溫濕度及紅外探測次數(shù)到onenet平臺~

資源截圖

代碼片段和文件信息

/**
??******************************************************************************
??*?@file????infrared.c?
??*?@author??jinhao
??*?@version?V1.0.0
??*?@date????22-April-2016
??*?@brief???Main?program?body
??******************************************************************************
??*?@attention
??*
??*?

©?COPYRIGHT?2016?STMicroelectronics


??*
??*?Licensed?under?MCD-ST?Liberty?SW?License?Agreement?V2?(the?“License“);
??*?You?may?not?use?this?file?except?in?compliance?with?the?License.
??*?You?may?obtain?a?copy?of?the?License?at:
??*
??*????????http://www.st.com/software_license_agreement_liberty_v2
??*
??*?Unless?required?by?applicable?law?or?agreed?to?in?writing?software?
??*?distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS?
??*?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
??*?See?the?License?for?the?specific?language?governing?permissions?and
??*?limitations?under?the?License.
??*
??******************************************************************************
??*/
??
/*?Includes?------------------------------------------------------------------*/
#include?“stm32f4xx.h“
#include?

#include?“infrared.h“

/*?Defines?--------------------------------------------------------------------*/


/*?Variables?------------------------------------------------------------------*/


/*?Functions?------------------------------------------------------------------*/
void?Infrared_GPIO_Init(void)
{
GPIO_InitTypeDef?GPIO_InitStructure;

RCC_AHB1PeriphClockCmd(Infrared_RCCENABLE);?

GPIO_InitStructure.GPIO_Pin=Infrared_Pin;
????GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN;
????GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
????GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_DOWN;
????GPIO_Init(Infrared_GPIO?&GPIO_InitStructure);
}

void?Infrared_EXTI_Init(void)
{
EXTI_InitTypeDef?EXTI_InitStructure;

/*?連接?EXTI?中斷源?到INT1引腳?*/
SYSCFG_EXTILineConfig(Infrared_Exti_PortInfrared_Exti_Pin);

/*?選擇?EXTI?中斷源?*/
EXTI_InitStructure.EXTI_Line?=?Infrared_Exti_Line;
/*?中斷模式?*/
EXTI_InitStructure.EXTI_Mode?=?EXTI_Mode_Interrupt;
/*?上升沿下降沿觸發(fā)?*/
EXTI_InitStructure.EXTI_Trigger?=?EXTI_Trigger_Rising_Falling;??
/*?使能中斷/事件線?*/
EXTI_InitStructure.EXTI_LineCmd?=?ENABLE;
EXTI_Init(&EXTI_InitStructure);
}

void?Infrared_NVIC_Init(void)
{
NVIC_InitTypeDef?NVIC_InitStruct;

NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);

/*?配置中斷源1?*/
?? NVIC_InitStruct.NVIC_IRQChannel?=?Infrared_IRQn;
?? /*?配置搶占優(yōu)先級:1?*/
?? NVIC_InitStruct.NVIC_IRQChannelPreemptionPriority?=?1;
?? /*?配置子優(yōu)先級:1?*/
?? NVIC_InitStruct.NVIC_IRQChannelSubPriority?=?1;
?? /*?使能中斷通道?*/
?? NVIC_InitStruct.NVIC_IRQChannelCmd?=?ENABLE;
?? NVIC_Init(&NVIC_InitStruct);
}

void?Infrared_Init(void)
{
Infrared_GPIO_Init();
Infrared_EXTI_Init();
Infrared_NVIC_Init();
}

u16?Infrared_Count?=?0;

void?Infrared_IRQHandler(void)
{
?? //確保是

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-02?13:30??stm32f4人體紅外傳感器\
?????目錄???????????0??2018-03-02?13:30??stm32f4人體紅外傳感器\infrared\
?????文件????????3705??2018-03-02?13:52??stm32f4人體紅外傳感器\infrared\infrared.c
?????文件????????1257??2018-03-02?13:37??stm32f4人體紅外傳感器\infrared\infrared.h
?????目錄???????????0??2018-03-05?09:00??stm32f4人體紅外傳感器\stm32f407_iot\
?????目錄???????????0??2018-03-05?08:59??stm32f4人體紅外傳感器\stm32f407_iot\MDK\
?????目錄???????????0??2018-03-02?13:26??stm32f4人體紅外傳感器\stm32f407_iot\MDK\DebugConfig\
?????文件????????2084??2015-10-27?12:06??stm32f4人體紅外傳感器\stm32f407_iot\MDK\DebugConfig\Target_1_STM32F407ZGTx.dbgconf
?????文件????????2084??2015-10-27?12:06??stm32f4人體紅外傳感器\stm32f407_iot\MDK\DebugConfig\stm32f4_project_STM32F407ZGTx.dbgconf
?????文件??????126179??2018-03-05?08:46??stm32f4人體紅外傳感器\stm32f407_iot\MDK\JlinkLog.txt
?????文件?????????762??2018-02-26?09:06??stm32f4人體紅外傳感器\stm32f407_iot\MDK\JlinkSettings.ini
?????目錄???????????0??2018-03-02?13:26??stm32f4人體紅外傳感器\stm32f407_iot\MDK\Listings\
?????文件???????77596??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\Listings\startup_stm32f40_41xxx.lst
?????文件??????218881??2018-03-05?08:46??stm32f4人體紅外傳感器\stm32f407_iot\MDK\Listings\stm32f407_ex.map
?????目錄???????????0??2018-03-05?08:46??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\
?????文件????????9817??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\dstream.crf
?????文件?????????237??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\dstream.d
?????文件???????19532??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\dstream.o
?????文件???????15087??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\edpkit.crf
?????文件?????????276??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\edpkit.d
?????文件???????38368??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\edpkit.o
?????文件???????14474??2018-03-05?08:23??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\fault.crf
?????文件?????????357??2018-03-05?08:23??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\fault.d
?????文件???????18572??2018-03-05?08:23??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\fault.o
?????文件??????448737??2018-03-05?08:46??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\infrared.crf
?????文件????????2018??2018-03-05?08:46??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\infrared.d
?????文件??????489520??2018-03-05?08:46??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\infrared.o
?????文件??????463613??2018-03-05?08:44??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\main.crf
?????文件????????2238??2018-03-05?08:44??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\main.d
?????文件??????498748??2018-03-05?08:44??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\main.o
?????文件??????443768??2018-03-02?13:28??stm32f4人體紅外傳感器\stm32f407_iot\MDK\objects\misc.crf
............此處省略258個文件信息

評論

共有 條評論