📄 pwmd.h
字号:
/** ###################################################################
** THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
** Filename : PWMd.H
** Project : che_free
** Processor : MC9S12DG128BCPV
** Beantype : PWM
** Version : Bean 02.112, Driver 01.09, CPU db: 2.87.280
** Compiler : Metrowerks HC12 C Compiler
** Date/Time : 2008-3-13, 上午 08:28
** 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_MOSI1_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 mode
** Prescaler : divide-by-1
** Clock : 3000000 Hz
** Initial value of period pulse width (ratio 7.5%)
** Xtal ticks : 320000 24000
** microseconds : 20000 1500
** milliseconds : 20 2
** seconds (real) : 0.0200000 0.0015000
**
** Contents :
** SetRatio16 - byte PWMd_SetRatio16(word Ratio);
** SetDutyUS - byte PWMd_SetDutyUS(word Time);
** SetDutyMS - byte PWMd_SetDutyMS(word Time);
**
** (c) Copyright UNIS, spol. s r.o. 1997-2005
** UNIS, spol. s r.o.
** Jundrovska 33
** 624 00 Brno
** Czech Republic
** http : www.processorexpert.com
** mail : info@processorexpert.com
** ###################################################################*/
#ifndef __PWMd
#define __PWMd
/* MODULE PWMd. */
#include "Cpu.h"
#pragma CODE_SEG PWMd_CODE
byte PWMd_SetRatio16(word Ratio);
/*
** ===================================================================
** Method : PWMd_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 depends on the timer possibilities
** and on the selected period.
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ===================================================================
*/
byte PWMd_SetDutyUS(word Time);
/*
** ===================================================================
** Method : PWMd_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 20000 us in high speed mode)
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ERR_MATH - Overflow during evaluation
** ERR_RANGE - Parameter out of range
** ===================================================================
*/
byte PWMd_SetDutyMS(word Time);
/*
** ===================================================================
** Method : PWMd_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 20 ms in high speed mode)
** Returns :
** --- - Error code, possible codes:
** ERR_OK - OK
** ERR_SPEED - This device does not work in
** the active speed mode
** ERR_MATH - Overflow during evaluation
** ERR_RANGE - Parameter out of range
** ===================================================================
*/
void PWMd_Init(void);
/*
** ===================================================================
** Method : PWMd_Init (bean PWM)
**
** Description :
** Initializes the associated peripheral(s) and the bean's
** internal variables. The method is called automatically as a
** part of the application initialization code.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
#pragma CODE_SEG DEFAULT
/* END PWMd. */
#endif /* ifndef __PWMd */
/*
** ###################################################################
**
** This file was created by UNIS Processor Expert 2.96 [03.76]
** for the Freescale HCS12 series of microcontrollers.
**
** ###################################################################
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -