@@ -1,35 +1,37 | |||||
1 | # use glob syntax. |
|
1 | # use glob syntax. | |
2 | syntax: glob |
|
2 | syntax: glob | |
3 |
|
3 | |||
4 | *.*~ |
|
4 | *.*~ | |
5 | *~ |
|
5 | *~ | |
6 | *.o |
|
6 | *.o | |
7 | *.a |
|
7 | *.a | |
8 | *.hex |
|
8 | *.hex | |
9 | *.bin |
|
9 | *.bin | |
10 | *.d |
|
10 | *.d | |
11 | *.dump |
|
11 | *.dump | |
12 | *.map |
|
12 | *.map | |
13 | *.user |
|
13 | *.user | |
14 | *.user.* |
|
14 | *.user.* | |
15 | *.orig |
|
15 | *.orig | |
|
16 | Makefile.* | |||
|
17 | *.Makefile.* | |||
16 | bsp/src/LFR-142200/Makefile |
|
18 | bsp/src/LFR-142200/Makefile | |
17 | bsp/src/LFR-142200/lpc17XX.mk |
|
19 | bsp/src/LFR-142200/lpc17XX.mk | |
18 | bsp/src/STM32F4Discovery/Makefile |
|
20 | bsp/src/STM32F4Discovery/Makefile | |
19 | bsp/src/generic/lpc17XX.mk |
|
21 | bsp/src/generic/lpc17XX.mk | |
20 | examples/LFR/Makefile |
|
22 | examples/LFR/Makefile | |
21 | examples/LFR/helloWorld/Makefile |
|
23 | examples/LFR/helloWorld/Makefile | |
22 | examples/STM32F4Discovery/Makefile |
|
24 | examples/STM32F4Discovery/Makefile | |
23 | examples/STM32F4Discovery/blink2/Makefile |
|
25 | examples/STM32F4Discovery/blink2/Makefile | |
24 | examples/STM32F4Discovery/blink/Makefile |
|
26 | examples/STM32F4Discovery/blink/Makefile | |
25 | lib/src/LEON3/APB/Makefile |
|
27 | lib/src/LEON3/APB/Makefile | |
26 | lib/src/LEON3/Makefile |
|
28 | lib/src/LEON3/Makefile | |
27 | lib/src/common/UHANDLE/stm32f4XX.mk |
|
29 | lib/src/common/UHANDLE/stm32f4XX.mk | |
28 | lib/src/stm32f4/CORE/Makefile |
|
30 | lib/src/stm32f4/CORE/Makefile | |
29 | lib/src/stm32f4/Makefile |
|
31 | lib/src/stm32f4/Makefile | |
30 | lib/src/stm32f4/STLIB/Makefile |
|
32 | lib/src/stm32f4/STLIB/Makefile | |
31 | lib/src/stm32f4/UART/Makefile |
|
33 | lib/src/stm32f4/UART/Makefile | |
32 | rules/stm32f4-arm-noabi-gcc/rules.mk |
|
34 | rules/stm32f4-arm-noabi-gcc/rules.mk | |
33 | *.aux |
|
35 | *.aux | |
34 | *.ps |
|
36 | *.ps | |
35 | *.out |
|
37 | *.out |
@@ -1,93 +1,91 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the libuc, microcontroler library |
|
2 | -- This file is a part of the libuc, microcontroler library | |
3 | -- Copyright (C) 2011, Alexis Jeandet |
|
3 | -- Copyright (C) 2011, Alexis Jeandet | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | ------------------------------------------------------------------------------- |
|
18 | ------------------------------------------------------------------------------- | |
19 | -- Author : Alexis Jeandet |
|
19 | -- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@gmail.com |
|
20 | -- Mail : alexis.jeandet@gmail.com | |
21 | -------------------------------------------------------------------------------*/ |
|
21 | -------------------------------------------------------------------------------*/ | |
22 | #ifndef BSP_H |
|
22 | #ifndef BSP_H | |
23 | #define BSP_H |
|
23 | #define BSP_H | |
24 | #include <stm32f4xx.h> |
|
24 | #include <stm32f4xx.h> | |
25 | #include <stm32f4xx_gpio.h> |
|
25 | #include <stm32f4xx_gpio.h> | |
26 | #include <stm32f4xx_rcc.h> |
|
26 | #include <stm32f4xx_rcc.h> | |
27 | #include <gpio.h> |
|
27 | #include <gpio.h> | |
28 |
|
28 | |||
29 | #define __MAX_OPENED_FILES__ 4 |
|
29 | #define __MAX_OPENED_FILES__ 4 | |
30 | #define __FS_ROOT_SIZE__ 4 |
|
30 | #define __FS_ROOT_SIZE__ 4 | |
31 | /* |
|
31 | /* | |
32 | #ifndef PD8 |
|
32 | #ifndef PD8 | |
33 | #define PD8 |
|
33 | #define PD8 | |
34 | #endif |
|
34 | #endif | |
35 | #ifndef PD9 |
|
35 | #ifndef PD9 | |
36 | #define PD9 |
|
36 | #define PD9 | |
37 | #endif |
|
37 | #endif | |
38 | */ |
|
38 | */ | |
39 |
|
39 | |||
40 |
#define LED1 P |
|
40 | #define LED1 PF6 | |
41 |
#define LED2 P |
|
41 | #define LED2 PF7 | |
|
42 | #define LED3 PF8 | |||
42 |
|
43 | |||
43 | #define LED3ON GPIOB->BSRRH = GPIO_Pin_15 |
|
44 | #define PSU_DISABLE PH2 | |
44 | #define LED2ON GPIOD->BSRRH = GPIO_Pin_8 |
|
45 | #define PSU_ALERT_5V PF2 | |
45 | #define LED1ON GPIOD->BSRRH = GPIO_Pin_9 |
|
46 | #define PSU_ALERT_1_5V PF3 | |
46 |
|
47 | #define PSU_ALERT_3_3V PF4 | ||
47 | #define LED3OFF GPIOB->BSRRL = GPIO_Pin_15 |
|
|||
48 | #define LED2OFF GPIOD->BSRRL = GPIO_Pin_8 |
|
|||
49 | #define LED1OFF GPIOD->BSRRL = GPIO_Pin_9 |
|
|||
50 |
|
48 | |||
51 | extern float VREF0; |
|
49 | extern float VREF0; | |
52 |
|
50 | |||
53 | extern uint32_t currentCpuFreq; |
|
51 | extern uint32_t currentCpuFreq; | |
54 |
|
52 | |||
55 | extern int bsp_init(); |
|
53 | extern int bsp_init(); | |
56 |
|
54 | |||
57 | extern void bsp_GPIO_init(); |
|
55 | extern void bsp_GPIO_init(); | |
58 | extern void bsp_uart_init(); |
|
56 | extern void bsp_uart_init(); | |
59 | extern void bsp_iic_init(); |
|
57 | extern void bsp_iic_init(); | |
60 | extern void bsp_spi_init(); |
|
58 | extern void bsp_spi_init(); | |
61 | extern void bsp_SD_init(); |
|
59 | extern void bsp_SD_init(); | |
62 |
|
60 | |||
63 | /* VS1053 */ |
|
61 | /* VS1053 */ | |
64 | extern void clearXCS(); |
|
62 | extern void clearXCS(); | |
65 | extern void setXCS(); |
|
63 | extern void setXCS(); | |
66 | extern int vs10XXDREQ(); |
|
64 | extern int vs10XXDREQ(); | |
67 |
|
65 | |||
68 | /* SD CARD */ |
|
66 | /* SD CARD */ | |
69 | void bsppowersdcard(char onoff); |
|
67 | void bsppowersdcard(char onoff); | |
70 | char bspsdcardpresent(); |
|
68 | char bspsdcardpresent(); | |
71 | void bspsdcardselect(char YESNO); |
|
69 | void bspsdcardselect(char YESNO); | |
72 | char bspsdcardwriteprotected(); |
|
70 | char bspsdcardwriteprotected(); | |
73 |
|
71 | |||
74 | #endif |
|
72 | #endif | |
75 |
|
73 | |||
76 |
|
74 | |||
77 |
|
75 | |||
78 |
|
76 | |||
79 |
|
77 | |||
80 |
|
78 | |||
81 |
|
79 | |||
82 |
|
80 | |||
83 |
|
81 | |||
84 |
|
82 | |||
85 |
|
83 | |||
86 |
|
84 | |||
87 |
|
85 | |||
88 |
|
86 | |||
89 |
|
87 | |||
90 |
|
88 | |||
91 |
|
89 | |||
92 |
|
90 | |||
93 |
|
91 |
@@ -1,132 +1,143 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the libuc, microcontroler library |
|
2 | -- This file is a part of the libuc, microcontroler library | |
3 | -- Copyright (C) 2011, Alexis Jeandet |
|
3 | -- Copyright (C) 2011, Alexis Jeandet | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | ------------------------------------------------------------------------------- |
|
18 | ------------------------------------------------------------------------------- | |
19 | -- Author : Alexis Jeandet |
|
19 | -- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@gmail.com |
|
20 | -- Mail : alexis.jeandet@gmail.com | |
21 | -------------------------------------------------------------------------------*/ |
|
21 | -------------------------------------------------------------------------------*/ | |
22 | #include "bsp.h" |
|
22 | #include "bsp.h" | |
23 | #include <streamdevices.h> |
|
23 | #include <streamdevices.h> | |
24 | #include <malloc.h> |
|
24 | #include <malloc.h> | |
25 | #include <gpio.h> |
|
25 | #include <gpio.h> | |
26 | #include <uart.h> |
|
26 | #include <uart.h> | |
27 | #include <stdio.h> |
|
27 | #include <stdio.h> | |
28 | uint32_t OSC0 =8000000; |
|
28 | uint32_t OSC0 =8000000; | |
29 | uint32_t INTOSC =16000000; |
|
29 | uint32_t INTOSC =16000000; | |
30 | uint32_t RTCOSC =32768; |
|
30 | uint32_t RTCOSC =32768; | |
31 | uint32_t currentCpuFreq=0; |
|
31 | uint32_t currentCpuFreq=0; | |
32 | extern streamdevice* __opnfiles__[__MAX_OPENED_FILES__]; |
|
32 | extern streamdevice* __opnfiles__[__MAX_OPENED_FILES__]; | |
33 |
|
33 | |||
34 | float VREF0 =(float)3.3; |
|
34 | float VREF0 =(float)3.3; | |
35 |
|
35 | |||
36 | int bsp_init() |
|
36 | int bsp_init() | |
37 | { |
|
37 | { | |
38 | int i=0; |
|
38 | int i=0; | |
39 | for(i=0;i<32;i++) |
|
39 | for(i=0;i<32;i++) | |
40 | { |
|
40 | { | |
41 | __opnfiles__[i] = NULL; |
|
41 | __opnfiles__[i] = NULL; | |
42 | } |
|
42 | } | |
43 | bsp_GPIO_init(); |
|
43 | bsp_GPIO_init(); | |
44 | bsp_uart_init(); |
|
44 | bsp_uart_init(); | |
45 | printf("\r================================================================\n\r"); |
|
45 | printf("\r================================================================\n\r"); | |
46 | printf("================================================================\n\r"); |
|
46 | printf("================================================================\n\r"); | |
47 | printf(BSP); |
|
47 | printf(BSP); | |
48 | printf(" initialised\n\r"); |
|
48 | printf(" initialised\n\r"); | |
49 | printf("================================================================\n\r"); |
|
49 | printf("================================================================\n\r"); | |
50 | return 1; |
|
50 | return 1; | |
51 | } |
|
51 | } | |
52 |
|
52 | |||
53 | void bsp_GPIO_init() |
|
53 | void bsp_GPIO_init() | |
54 | { |
|
54 | { | |
55 | gpio_t gpio1 = gpioopen(PD12);//gpioopen(LED1); //PD9 D=> 0x0300 9 => 0x0009 |
|
55 | gpio_t gpio1 = gpioopen(LED1); | |
56 |
gpio_t gpio2 = gpioopen( |
|
56 | gpio_t gpio2 = gpioopen(LED2); | |
57 |
gpio_t gpio3 = gpioopen( |
|
57 | gpio_t gpio3 = gpioopen(LED3); | |
58 |
gpio_t gpio4 = gpioopen(P |
|
58 | gpio_t gpio4 = gpioopen(PSU_DISABLE); | |
|
59 | gpio_t gpio5 = gpioopen(PSU_ALERT_5V); | |||
|
60 | gpio_t gpio6 = gpioopen(PSU_ALERT_1_5V); | |||
|
61 | gpio_t gpio7 = gpioopen(PSU_ALERT_3_3V); | |||
59 | gpiosetspeed(&gpio1,gpiohighspeed); |
|
62 | gpiosetspeed(&gpio1,gpiohighspeed); | |
60 | gpiosetspeed(&gpio2,gpiohighspeed); |
|
63 | gpiosetspeed(&gpio2,gpiohighspeed); | |
61 | gpiosetspeed(&gpio3,gpiohighspeed); |
|
64 | gpiosetspeed(&gpio3,gpiohighspeed); | |
62 | gpiosetspeed(&gpio4,gpiohighspeed); |
|
65 | gpiosetspeed(&gpio4,gpiohighspeed); | |
|
66 | gpiosetspeed(&gpio5,gpiohighspeed); | |||
|
67 | gpiosetspeed(&gpio6,gpiohighspeed); | |||
|
68 | gpiosetspeed(&gpio7,gpiohighspeed); | |||
|
69 | gpioclr(PSU_DISABLE); | |||
63 | gpiosetdir(&gpio1,gpiooutdir); |
|
70 | gpiosetdir(&gpio1,gpiooutdir); | |
64 | gpiosetdir(&gpio3,gpiooutdir); |
|
71 | gpiosetdir(&gpio3,gpiooutdir); | |
65 | gpiosetdir(&gpio2,gpiooutdir); |
|
72 | gpiosetdir(&gpio2,gpiooutdir); | |
66 | gpiosetdir(&gpio4,gpiooutdir); |
|
73 | gpiosetdir(&gpio4,gpiooutdir); | |
|
74 | gpiosetdir(&gpio5,gpioindir); | |||
|
75 | gpiosetdir(&gpio6,gpioindir); | |||
|
76 | gpiosetdir(&gpio7,gpioindir); | |||
|
77 | gpioclr(PSU_DISABLE); | |||
67 | } |
|
78 | } | |
68 |
|
79 | |||
69 | void bsp_uart_init() |
|
80 | void bsp_uart_init() | |
70 | { |
|
81 | { | |
71 | if(__opnfiles__[1]==NULL) |
|
82 | if(__opnfiles__[1]==NULL) | |
72 | { |
|
83 | { | |
73 | uart_t* uart1 = (uart_t*)malloc(sizeof(uart_t)); |
|
84 | uart_t* uart1 = (uart_t*)malloc(sizeof(uart_t)); | |
74 | streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice)); |
|
85 | streamdevice* fd1 = (streamdevice*)malloc(sizeof(streamdevice)); | |
75 | uartopenandconfig(0,uart1,uartparitynone | uart8bits | uartonestop,115200,PA9,PA10,-1,-1); |
|
86 | uartopenandconfig(0,uart1,uartparitynone | uart8bits | uartonestop,115200,PA9,PA10,-1,-1); | |
76 | uartmkstreamdev(uart1,fd1); |
|
87 | uartmkstreamdev(uart1,fd1); | |
77 | __opnfiles__[1] = fd1; |
|
88 | __opnfiles__[1] = fd1; | |
78 | } |
|
89 | } | |
79 | else |
|
90 | else | |
80 | { |
|
91 | { | |
81 | uartopenandconfig(0,(uart_t*)__opnfiles__[1]->_stream,uartparitynone | uart8bits | uartonestop,115200,PA9,PA10,-1,-1); |
|
92 | uartopenandconfig(0,(uart_t*)__opnfiles__[1]->_stream,uartparitynone | uart8bits | uartonestop,115200,PA9,PA10,-1,-1); | |
82 | } |
|
93 | } | |
83 | } |
|
94 | } | |
84 |
|
95 | |||
85 | void bsp_spi_init() |
|
96 | void bsp_spi_init() | |
86 | { |
|
97 | { | |
87 |
|
98 | |||
88 | } |
|
99 | } | |
89 |
|
100 | |||
90 |
|
101 | |||
91 | void bsp_iic_init() |
|
102 | void bsp_iic_init() | |
92 | { |
|
103 | { | |
93 |
|
104 | |||
94 | } |
|
105 | } | |
95 |
|
106 | |||
96 | void bsp_SD_init() |
|
107 | void bsp_SD_init() | |
97 | { |
|
108 | { | |
98 |
|
109 | |||
99 | } |
|
110 | } | |
100 |
|
111 | |||
101 | void vs10XXclearXCS(){} |
|
112 | void vs10XXclearXCS(){} | |
102 | void vs10XXsetXCS(){} |
|
113 | void vs10XXsetXCS(){} | |
103 | int vs10XXDREQ() |
|
114 | int vs10XXDREQ() | |
104 | { |
|
115 | { | |
105 |
|
|
116 | return 1; | |
106 | } |
|
117 | } | |
107 |
|
118 | |||
108 |
|
119 | |||
109 | void bsppowersdcard(char onoff) //always ON |
|
120 | void bsppowersdcard(char onoff) //always ON | |
110 | { |
|
121 | { | |
111 |
|
122 | |||
112 | } |
|
123 | } | |
113 |
|
124 | |||
114 | char bspsdcardpresent() |
|
125 | char bspsdcardpresent() | |
115 | { |
|
126 | { | |
116 |
|
|
127 | return 0; | |
117 | } |
|
128 | } | |
118 |
|
129 | |||
119 | char bspsdcardwriteprotected() |
|
130 | char bspsdcardwriteprotected() | |
120 | { |
|
131 | { | |
121 |
|
|
132 | return 0; | |
122 | } |
|
133 | } | |
123 |
|
134 | |||
124 | void bspsdcardselect(char YESNO) |
|
135 | void bspsdcardselect(char YESNO) | |
125 | { |
|
136 | { | |
126 |
|
137 | |||
127 | } |
|
138 | } | |
128 |
|
139 | |||
129 |
|
140 | |||
130 |
|
141 | |||
131 |
|
142 | |||
132 |
|
143 |
@@ -1,52 +1,45 | |||||
1 | #include <stdio.h> |
|
1 | #include <stdio.h> | |
2 | #include <fat32.h> |
|
2 | #include <fat32.h> | |
3 | #include <gpio.h> |
|
3 | #include <gpio.h> | |
4 | #include <uart.h> |
|
4 | #include <uart.h> | |
5 | #include <stm32f4xx.h> |
|
5 | #include <stm32f4xx.h> | |
|
6 | #include <bsp.h> | |||
6 |
|
7 | |||
7 |
|
8 | |||
8 | extern streamdevice* __opnfiles__[]; |
|
9 | extern streamdevice* __opnfiles__[]; | |
9 |
|
10 | |||
10 | int main() |
|
11 | int main() | |
11 | { |
|
12 | { | |
12 | gpio_t gpio1 = gpioopen(PF6);//gpioopen(LED1); //PD9 D=> 0x0300 9 => 0x0009 |
|
13 | gpioset(PSU_DISABLE); | |
13 | gpio_t gpio2 = gpioopen(PF7);//gpioopen(LED2); |
|
|||
14 | gpio_t gpio3 = gpioopen(PF8);//gpioopen(LED2); |
|
|||
15 | gpiosetspeed(&gpio1,gpiohighspeed); |
|
|||
16 | gpiosetspeed(&gpio2,gpiohighspeed); |
|
|||
17 | gpiosetspeed(&gpio3,gpiohighspeed); |
|
|||
18 | gpiosetdir(&gpio1,gpiooutdir); |
|
|||
19 | gpiosetdir(&gpio3,gpiooutdir); |
|
|||
20 | gpiosetdir(&gpio2,gpiooutdir); |
|
|||
21 | while(1) |
|
14 | while(1) | |
22 | { |
|
15 | { | |
23 | for(volatile int i=0;i<1024*2048;i++); |
|
16 | for(volatile int i=0;i<1024*2048;i++); | |
24 |
gpioset( |
|
17 | gpioset(LED1); | |
25 |
gpioclr( |
|
18 | gpioclr(LED2); | |
26 | for(volatile int i=0;i<1024*2048;i++); |
|
19 | for(volatile int i=0;i<1024*2048;i++); | |
27 |
gpioclr( |
|
20 | gpioclr(LED1); | |
28 |
gpioset( |
|
21 | gpioset(LED2); | |
29 | } |
|
22 | } | |
30 | printf("hello world\n\r"); |
|
23 | printf("hello world\n\r"); | |
31 | return 0; |
|
24 | return 0; | |
32 | } |
|
25 | } | |
33 |
|
26 | |||
34 |
|
27 | |||
35 |
|
28 | |||
36 | void USART3_IRQHandler(void) |
|
29 | void USART3_IRQHandler(void) | |
37 | { |
|
30 | { | |
38 | while(1) |
|
31 | while(1) | |
39 | { |
|
32 | { | |
40 | for(volatile int i=0;i<1024*2048;i++); |
|
33 | for(volatile int i=0;i<1024*2048;i++); | |
41 | gpioset(PD12); |
|
34 | gpioset(PD12); | |
42 | gpioclr(PD14); |
|
35 | gpioclr(PD14); | |
43 | for(volatile int i=0;i<1024*2048;i++); |
|
36 | for(volatile int i=0;i<1024*2048;i++); | |
44 | gpioclr(PD12); |
|
37 | gpioclr(PD12); | |
45 | gpioset(PD14); |
|
38 | gpioset(PD14); | |
46 | } |
|
39 | } | |
47 | } |
|
40 | } | |
48 |
|
41 | |||
49 |
|
42 | |||
50 |
|
43 | |||
51 |
|
44 | |||
52 |
|
45 |
@@ -1,59 +1,59 | |||||
1 | /*------------------------------------------------------------------------------ |
|
1 | /*------------------------------------------------------------------------------ | |
2 | -- This file is a part of the libuc, microcontroler library |
|
2 | -- This file is a part of the libuc, microcontroler library | |
3 | -- Copyright (C) 2011, Alexis Jeandet |
|
3 | -- Copyright (C) 2011, Alexis Jeandet | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | ------------------------------------------------------------------------------- |
|
18 | ------------------------------------------------------------------------------- | |
19 | -- Author : Alexis Jeandet |
|
19 | -- Author : Alexis Jeandet | |
20 | -- Mail : alexis.jeandet@gmail.com |
|
20 | -- Mail : alexis.jeandet@gmail.com | |
21 | -------------------------------------------------------------------------------*/ |
|
21 | -------------------------------------------------------------------------------*/ | |
22 | #include "core.h" |
|
22 | #include "core.h" | |
23 | #include <stm32f4xx_rcc.h> |
|
23 | #include <stm32f4xx_rcc.h> | |
24 |
|
24 | |||
25 | extern uint32_t OSC0; |
|
25 | //extern uint32_t OSC0; | |
26 | extern uint32_t INTOSC; |
|
26 | extern uint32_t INTOSC; | |
27 | extern uint32_t RTCOSC; |
|
27 | extern uint32_t RTCOSC; | |
28 |
|
28 | |||
29 | void coresetCpuFreq(unsigned int freq) |
|
29 | void coresetCpuFreq(unsigned int freq) | |
30 | { |
|
30 | { | |
31 |
|
31 | |||
32 |
|
32 | |||
33 | } |
|
33 | } | |
34 |
|
34 | |||
35 |
|
35 | |||
36 |
|
36 | |||
37 |
|
37 | |||
38 | unsigned int coregetCpuFreq() |
|
38 | unsigned int coregetCpuFreq() | |
39 | { |
|
39 | { | |
40 | RCC_ClocksTypeDef RCC_ClocksStatus; |
|
40 | RCC_ClocksTypeDef RCC_ClocksStatus; | |
41 | RCC_GetClocksFreq(&RCC_ClocksStatus); |
|
41 | RCC_GetClocksFreq(&RCC_ClocksStatus); | |
42 | return RCC_ClocksStatus.SYSCLK_Frequency; |
|
42 | return RCC_ClocksStatus.SYSCLK_Frequency; | |
43 | } |
|
43 | } | |
44 |
|
44 | |||
45 |
|
45 | |||
46 |
|
46 | |||
47 |
|
47 | |||
48 |
|
48 | |||
49 |
|
49 | |||
50 |
|
50 | |||
51 |
|
51 | |||
52 |
|
52 | |||
53 |
|
53 | |||
54 |
|
54 | |||
55 |
|
55 | |||
56 |
|
56 | |||
57 |
|
57 | |||
58 |
|
58 | |||
59 |
|
59 |
@@ -1,6 +1,6 | |||||
1 | TEMPLATE = subdirs |
|
1 | TEMPLATE = subdirs | |
2 | CONFIG += ordered |
|
2 | CONFIG += ordered | |
3 | SUBDIRS += lib \ |
|
3 | SUBDIRS += lib \ | |
4 | bsp\ |
|
4 | bsp\ | |
5 | examples |
|
5 | examples | |
6 |
|
6 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed | ||
This diff has been collapsed as it changes many lines, (1393 lines changed) Show them Hide them |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now