⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pwm6.h

📁 FREESCALE 16位单片机片MC9S12DG128的PWM输出程序,可设定PWM波的频率和占空比由产品验证,完全可用
💻 H
字号:
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : PWM6.H
**     Project   : ESV1_0_DJ64
**     Processor : MC9S12DJ64BCFU
**     Beantype  : PWM
**     Version   : Bean 02.065, Driver 01.04, CPU db: 2.87.238
**     Compiler  : Metrowerks HC12 C Compiler
**     Date/Time : 2006-6-10, 10:56
**     Abstract  :
**         This bean implements a pulse-width modulation generator
**         that generates signal with variable duty and fixed cycle. 
**     Settings  :
**         Used output pin             : 
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       3             |  PP1_PWM1_KWP1
**             ----------------------------------------------------
**
**         Timer name                  : PWM01 [16-bit] 
**         Counter                     : PWMCNT01  [172]
**         Mode register               : PWMCTL    [165]
**         Run register                : PWME      [160]
**         Prescaler                   : PWMPRCLK  [163]
**         Compare 1 register          : PWMPER01  [180]
**         Compare 2 register          : PWMDTY01  [188]
**         Flip-flop 1 register        : PWMPOL    [161]
**
**         User handling procedure     : not specified
**
**         Output pin
**
**         Port name                   : P
**         Bit number (in port)        : 1
**         Bit mask of the port        : 2
**         Port data register          : PTP       [600]
**         Port control register       : DDRP      [602]
**
**         Runtime setting period      : none
**         Runtime setting ratio       : calculated
**         Initialization:
**              Aligned                : Left
**              Output level           : low
**              Timer                  : Enabled
**              Event                  : Enabled
**         High-speed CPU mode
**             Prescaler               : divide-by-1
**             Clock                   : 4000000 Hz
**           Initial value of            period        pulse width (ratio 8%)
**             Xtal ticks              : 16000         1280
**             microseconds            : 1000          80
**             milliseconds            : 1             0
**             seconds (real)          : 0.0010000     0.0000800
**
**     Contents  :
**         Enable     - byte PWM6_Enable(void);
**         SetRatio16 - byte PWM6_SetRatio16(word Ratio);
**         SetDutyUS  - byte PWM6_SetDutyUS(word Time);
**         SetDutyMS  - byte PWM6_SetDutyMS(word Time);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2002
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

#ifndef __PWM6
#define __PWM6

/* MODULE PWM6. */

#include "Cpu.h"

#pragma CODE_SEG PWM6_CODE             /* Code section for this module. */


byte PWM6_Enable(void);
/*
** ===================================================================
**     Method      :  PWM6_Enable (bean PWM)
**
**     Description :
**         This method enables the signal generation 
**     Parameters  : None
**     Returns     :
**         ---        - Error code
** ===================================================================
*/

byte PWM6_SetRatio16(word Ratio);
/*
** ===================================================================
**     Method      :  PWM6_SetRatio16 (bean PWM)
**
**     Description :
**         This method sets a new duty-cycle ratio.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Ratio      - Ratio is expressed as an 16-bit unsigned integer
**                      number. 0 - 65535 value is proportional
**                      to ratio 0 - 100%
**         Note: Calculated duty-cycle ratio depends on the timer
**               possibilities and on the selected period.
**     Returns     :
**         ---        - Error code
** ===================================================================
*/

byte PWM6_SetDutyUS(word Time);
/*
** ===================================================================
**     Method      :  PWM6_SetDutyUS (bean PWM)
**
**     Description :
**         This method sets the new duty value of the output signal. The
**         duty is expressed in microseconds as a 16-bit unsigned integer
**         number.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Time       - Duty to set [in microseconds]
**                      (0 to 1000 us in high speed CPU mode)
**     Returns     :
**         ---        - Error code
** ===================================================================
*/

byte PWM6_SetDutyMS(word Time);
/*
** ===================================================================
**     Method      :  PWM6_SetDutyMS (bean PWM)
**
**     Description :
**         This method sets the new duty value of the output signal. The
**         duty is expressed in milliseconds as a 16-bit unsigned integer
**         number.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Time       - Duty to set [in milliseconds]
**                      (0 to 1 ms in high speed CPU mode)
**     Returns     :
**         ---        - Error code
** ===================================================================
*/

void PWM6_Init(void);
/*
** ===================================================================
**     Method      :  PWM6_Init (bean PWM)
**
**     Description :
**         This method is internal. It is used by Processor Expert
**         only.
** ===================================================================
*/

#pragma CODE_SEG DEFAULT               /* Change code section to DEFAULT. */

/* END PWM6. */

#endif /* ifndef __PWM6 */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 03.33 for 
**     the Motorola HCS12 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -