• zhengdian
    了解作者
  • C/C++
    开发工具
  • 660KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 4
    下载次数
  • 2019-07-29 12:01
    上传日期
通过ESP8266把DS18B20模块采集到的数据发送给上位机
ESP8266-WIFI温度传输实验.zip
内容介绍
/** ****************************************************************************** * @file stm32f4xx_tim.c * @author MCD Application Team * @version V1.5.1 * @date 22-May-2015 * @brief This file provides firmware functions to manage the following * functionalities of the TIM peripheral: * + TimeBase management * + Output Compare management * + Input Capture management * + Advanced-control timers (TIM1 and TIM8) specific features * + Interrupts, DMA and flags management * + Clocks management * + Synchronization management * + Specific interface management * + Specific remapping management * @verbatim =============================================================================== ##### How to use this driver ##### =============================================================================== [..] This driver provides functions to configure and program the TIM of all STM32F4xx devices. These functions are split in 9 groups: (#) TIM TimeBase management: this group includes all needed functions to configure the TM Timebase unit: (++) Set/Get Prescaler (++) Set/Get Autoreload (++) Counter modes configuration (++) Set Clock division (++) Select the One Pulse mode (++) Update Request Configuration (++) Update Disable Configuration (++) Auto-Preload Configuration (++) Enable/Disable the counter (#) TIM Output Compare management: this group includes all needed functions to configure the Capture/Compare unit used in Output compare mode: (++) Configure each channel, independently, in Output Compare mode (++) Select the output compare modes (++) Select the Polarities of each channel (++) Set/Get the Capture/Compare register values (++) Select the Output Compare Fast mode (++) Select the Output Compare Forced mode (++) Output Compare-Preload Configuration (++) Clear Output Compare Reference (++) Select the OCREF Clear signal (++) Enable/Disable the Capture/Compare Channels (#) TIM Input Capture management: this group includes all needed functions to configure the Capture/Compare unit used in Input Capture mode: (++) Configure each channel in input capture mode (++) Configure Channel1/2 in PWM Input mode (++) Set the Input Capture Prescaler (++) Get the Capture/Compare values (#) Advanced-control timers (TIM1 and TIM8) specific features (++) Configures the Break input, dead time, Lock level, the OSSI, the OSSR State and the AOE(automatic output enable) (++) Enable/Disable the TIM peripheral Main Outputs (++) Select the Commutation event (++) Set/Reset the Capture Compare Preload Control bit (#) TIM interrupts, DMA and flags management (++) Enable/Disable interrupt sources (++) Get flags status (++) Clear flags/ Pending bits (++) Enable/Disable DMA requests (++) Configure DMA burst mode (++) Select CaptureCompare DMA request (#) TIM clocks management: this group includes all needed functions to configure the clock controller unit: (++) Select internal/External clock (++) Select the external clock mode: ETR(Mode1/Mode2), TIx or ITRx (#) TIM synchronization management: this group includes all needed functions to configure the Synchronization unit: (++) Select Input Trigger (++) Select Output Trigger (++) Select Master Slave Mode (++) ETR Configuration when used as external trigger (#) TIM specific interface management, this group includes all needed functions to use the specific TIM interface: (++) Encoder Interface Configuration (++) Select Hall Sensor (#) TIM specific remapping management includes the Remapping configuration of specific timers @endverbatim ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2> * * 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_tim.h" #include "stm32f4xx_rcc.h" /** @addtogroup STM32F4xx_StdPeriph_Driver * @{ */ /** @defgroup TIM * @brief TIM driver modules * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* ---------------------- 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) #define CCMR_OC13M_MASK ((uint16_t)0xFF8F) #define CCMR_OC24M_MASK ((uint16_t)0x8FFF) /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ 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); /* Private functions ---------------------------------------------------------*/ /** @defgroup TIM_Private_Functions * @{ */ /** @defgroup TIM_Group1 TimeBase management functions * @brief TimeBase management functions * @verbatim =============================================================================== ##### TimeBase management functions ##### =============================================================================== ##### TIM Driver: how to use it in Timing(Time base) Mode ##### =============================================================================== [..] To use the Timer in Timing(Time base) mode, the following steps are mandatory: (#) Enable TIM clock using RCC_APBxPeriphClockCmd(RCC_APBxPeriph_TIMx, ENABLE) function (#) Fill the TIM_TimeBaseInitStruct with the desired parameters. (#) Call
评论
    相关推荐
    • 【RT-Thread作品秀】分布式温度监控系统-电路方案
      扩展板:DS18B20数字温度传感器,NRF24L01无线射频模块,ESP8266 WIFI模块 RT-Thread版本:RT-Thread V 4.0.3 开发工具及版本:MDK 5.27 RT-Thread使用情况概述内核部分:调度器,信号量,消息队列。 调度器:创建多个...
    • 基于STM32的海水盐度检测系统,包括labview上位机软件.rar
      ③温度传感器使用DS18B20防水的,作为海水温度测量(配套资料,方便参考); ④无线传输模块使用ESP8266无线局域网传输(配套指令集,及通信协议,一目了然); ⑤海水盐度算法资料,公式(配套资料,方便查看),海水温...
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路
    • VHDL 的实例程序,共44个.rar
      经典VHDL 的实例程序,共44个!要下载的尽快
    • USBtoRS232Driver.rar
      USB转串口驱动程序,可以用在笔记本电脑上,方便的通过串口给单片机下载程序!
    • 模糊控制程序.rar
      模糊PID控制程序的源码,是作业,有讲解,
    • 串口编程源代码.rar
      这是本人最近几年所编写的串行通讯的代码集,可以供大家参考学习。
    • DELTA_PLC.rar
      台达PLC Modbus协议通信dll com控件
    • hongwaigooog.rar
      单片机红外遥控最全的资料,包含很多当前电视遥控专用芯片的解码方式,C语言和汇编语言编写的解码范例程序,看完了你就会了!
    • MF500绝密.rar
      非接触式IC卡开发板源程序,包括原理图/PCB图;源程序在KEIL环境下编译,打开压缩包后直接点击PRJ文件,即可编译使用。 这是个保密文件,做Mifare one卡开发人基本上都用过到这个源代码。