//****************************************************************************
// @Module Parallel Ports
// @Filename IO.C
// @Project ADC.dav
//----------------------------------------------------------------------------
// @Controller Infineon XC167CI-32F20
//
// @Compiler Keil
//
// @Codegenerator 2.4
//
// @Description This file contains functions that use the IO module.
//
//----------------------------------------------------------------------------
// @Date 2007-1-30 9:20:00
//
//****************************************************************************
// USER CODE BEGIN (IO_General,1)
// USER CODE END
//****************************************************************************
// @Project Includes
//****************************************************************************
#include "MAIN.H"
// USER CODE BEGIN (IO_General,2)
// USER CODE END
//****************************************************************************
// @Macros
//****************************************************************************
// USER CODE BEGIN (IO_General,3)
// USER CODE END
//****************************************************************************
// @Defines
//****************************************************************************
// USER CODE BEGIN (IO_General,4)
// USER CODE END
//****************************************************************************
// @Typedefs
//****************************************************************************
// USER CODE BEGIN (IO_General,5)
// USER CODE END
//****************************************************************************
// @Imported Global Variables
//****************************************************************************
// USER CODE BEGIN (IO_General,6)
// USER CODE END
//****************************************************************************
// @Global Variables
//****************************************************************************
// USER CODE BEGIN (IO_General,7)
// USER CODE END
//****************************************************************************
// @External Prototypes
//****************************************************************************
// USER CODE BEGIN (IO_General,8)
// USER CODE END
//****************************************************************************
// @Prototypes Of Local Functions
//****************************************************************************
// USER CODE BEGIN (IO_General,9)
// USER CODE END
//****************************************************************************
// @Function void IO_vInit(void)
//
//----------------------------------------------------------------------------
// @Description This is the initialization function of the IO function
// library. It is assumed that the SFRs used by this library
// are in its reset state.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 2007-1-30
//
//****************************************************************************
// USER CODE BEGIN (IO_Function,1)
// USER CODE END
void IO_vInit(void)
{
// USER CODE BEGIN (IO_Function,2)
// USER CODE END
/// -----------------------------------------------------------------------
/// General Port Settings:
/// -----------------------------------------------------------------------
PICON = 0x0000; // load input configuration register
/// -----------------------------------------------------------------------
/// Configuration of Port P0H:
/// -----------------------------------------------------------------------
/// - no pin of port P0H is used
P0H = 0x0000; // load data register
POCON0H = 0x0000; // load output control register
DP0H = 0x0000; // load direction register
/// -----------------------------------------------------------------------
/// Configuration of Port P0L:
/// -----------------------------------------------------------------------
/// - no pin of port P0L is used
P0L = 0x0000; // load data register
POCON0L = 0x0000; // load output control register
DP0L = 0x0000; // load direction register
/// -----------------------------------------------------------------------
/// Configuration of Port P1H:
/// -----------------------------------------------------------------------
/// - no pin of port P1H is used
P1H = 0x0000; // load data register
ALTSEL0P1H = 0x0000; // load alternate output function select
// register 0
POCON1H = 0x0000; // load output control register
DP1H = 0x0000; // load direction register
/// -----------------------------------------------------------------------
/// Configuration of Port P1L:
/// -----------------------------------------------------------------------
/// - no pin of port P1L is used
P1L = 0x0000; // load data register
ALTSEL0P1L = 0x0000; // load alternate output function select
// register 0
POCON1L = 0x0000; // load output control register
DP1L = 0x0000; // load direction register
/// -----------------------------------------------------------------------
/// Configuration of Port P2:
/// -----------------------------------------------------------------------
/// - no pin of port P2 is used
ODP2 = 0x0000; // load open-drain register
P2 = 0x0000; // load data register
ALTSEL0P2 = 0x0000; // load alternate output function select
// register 0
POCON2 = 0x0000; // load output control register
DP2 = 0x0000; // load direction register
/// -----------------------------------------------------------------------
/// Configuration of Port P3:
/// -----------------------------------------------------------------------
/// P3.0 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.1 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.2 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.3 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.4 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.5 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.6 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.7 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.8 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.9 is used as general purpose output
/// - push/pull output is selected
/// - the pin status is low level
/// P3.0 - P3.7 threshold type: TTL input
/// P3.8 - P3.15 threshold type: TTL input
/// P3.0 - P3.3 output driver characteristic: strong driver
///
评论0