Hallo, ich bi ganz neu in der ARM Programmierung und wollte bei dem STR912 auf einem selbstgebauten Board einfach mal eine LED leuchten lassen.. Jedoch blicke ich bei dem Wirrwar aus KEIL und ST Programmbeispielen nicht durch. ich arbeite mit uVision und will nur den port 7.0 einfach mal auf High schalten. Hier mein bisheriger CODE... leider andert sich an PIN5 nix...
1 | |
2 | #include <91x_lib.h> |
3 | #include <91x_gpio.h> |
4 | |
5 | |
6 | void LedShow_Init(void); |
7 | void LedShow(FunctionalState NewState); |
8 | |
9 | bool LedShowStatus = FALSE; |
10 | GPIO_InitTypeDef GPIO_InitStructure; |
11 | |
12 | int main(void) |
13 | {
|
14 | while (1){ |
15 | LedShow_Init(); |
16 | LedShow(ENABLE); |
17 | }
|
18 | |
19 | }
|
20 | |
21 | void LedShow_Init(void) |
22 | {
|
23 | |
24 | GPIO_StructInit(&GPIO_InitStructure); |
25 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; |
26 | GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
27 | GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
28 | GPIO_Init(GPIO7, &GPIO_InitStructure); |
29 | }
|
30 | |
31 | |
32 | void LedShow(FunctionalState NewState) |
33 | {
|
34 | if(NewState == ENABLE) |
35 | {
|
36 | LedShowStatus = TRUE; |
37 | }
|
38 | else
|
39 | {
|
40 | LedShowStatus = FALSE; |
41 | }
|
42 | }
|