diff --git a/stc15_configure_pin.c b/stc15_configure_pin.c new file mode 100644 index 0000000..def90cc --- /dev/null +++ b/stc15_configure_pin.c @@ -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; + + } + +} +