X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fplatforms%2Ftmicore%2FMotePlatformC.nc;h=6882e6e8f15e36da42620592ce679049919a0291;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=25622f99c9e82e104a8f10d972690cc7e3fb2dc1;hpb=67ea6e597465286a923da75687454a88104bd6ef;p=tinyos-2.x.git diff --git a/tos/platforms/tmicore/MotePlatformC.nc b/tos/platforms/tmicore/MotePlatformC.nc index 25622f99..6882e6e8 100644 --- a/tos/platforms/tmicore/MotePlatformC.nc +++ b/tos/platforms/tmicore/MotePlatformC.nc @@ -26,11 +26,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /** - * @author R. Steve McKown + * @author R. Steve McKown */ - + module MotePlatformC @safe() { provides interface Init; } @@ -44,35 +44,54 @@ implementation { WDTCTL = WDTPW + WDTHOLD; #endif - /* Port 1: 7:BQSTAT2, 6:BQSTAT1, 5:-, 4:-, 3:CP_CTS, 2:CP_RTS, 1:BSL_TX, 0:- */ + /* Port 1: 7:BQSTAT2, 6:BQSTAT1, 5:-, 4:-, 3:CP_CTS, 2:CP_RTS, + * 1:BSL_TX, 0:- + */ P1SEL = 0; /* 0 0 0 0 0 0 0 0 */ - P1OUT = 0x3b; /* 0 0 1 1 1 0 1 1 */ - P1DIR = 0x3b; /* 0 0 1 1 1 0 1 1 */ - - /* Port 2: 7:-, 6:-, 5:nBUTTON, 4:nUSB_SUSPEND, 3:-, 2:BSL_RX, 1:nUSBPG, 0:nSOLARPG */ + P1OUT = 0x31; /* 0 0 1 1 0 0 0 1 */ + P1DIR = 0x08; /* 0 0 0 0 1 0 0 0 */ + P1REN = 0x35; /* 0 0 1 1 0 1 0 1 */ + + /* Port 2: + * 7:-, 6:-, 5:BUTTONn, 4:USB_SUSPENDn, 3:-, 2:BSL_RX, 1:USBPGn, + * 0:SOLARPGn + */ P2SEL = 0; /* 0 0 0 0 0 0 0 0 */ P2OUT = 0xc8; /* 1 1 0 0 1 0 0 0 */ - P2DIR = 0xc8; /* 1 1 0 0 1 0 0 0 */ + P2DIR = 0x00; /* 0 0 0 0 0 0 0 0 */ + P2REN = 0xc8; /* 1 1 0 0 1 0 0 0 */ - /* Port 3: 7:UC_RX, 6:UC_TX, 5:-, 4:-, 3:UC_SCK, 2:UC_SOMI, 1:UC_SIMO, 0:- */ - P3SEL = 0xc7; /* 1 1 0 0 1 1 1 0 */ - P3OUT = 0x7b; /* 0 1 1 1 1 0 1 1 */ - P3DIR = 0x7b; /* 0 1 1 1 1 0 1 1 */ + /* Port 3: + * 7:UC_RX, 6:UC_TX, 5:-, 4:-, 3:UC_SCK, 2:UC_SOMI, 1:UC_SIMO, 0:- + */ + P3SEL = 0; /* 0 0 0 0 0 0 0 0 */ + P3OUT = 0x3f; /* 0 0 1 1 1 1 1 1 */ + P3DIR = 0x4a; /* 0 1 0 0 1 0 1 0 */ + P3REN = 0xb5; /* 1 0 1 1 0 1 0 1 */ - /* Port 4: 7:-, 6:nLED2, 5:nLED1, 4:nFLH_CS, 3:-, 2:-, 1:-, 0:- */ + /* Port 4: + * 7:-, 6:LED2n, 5:LED1n, 4:-, 3:-, 2:-, 1:-, 0:- + */ P4SEL = 0; /* 0 0 0 0 0 0 0 0 */ P4OUT = 0xff; /* 1 1 1 1 1 1 1 1 */ - P4DIR = 0xff; /* 1 1 1 1 1 1 1 1 */ + P4DIR = 0x60; /* 0 1 1 0 0 0 0 0 */ + P4REN = 0x9f; /* 1 0 0 1 1 1 1 1 */ - /* Port 5: 7:-, 6:-, 5:-, 4:-, 3:-, 2:-, 1:-, 0:- */ + /* Port 5: + * 7:-, 6:-, 5:-, 4:-, 3:-, 2:-, 1:-, 0:- + */ P5SEL = 0; /* 0 0 0 0 0 0 0 0 */ P5OUT = 0xff; /* 1 1 1 1 1 1 1 1 */ - P5DIR = 0xff; /* 1 1 1 1 1 1 1 1 */ + P5DIR = 0; /* 0 0 0 0 0 0 0 0 */ + P5REN = 0xff; /* 1 1 1 1 1 1 1 1 */ - /* Port 6: 7:-, 6:-, 5:-, 4:-, 3:-, 2:-, 1:-, 0:ADC_VBATT */ + /* Port 6: + * 7:-, 6:-, 5:-, 4:-, 3:-, 2:-, 1:-, 0:ADC_VBATT + */ P6SEL = 0x01; /* 0 0 0 0 0 0 0 1 */ P6OUT = 0; /* 0 0 0 0 0 0 0 0 */ P6DIR = 0; /* 0 0 0 0 0 0 0 0 */ + P6REN = 0xfe; /* 1 1 1 1 1 1 1 0 */ P1IE = 0; P2IE = 0;