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

📄 bits1.h

📁 基于56F8346的异步电机VVVF控制程序。
💻 H
字号:
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : Bits1.H
**     Project   : vvvf_56F8346
**     Processor : 56F8346
**     Beantype  : BitsIO
**     Version   : Bean 02.045, Driver 01.08, CPU db: 2.87.069
**     Compiler  : Metrowerks DSP C Compiler
**     Date/Time : 2008-2-3, 下午 02:57
**     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                   : GPIOA_High
**
**         Bit mask of the port        : 256
**         Number of bits/pins         : 1
**         Single bit numbers          : 0 to 0
**         Values range                : 0 to 1
**
**         Initial direction           : Output (direction can be changed)
**         Safe mode                   : yes
**         Initial output value        : 0 = 000H
**         Initial pull option         : off
**
**         Port data register          : GPIO_A_DR [62177]
**         Port control register       : GPIO_A_DDR [62178]
**         Port function register      : GPIO_A_PER [62179]
**
**             ----------------------------------------------------
**                   Bit     |   Pin   |   Name
**             ----------------------------------------------------
**                    0      |    138  |   GPIOA8_A0
**             ----------------------------------------------------
**
**         Optimization for            : speed
**     Contents  :
**         GetDir - bool Bits1_GetDir(void);
**         SetDir - void Bits1_SetDir(bool Dir);
**         GetVal - byte Bits1_GetVal(void);
**         PutVal - void Bits1_PutVal(byte Val);
**         GetBit - bool Bits1_GetBit(byte Bit);
**         PutBit - void Bits1_PutBit(byte Bit,bool Val);
**         SetBit - void Bits1_SetBit(byte Bit);
**         ClrBit - void Bits1_ClrBit(byte Bit);
**         NegBit - void Bits1_NegBit(byte Bit);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2004
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

#ifndef __Bits1_H
#define __Bits1_H

/* MODULE Bits1. */

/*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 Bits1_PIN_MASK          (word)256 /* Pin mask */
#define Bits1_PIN_MASK_SHIFTED  (byte)1 /* Shifted pin mask by 8, if pin mask is greater than 128 */
#define Bits1_PIN_MASK_JUSTIFIED (byte)1 /* Justified pin mask to the right, if Pin0 index within the port is nonzero */


/*
** ===================================================================
**     Method      :  Bits1_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 1)
** ===================================================================
*/
#define Bits1_GetVal() (byte)((getReg(GPIO_A_DR) >> 8) & Bits1_PIN_MASK_JUSTIFIED)
/*
** ===================================================================
**     Method      :  Bits1_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 1)
**     Returns     : Nothing
** ===================================================================
*/
void Bits1_PutVal(byte Val);

/*
** ===================================================================
**     Method      :  Bits1_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 0)
**     Returns     :
**         ---        - Value of the specified bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
** ===================================================================
*/
bool Bits1_GetBit(byte Bit);

/*
** ===================================================================
**     Method      :  Bits1_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 0)
**         Val        - New value of the bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
**     Returns     : Nothing
** ===================================================================
*/
void Bits1_PutBit(byte Bit, bool Val);

/*
** ===================================================================
**     Method      :  Bits1_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 0)
**     Returns     : Nothing
** ===================================================================
*/
void Bits1_SetBit(byte Bit);

/*
** ===================================================================
**     Method      :  Bits1_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 0)
**     Returns     : Nothing
** ===================================================================
*/
void Bits1_ClrBit(byte Bit);

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

/*
** ===================================================================
**     Method      :  Bits1_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 Bits1_SetDir(bool Dir);

/*
** ===================================================================
**     Method      :  Bits1_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 Bits1_GetDir() (bool)((getReg(GPIO_A_DDR) >> 8) & Bits1_PIN_MASK_SHIFTED)

/* END Bits1. */

#endif /* __Bits1_H*/
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 03.47 for 
**     the Motorola 56800 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

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