28 lines
419 B
C
28 lines
419 B
C
#include "mctools.h"
|
|
|
|
|
|
void stc15_configure_pin(uint8_t port, uint8_t pin, uint8_t mode)
|
|
{
|
|
switch(port){
|
|
case 0:
|
|
setbit(P0M0,pin,mode&1);
|
|
setbit(P0M1,pin,mode&2);
|
|
break;
|
|
case 1:
|
|
setbit(P1M0,pin,mode&1);
|
|
setbit(P1M1,pin,mode&2);
|
|
break;
|
|
case 2:
|
|
setbit(P2M0,pin,mode&1);
|
|
setbit(P2M1,pin,mode&2);
|
|
break;
|
|
case 3:
|
|
setbit(P3M0,pin,mode&1);
|
|
setbit(P3M1,pin,mode&2);
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|