diff options
Diffstat (limited to 'demos/MSP430-MSP430x1611-GCC/board.c')
-rw-r--r-- | demos/MSP430-MSP430x1611-GCC/board.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/demos/MSP430-MSP430x1611-GCC/board.c b/demos/MSP430-MSP430x1611-GCC/board.c index 794070803..c94b4141b 100644 --- a/demos/MSP430-MSP430x1611-GCC/board.c +++ b/demos/MSP430-MSP430x1611-GCC/board.c @@ -18,6 +18,8 @@ */
#include <ch.h>
+#include <pal.h>
+
#include <signal.h>
#include "board.h"
@@ -45,31 +47,27 @@ void hwinit(void) { BCSCTL2 = VAL_BCSCTL2;
/*
- * I/O ports initialization.
+ * I/O ports initialization. PxSEL registers are assumed to be cleared after
+ * the reset.
*/
- P1OUT = VAL_P1OUT;
- P1DIR = VAL_P1DIR;
- P1SEL = VAL_P1SEL;
+ palInit();
+ palWritePort(IOPORT_A, VAL_P1OUT);
+ pal_lld_msp430_set_direction(IOPORT_A, VAL_P1DIR);
- P2OUT = VAL_P2OUT;
- P2DIR = VAL_P2DIR;
- P2SEL = VAL_P2SEL;
+ palWritePort(IOPORT_B, VAL_P2OUT);
+ pal_lld_msp430_set_direction(IOPORT_B, VAL_P2DIR);
- P3OUT = VAL_P3OUT;
- P3DIR = VAL_P3DIR;
- P3SEL = VAL_P3SEL;
+ palWritePort(IOPORT_C, VAL_P3OUT);
+ pal_lld_msp430_set_direction(IOPORT_C, VAL_P3DIR);
- P4OUT = VAL_P4OUT;
- P4DIR = VAL_P4DIR;
- P4SEL = VAL_P4SEL;
+ palWritePort(IOPORT_D, VAL_P4OUT);
+ pal_lld_msp430_set_direction(IOPORT_D, VAL_P4DIR);
- P5OUT = VAL_P5OUT;
- P5DIR = VAL_P5DIR;
- P5SEL = VAL_P5SEL;
+ palWritePort(IOPORT_E, VAL_P5OUT);
+ pal_lld_msp430_set_direction(IOPORT_E, VAL_P5DIR);
- P6OUT = VAL_P6OUT;
- P6DIR = VAL_P6DIR;
- P6SEL = VAL_P6SEL;
+ palWritePort(IOPORT_F, VAL_P6OUT);
+ pal_lld_msp430_set_direction(IOPORT_F, VAL_P6DIR);
/*
* Timer 0 setup, uses SMCLK as source.
|