📄 io.c
字号:
//****************************************************************************
// @Module Parallel Ports
// @Filename IO.C
// @Project svm.dav
//----------------------------------------------------------------------------
// @Controller Infineon XC167CI-16F40
//
// @Compiler Keil
//
// @Codegenerator 2.1
//
// @Description This file contains functions that use the IO module.
//
//----------------------------------------------------------------------------
// @Date 19.12.2003 11:31:18
//
//****************************************************************************
// 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 19.12.2003
//
//****************************************************************************
// 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:
/// -----------------------------------------------------------------------
/// P1H.7 is used as general input
/// P1H.0 - P1H.3 output driver characteristic: strong driver
/// P1H.4 - P1H.7 output driver characteristic: strong driver
/// P1H.0 - P1H.3 output edge characteristic: sharp edge mode
/// P1H.4 - P1H.7 output edge characteristic: sharp edge mode
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:
/// -----------------------------------------------------------------------
/// P1L.0 is used as alternate output for the CAPCOM6 output (CC60)
/// P1L.1 is used as alternate output for the CAPCOM6 output (COUT60)
/// P1L.2 is used as alternate output for the CAPCOM6 output (CC61)
/// P1L.3 is used as alternate output for the CAPCOM6 output (COUT61)
/// P1L.4 is used as alternate output for the CAPCOM6 output (CC62)
/// P1L.5 is used as alternate output for the CAPCOM6 output (COUT62)
/// P1L.0 - P1L.3 output driver characteristic: strong driver
/// P1L.4 - P1L.7 output driver characteristic: strong driver
/// P1L.0 - P1L.3 output edge characteristic: sharp edge mode
/// P1L.4 - P1L.7 output edge characteristic: sharp edge mode
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:
/// -----------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -