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

📄 bits_drivemosfet.h

📁 基于56F8346的异步电机VVVF控制程序。
💻 H
字号:
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : Bits_Drivemosfet.H
**     Project   : vvvf_56F8346
**     Processor : 56F8346
**     Beantype  : BitsIO
**     Version   : Bean 02.091, Driver 01.15, CPU db: 2.87.097
**     Compiler  : Metrowerks DSP C Compiler
**     Date/Time : 2008-3-7, 9:38
**     Abstract  :
**         This bean "BitsIO" implements a multi-bit input/output.
**         It uses selected pins of one 1-bit to 8-bit port.
**     Settings  :
**         Port name                   : GPIOE_High
**
**         Bit mask of the port        : 3072
**         Number of bits/pins         : 2
**         Single bit numbers          : 0 to 1
**         Values range                : 0 to 3
**
**         Initial direction           : Output (direction can be changed)
**         Safe mode                   : yes
**         Initial output value        : 0 = 000H
**         Initial pull option         : off
**
**         Port data register          : GPIO_E_DR [62257]
**         Port control register       : GPIO_E_DDR [62258]
**         Port function register      : GPIO_E_PER [62259]
**
**             ----------------------------------------------------
**                   Bit     |   Pin   |   Name
**             ----------------------------------------------------
**                    0      |    116  |   GPIOE10_TD0
**                    1      |    117  |   GPIOE11_TD1
**             ----------------------------------------------------
**
**         Optimization for            : speed
**     Contents  :
**         GetDir - bool Bits_Drivemosfet_GetDir(void);
**         SetDir - void Bits_Drivemosfet_SetDir(bool Dir);
**         GetVal - byte Bits_Drivemosfet_GetVal(void);
**         PutVal - void Bits_Drivemosfet_PutVal(byte Val);
**         GetBit - bool Bits_Drivemosfet_GetBit(byte Bit);
**         PutBit - void Bits_Drivemosfet_PutBit(byte Bit,bool Val);
**         SetBit - void Bits_Drivemosfet_SetBit(byte Bit);
**         ClrBit - void Bits_Drivemosfet_ClrBit(byte Bit);
**         NegBit - void Bits_Drivemosfet_NegBit(byte Bit);
**
**     (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 __Bits_Drivemosfet_H
#define __Bits_Drivemosfet_H

/* MODULE Bits_Drivemosfet. */

/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"

#include "Cpu.h"

#define Bits_Drivemosfet_PIN_MASK ((word)3072) /* Pin mask */
#define Bits_Drivemosfet_PIN_MASK_SHIFTED ((byte)12) /* Shifted pin mask by 8, if pin mask is greater than 128 */
#define Bits_Drivemosfet_PIN_MASK_JUSTIFIED ((byte)3) /* Justified pin mask to the right, if Pin0 index within the port is nonzero */


/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_GetVal (bean BitsIO)
**
**     Description :
**         This method returns an input value.
**           a) direction = Input  : reads the input value from the
**                                   pins and returns it
**           b) direction = Output : returns the last written value
**     Parameters  : None
**     Returns     :
**         ---        - Input value (0 to 3)
** ===================================================================
*/
#define Bits_Drivemosfet_GetVal() ((byte)((getReg(GPIO_E_DR) >> 10) & Bits_Drivemosfet_PIN_MASK_JUSTIFIED))
/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_PutVal (bean BitsIO)
**
**     Description :
**         This method writes the new output value.
**           a) direction = Input  : sets the new output value;
**                                   this operation will be shown on
**                                   output after the direction has
**                                   been switched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly writes the value to the
**                                   appropriate pins
**     Parameters  :
**         NAME       - DESCRIPTION
**         Val        - Output value (0 to 3)
**     Returns     : Nothing
** ===================================================================
*/
void Bits_Drivemosfet_PutVal(byte Val);

/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_GetBit (bean BitsIO)
**
**     Description :
**         This method returns the specified bit of the input value.
**           a) direction = Input  : reads the input value from pins
**                                   and returns the specified bit
**           b) direction = Output : returns the specified bit
**                                   of the last written value
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to read (0 to 1)
**     Returns     :
**         ---        - Value of the specified bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
** ===================================================================
*/
bool Bits_Drivemosfet_GetBit(byte Bit);

/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_PutBit (bean BitsIO)
**
**     Description :
**         This method writes the new value to the specified bit
**         of the output value.
**           a) direction = Input  : sets the value of the specified
**                                   bit; this operation will be
**                                   shown on output after the
**                                   direction has been switched to
**                                   output (SetDir(TRUE);)
**           b) direction = Output : directly writes the value of the
**                                   bit to the appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit (0 to 1)
**         Val        - New value of the bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
**     Returns     : Nothing
** ===================================================================
*/
void Bits_Drivemosfet_PutBit(byte Bit, bool Val);

/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_SetBit (bean BitsIO)
**
**     Description :
**         This method sets (sets to one) the specified bit of the
**         output value.
**         [ It is the same as "PutBit(Bit,TRUE);" ]
**           a) direction = Input  : sets the specified bit to "1";
**                                   this operation will be shown on
**                                   output after the direction has
**                                   been switched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly writes "1" to the
**                                   appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to set (0 to 1)
**     Returns     : Nothing
** ===================================================================
*/
void Bits_Drivemosfet_SetBit(byte Bit);

/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_ClrBit (bean BitsIO)
**
**     Description :
**         This method clears (sets to zero) the specified bit
**         of the output value.
**         [ It is the same as "PutBit(Bit,FALSE);" ]
**           a) direction = Input  : sets the specified bit to "0";
**                                   this operation will be shown on
**                                   output after the direction has
**                                   beenswitched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly writes "0" to the
**                                   appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to clear (0 to 1)
**     Returns     : Nothing
** ===================================================================
*/
void Bits_Drivemosfet_ClrBit(byte Bit);

/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_NegBit (bean BitsIO)
**
**     Description :
**         This method negates (inverts) the specified bit of the
**         output value.
**           a) direction = Input  : inverts the specified bit;
**                                   this operation will be shown on
**                                   output after the direction has
**                                   been switched to output
**                                   (SetDir(TRUE);)
**           b) direction = Output : directly inverts the value
**                                   of the appropriate pin
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to invert (0 to 31)
**     Returns     : Nothing
** ===================================================================
*/
void Bits_Drivemosfet_NegBit(byte Bit);

/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_SetDir (bean BitsIO)
**
**     Description :
**         This method sets direction of the bean.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Dir        - Direction to set (FALSE or TRUE)
**                      FALSE = Input, TRUE = Output
**     Returns     : Nothing
** ===================================================================
*/
void Bits_Drivemosfet_SetDir(bool Dir);

/*
** ===================================================================
**     Method      :  Bits_Drivemosfet_GetDir (bean BitsIO)
**
**     Description :
**         This method returns direction of the bean.
**     Parameters  : None
**     Returns     :
**         ---        - Direction of the bean (FALSE or TRUE)
**                      FALSE = Input, TRUE = Output
** ===================================================================
*/
#define Bits_Drivemosfet_GetDir() ((bool)((getReg(GPIO_E_DDR) >> 8) & Bits_Drivemosfet_PIN_MASK_SHIFTED))

/* END Bits_Drivemosfet. */

#endif /* __Bits_Drivemosfet_H*/
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 2.97 [03.74]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

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