freescale

来自「Freescale 系列单片机常用模块与综合系统设计」· 代码 · 共 152 行

TXT
152
字号
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : p_r.C
**     Project   : voice_play
**     Processor : MC9S08JM60CLHE
**     Beantype  : BitIO
**     Version   : Bean 02.071, Driver 03.16, CPU db: 3.00.033
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 2009-9-21, 21:47
**     Abstract  :
**         This bean "BitIO" implements an one-bit input/output.
**         It uses one bit/pin of a port.
**         Note: This bean is set to work in Output direction only.
**         Methods of this bean are mostly implemented as a macros
**         (if supported by target language and compiler).
**     Settings  :
**         Used pin                    :
**             ----------------------------------------------------
**                Number (on package)  |    Name
**             ----------------------------------------------------
**                       51            |  PTD5
**             ----------------------------------------------------
**
**         Port name                   : PTD
**
**         Bit number (in port)        : 5
**         Bit mask of the port        : $0020
**
**         Initial direction           : Output (direction cannot be changed)
**         Initial output value        : 1
**         Initial pull option         : off
**
**         Port data register          : PTDD      [$0006]
**         Port control register       : PTDDD     [$0007]
**
**         Optimization for            : speed
**     Contents  :
**         GetVal - bool p_r_GetVal(void);
**         PutVal - void p_r_PutVal(bool Val);
**         ClrVal - void p_r_ClrVal(void);
**         SetVal - void p_r_SetVal(void);
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2008
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/

/* MODULE p_r. */

#include "p_r.h"
  /* Including shared modules, which are used in the whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "Cpu.h"


/*
** ===================================================================
**     Method      :  p_r_GetVal (bean BitIO)
**
**     Description :
**         This method returns an input value.
**           a) direction = Input  : reads the input value from the
**                                   pin and returns it
**           b) direction = Output : returns the last written value
**         Note: This bean is set to work in Output direction only.
**     Parameters  : None
**     Returns     :
**         ---             - Input value. Possible values:
**                           FALSE - logical "0" (Low level)
**                           TRUE - logical "1" (High level)

** ===================================================================
*/
/*
bool p_r_GetVal(void)

**  This method is implemented as a macro. See p_r.h file.  **
*/

/*
** ===================================================================
**     Method      :  p_r_PutVal (bean BitIO)
**
**     Description :
**         This method writes the new output value.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Val             - Output value. Possible values:
**                           FALSE - logical "0" (Low level)
**                           TRUE - logical "1" (High level)
**     Returns     : Nothing
** ===================================================================
*/
void p_r_PutVal(bool Val)
{
  if (Val) {
    setReg8Bits(PTDD, 0x20);           /* PTDD5=0x01 */
  } else { /* !Val */
    clrReg8Bits(PTDD, 0x20);           /* PTDD5=0x00 */
  } /* !Val */
}

/*
** ===================================================================
**     Method      :  p_r_ClrVal (bean BitIO)
**
**     Description :
**         This method clears (sets to zero) the output value.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
/*
void p_r_ClrVal(void)

**  This method is implemented as a macro. See p_r.h file.  **
*/

/*
** ===================================================================
**     Method      :  p_r_SetVal (bean BitIO)
**
**     Description :
**         This method sets (sets to one) the output value.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
/*
void p_r_SetVal(void)

**  This method is implemented as a macro. See p_r.h file.  **
*/


/* END p_r. */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 3.03 [04.07]
**     for the Freescale HCS08 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

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