| Revision 1487,
1.3 KB
checked in by thomas, 15 months ago
(diff) |
|
leds bsp example app for GINA
|
| Line | |
|---|
| 1 | /** |
|---|
| 2 | \brief TelosB-specific definition of the "board" bsp module. |
|---|
| 3 | |
|---|
| 4 | \author Thomas Watteyne <watteyne@eecs.berkeley.edu>, February 2012. |
|---|
| 5 | */ |
|---|
| 6 | |
|---|
| 7 | #include "msp430f1611.h" |
|---|
| 8 | #include "board.h" |
|---|
| 9 | // bsp modules |
|---|
| 10 | #include "leds.h" |
|---|
| 11 | #include "uart.h" |
|---|
| 12 | #include "spi.h" |
|---|
| 13 | #include "radio.h" |
|---|
| 14 | #include "radiotimer.h" |
|---|
| 15 | |
|---|
| 16 | //=========================== variables ======================================= |
|---|
| 17 | |
|---|
| 18 | //=========================== prototypes ====================================== |
|---|
| 19 | |
|---|
| 20 | //=========================== public ========================================== |
|---|
| 21 | |
|---|
| 22 | void board_init() { |
|---|
| 23 | // disable watchdog timer |
|---|
| 24 | WDTCTL = WDTPW + WDTHOLD; |
|---|
| 25 | |
|---|
| 26 | // setup clock speed |
|---|
| 27 | DCOCTL = DCO0 | DCO1 | DCO2; // MCLK at ~8MHz |
|---|
| 28 | BCSCTL1 = RSEL0 | RSEL1 | RSEL2; // MCLK at ~8MHz |
|---|
| 29 | // by default, ACLK from 32kHz XTAL which is running |
|---|
| 30 | |
|---|
| 31 | // initialize bsp modules |
|---|
| 32 | leds_init(); |
|---|
| 33 | uart_init(); |
|---|
| 34 | spi_init(); |
|---|
| 35 | radio_init(); |
|---|
| 36 | radiotimer_init(); |
|---|
| 37 | |
|---|
| 38 | // enable interrupts |
|---|
| 39 | __bis_SR_register(GIE); |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | void board_sleep() { |
|---|
| 43 | __bis_SR_register(GIE+LPM3_bits); // sleep, but leave ACLK on |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | //=========================== private ========================================= |
|---|
Note: See
TracBrowser
for help on using the repository browser.