diff options
Diffstat (limited to 'Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c')
-rw-r--r-- | Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c b/Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c deleted file mode 100644 index 0ad179c..0000000 --- a/Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /******************************************************************************* | ||
2 | * MSP432 Blink | ||
3 | * | ||
4 | * Description: | ||
5 | * Blinks two LEDs using SysTick (which is sourced from MCLK). | ||
6 | * | ||
7 | * Configuration: | ||
8 | * Starts the DCO to 12MHz and sources MCLK from it. | ||
9 | * BT1 pauses blinking. | ||
10 | * | ||
11 | * | ||
12 | * MSP432P401 | ||
13 | * ------------------ | ||
14 | * /|\| | | ||
15 | * --|RST | | ||
16 | * | |---> LEDG | ||
17 | * BT1 --->| |---> LEDR | ||
18 | * | | | ||
19 | * | < 12Mhz DCO > | | ||
20 | * | | | ||
21 | * | ||
22 | * Author: B.Martinez | ||
23 | ******************************************************************************/ | ||
24 | #include "i3mote.h" | ||
25 | |||
26 | /* DriverLib Includes */ | ||
27 | #include "driverlib.h" | ||
28 | |||
29 | /* Standard Includes */ | ||
30 | #include <stdint.h> | ||
31 | #include <stdbool.h> | ||
32 | |||
33 | |||
34 | int main(void) | ||
35 | { | ||
36 | /* Halting the Watchdog */ | ||
37 | MAP_WDT_A_holdTimer(); | ||
38 | |||
39 | /* Set Button Pin as Input */ | ||
40 | MAP_GPIO_setAsInputPin(HID_PORT,BUTTON); | ||
41 | |||
42 | /* Set LED Pins as Output */ | ||
43 | MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR); | ||
44 | |||
45 | /* Set LED Initial Value */ | ||
46 | MAP_GPIO_setOutputLowOnPin(HID_PORT, LEDG); | ||
47 | MAP_GPIO_setOutputLowOnPin(HID_PORT, LEDR); | ||
48 | //MAP_GPIO_setOutputHighOnPin(HID_PORT, LEDR); | ||
49 | |||
50 | /* Setting the external clock frequency (This API is optional) */ | ||
51 | CS_setExternalClockSourceFrequency(32000,12000000); | ||
52 | |||
53 | /* Initializes MCLK Clocks System with DCO */ | ||
54 | MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_12); | ||
55 | MAP_CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1); | ||
56 | |||
57 | /* | ||
58 | * Configuring SysTick to trigger at 6000000 | ||
59 | * MCLK is 12MHz so this will make it toggle every 0.5s | ||
60 | */ | ||
61 | MAP_SysTick_enableModule(); | ||
62 | MAP_SysTick_setPeriod(6000000); | ||
63 | MAP_Interrupt_enableSleepOnIsrExit(); | ||
64 | MAP_SysTick_enableInterrupt(); | ||
65 | |||
66 | /* Enabling MASTER interrupts */ | ||
67 | MAP_Interrupt_enableMaster(); | ||
68 | |||
69 | while (1) | ||
70 | { | ||
71 | MAP_PCM_gotoLPM0(); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | void SysTick_Handler(void) | ||
76 | { | ||
77 | if(MAP_GPIO_getInputPinValue(HID_PORT,BUTTON)){ | ||
78 | MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P6, GPIO_PIN2|GPIO_PIN3); | ||
79 | } | ||
80 | } | ||