freescale

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

TXT
218
字号
/** ###################################################################
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename  : led_section.H
**     Project   : key_scan
**     Processor : MC9S08JM60CLHE
**     Beantype  : ByteIO
**     Version   : Bean 02.055, Driver 03.15, CPU db: 3.00.033
**     Compiler  : CodeWarrior HCS08 C Compiler
**     Date/Time : 2009-10-2, 15:14
**     Abstract  :
**         This bean "ByteIO" implements an one-byte input/output.
**         It uses one 8-bit 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 langauage and compiler).
**     Settings  :
**         Port name                   : PTE
**
**         Initial direction           : Output (direction cannot be changed)
**         Initial output value        : 0 = 000H
**         Initial pull option         : off
**
**         8-bit data register         : PTED      [$0008]
**         8-bit control register      : PTEDD     [$0009]
**
**             ----------------------------------------------------
**                   Bit     |   Pin   |   Name
**             ----------------------------------------------------
**                    0      |    13   |   PTE0_TxD1
**                    1      |    14   |   PTE1_RxD1
**                    2      |    15   |   PTE2_TPM1CH0
**                    3      |    16   |   PTE3_TPM1CH1
**                    4      |    17   |   PTE4_MISO1
**                    5      |    18   |   PTE5_MOSI1
**                    6      |    19   |   PTE6_SPSCK1
**                    7      |    20   |   PTE7_SS1
**             ----------------------------------------------------
**     Contents  :
**         GetDir - bool led_section_GetDir(void);
**         GetVal - byte led_section_GetVal(void);
**         PutVal - void led_section_PutVal(byte Val);
**         GetBit - bool led_section_GetBit(byte Bit);
**         PutBit - void led_section_PutBit(byte Bit, bool Val);
**         SetBit - void led_section_SetBit(byte Bit);
**         ClrBit - void led_section_ClrBit(byte Bit);
**         NegBit - void led_section_NegBit(byte Bit);
**
**     (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
** ###################################################################*/

#ifndef led_section_H_
#define led_section_H_

/* MODULE led_section. */

  /* 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      :  led_section_GetVal (bean ByteIO)
**
**     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
**         Note: This bean is set to work in Output direction only.
**     Parameters  : None
**     Returns     :
**         ---        - Input value (0 to 255)
** ===================================================================
*/
#define led_section_GetVal() ( \
    getReg8(PTED)                      /* Evaluate to port data */ \
  )

/*
** ===================================================================
**     Method      :  led_section_PutVal (bean ByteIO)
**
**     Description :
**         This method writes the new output value.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Val        - Output value (0 to 255)
**     Returns     : Nothing
** ===================================================================
*/
#define led_section_PutVal(Val) ( \
    (void)setReg8(PTED, Val)           /* PTED0-PTED7=Val[bits 0-7] */ \
  )

/*
** ===================================================================
**     Method      :  led_section_GetBit (bean ByteIO)
**
**     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
**         Note: This bean is set to work in Output direction only.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to read (0 to 7)
**     Returns     :
**         ---        - Value of the specified bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
** ===================================================================
*/
bool led_section_GetBit(byte Bit);

/*
** ===================================================================
**     Method      :  led_section_PutBit (bean ByteIO)
**
**     Description :
**         This method writes the new value to the specified bit
**         of the output value.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit (0 to 7)
**         Val        - New value of the bit (FALSE or TRUE)
**                      FALSE = "0" or "Low", TRUE = "1" or "High"
**     Returns     : Nothing
** ===================================================================
*/
void led_section_PutBit(byte Bit, bool Val);

/*
** ===================================================================
**     Method      :  led_section_SetBit (bean ByteIO)
**
**     Description :
**         This method sets (sets to one) the specified bit of the
**         output value.
**         [ It is the same as "PutBit(Bit,TRUE);" ]
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to set (0 to 7)
**     Returns     : Nothing
** ===================================================================
*/
void led_section_SetBit(byte Bit);

/*
** ===================================================================
**     Method      :  led_section_ClrBit (bean ByteIO)
**
**     Description :
**         This method clears (sets to zero) the specified bit
**         of the output value.
**         [ It is the same as "PutBit(Bit,FALSE);" ]
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to clear (0 to 7)
**     Returns     : Nothing
** ===================================================================
*/
void led_section_ClrBit(byte Bit);

/*
** ===================================================================
**     Method      :  led_section_NegBit (bean ByteIO)
**
**     Description :
**         This method negates (inverts) the specified bit of the
**         output value.
**     Parameters  :
**         NAME       - DESCRIPTION
**         Bit        - Number of the bit to invert (0 to 7)
**     Returns     : Nothing
** ===================================================================
*/
void led_section_NegBit(byte Bit);

/*
** ===================================================================
**     Method      :  led_section_GetDir (bean ByteIO)
**
**     Description :
**         This method returns direction of the bean.
**     Parameters  : None
**     Returns     :
**         ---        - Direction of the bean (always TRUE, Output only)
**                      FALSE = Input, TRUE = Output
** ===================================================================
*/
#define led_section_GetDir() ( \
    (bool)1                            /* Port is fixed to GPO mode */ \
  )



/* END led_section. */
#endif /* #ifndef __led_section_H_ */
/*
** ###################################################################
**
**     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 + -
显示快捷键?