iConfigure pin
This commit is contained in:
parent
299c0feb72
commit
ff97f29156
27
stc15_configure_pin.c
Normal file
27
stc15_configure_pin.c
Normal file
@ -0,0 +1,27 @@
|
||||
#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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user