zoukankan      html  css  js  c++  java
  • 设置 TIM3_CH2 的 PWM 模式,使能 TIM3 的 CH2 输出

    /**
      ******************************************************************************
      * @file    stm32f10x_tim.h
      * @author  MCD Application Team
      * @version V3.5.0
      * @date    11-March-2011
      * @brief   This file contains all the functions prototypes for the TIM firmware 
      *          library.
      ******************************************************************************
      * @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>
      ******************************************************************************
      */


    /* Define to prevent recursive inclusion -------------------------------------*/
    #ifndef __STM32F10x_TIM_H
    #define __STM32F10x_TIM_H


    #ifdef __cplusplus
     extern "C" {
    #endif


    /* Includes ------------------------------------------------------------------*/
    #include "stm32f10x.h"


    /** @addtogroup STM32F10x_StdPeriph_Driver
      * @{
      */


    /** @addtogroup TIM
      * @{
      */ 


    /** @defgroup TIM_Exported_Types
      * @{
      */ 


    /** 
      * @brief  TIM Time Base Init structure definition
      * @note   This structure is used with all TIMx except for TIM6 and TIM7.    
      */


    typedef struct
    {
      uint16_t TIM_Prescaler;         /*!< Specifies the prescaler value used to divide the TIM clock.
                                           This parameter can be a number between 0x0000 and 0xFFFF */


      uint16_t TIM_CounterMode;       /*!< Specifies the counter mode.
                                           This parameter can be a value of @ref TIM_Counter_Mode */


      uint16_t TIM_Period;            /*!< Specifies the period value to be loaded into the active
                                           Auto-Reload Register at the next update event.
                                           This parameter must be a number between 0x0000 and 0xFFFF.  */ 


      uint16_t TIM_ClockDivision;     /*!< Specifies the clock division.
                                          This parameter can be a value of @ref TIM_Clock_Division_CKD */


      uint8_t TIM_RepetitionCounter;  /*!< Specifies the repetition counter value. Each time the RCR downcounter
                                           reaches zero, an update event is generated and counting restarts
                                           from the RCR value (N).
                                           This means in PWM mode that (N+1) corresponds to:
                                              - the number of PWM periods in edge-aligned mode
                                              - the number of half PWM period in center-aligned mode
                                           This parameter must be a number between 0x00 and 0xFF. 
                                           @note This parameter is valid only for TIM1 and TIM8. */
    } TIM_TimeBaseInitTypeDef; 
  • 相关阅读:
    Android获取屏幕分辨率及DisplayMetrics简介(轉)
    程序员技术练级攻略
    CSDN精选iPhone开发博客
    Java中访问权限修饰符public protected 缺省默认 private的用法总结(转)
    Java中abstract class 和 interface 的解释和他们的异同点(转)
    Code Project精彩系列(转)
    java中重载与重写的区别
    HDU 1024 Max Sum Plus Plus(动态规划,给定一个数组,求其分成m个不相交子段和最大值的问题)
    Triple ACM HDU 3908 (数学题,找多少种组合)
    ACM POJ 1015 Jury Compromise(陪审团的人选,动态规划题,难)
  • 原文地址:https://www.cnblogs.com/claireyuancy/p/7272929.html
Copyright © 2011-2022 走看看