📄 setportdir.c
字号:
/*****************************************************************************
* *
* ********** *
* ************ *
* *** *** *
* *** +++ *** *
* *** + + *** *
* *** + CHIPCON CC1010 *
* *** + + *** HAL - SetPortDir *
* *** +++ *** *
* *** *** *
* *********** *
* ********* *
* *
*****************************************************************************
* *
*****************************************************************************
* Author: ROH *
*****************************************************************************
* Revision history: *
* *
* $Log: SetPortDir.c,v $
* Revision 1.1 2002/10/14 13:04:36 tos
* Initial version in CVS.
*
* *
****************************************************************************/
#include <chipcon/hal.h>
//----------------------------------------------------------------------------
// Functions and macros which allow indirect or procedural access
// to port direction registers.
// Sets direction of entire port
void halSetPortDir(byte portNum, byte direction) {
direction=0-(!!(direction));
switch (portNum) {
case 0: P0DIR=direction; break;
case 1: P1DIR=direction; break;
case 2: P2DIR=direction; break;
case 3: P3DIR=direction; break;
default: break;
}
}
//----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -