Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
8bdbc20e
Commit
8bdbc20e
authored
Apr 18, 2015
by
Damien George
Browse files
stmhal: Make HSE PLL parameters configurable per board.
parent
23008db6
Changes
8
Hide whitespace changes
Inline
Side-by-side
stmhal/boards/CERB40/mpconfigboard.h
View file @
8bdbc20e
...
...
@@ -20,6 +20,12 @@
#define MICROPY_HW_ENABLE_SPI3 (1)
#define MICROPY_HW_ENABLE_CAN (1)
// HSE is 12MHz
#define MICROPY_HW_CLK_PLLM (12)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
// The Cerb40 has No LEDs
// The Cerb40 has No SDCard
...
...
stmhal/boards/HYDRABUS/mpconfigboard.h
View file @
8bdbc20e
...
...
@@ -19,6 +19,12 @@
#define MICROPY_HW_ENABLE_SPI3 (1)
#define MICROPY_HW_ENABLE_CAN (0)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
// USRSW/UBTN (Needs Jumper UBTN) is pulled low. Pressing the button makes the input go high.
#define MICROPY_HW_USRSW_PIN (pin_A0)
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
...
...
stmhal/boards/NETDUINO_PLUS_2/mpconfigboard.h
View file @
8bdbc20e
...
...
@@ -23,6 +23,12 @@
#define MICROPY_HW_ENABLE_SPI3 (0)
#define MICROPY_HW_ENABLE_CAN (0)
// HSE is 25MHz
#define MICROPY_HW_CLK_PLLM (25)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
// USRSW is pulled low. Pressing the button makes the input go high.
#define MICROPY_HW_USRSW_PIN (pin_B11)
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
...
...
stmhal/boards/PYBV10/mpconfigboard.h
View file @
8bdbc20e
...
...
@@ -20,6 +20,12 @@
#define MICROPY_HW_ENABLE_SPI3 (0)
#define MICROPY_HW_ENABLE_CAN (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
// The pyboard has a 32kHz crystal for the RTC
#define MICROPY_HW_RTC_USE_LSE (1)
...
...
stmhal/boards/PYBV3/mpconfigboard.h
View file @
8bdbc20e
...
...
@@ -19,6 +19,12 @@
#define MICROPY_HW_ENABLE_SPI3 (0)
#define MICROPY_HW_ENABLE_CAN (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
// The pyboard has a 32kHz crystal for the RTC
#define MICROPY_HW_RTC_USE_LSE (1)
...
...
stmhal/boards/PYBV4/mpconfigboard.h
View file @
8bdbc20e
...
...
@@ -19,6 +19,12 @@
#define MICROPY_HW_ENABLE_SPI3 (0)
#define MICROPY_HW_ENABLE_CAN (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
// The pyboard has a 32kHz crystal for the RTC
#define MICROPY_HW_RTC_USE_LSE (1)
...
...
stmhal/boards/STM32F4DISC/mpconfigboard.h
View file @
8bdbc20e
...
...
@@ -19,6 +19,12 @@
#define MICROPY_HW_ENABLE_SPI3 (0)
#define MICROPY_HW_ENABLE_CAN (1)
// HSE is 8MHz
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
// USRSW is pulled low. Pressing the button makes the input go high.
#define MICROPY_HW_USRSW_PIN (pin_A0)
#define MICROPY_HW_USRSW_PULL (GPIO_NOPULL)
...
...
stmhal/system_stm32f4xx.c
View file @
8bdbc20e
...
...
@@ -91,6 +91,7 @@
* @{
*/
#include
"mpconfigboard.h"
#include
"stm32f4xx_hal.h"
void
__fatal_error
(
const
char
*
msg
);
...
...
@@ -365,10 +366,10 @@ void SystemClock_Config(void)
RCC_OscInitStruct
.
HSEState
=
RCC_HSE_ON
;
RCC_OscInitStruct
.
PLL
.
PLLState
=
RCC_PLL_ON
;
RCC_OscInitStruct
.
PLL
.
PLLSource
=
RCC_PLLSOURCE_HSE
;
RCC_OscInitStruct
.
PLL
.
PLLM
=
HSE_VALUE
/
1000000
;
RCC_OscInitStruct
.
PLL
.
PLLN
=
336
;
RCC_OscInitStruct
.
PLL
.
PLLP
=
RCC_PLLP_DIV2
;
RCC_OscInitStruct
.
PLL
.
PLLQ
=
7
;
RCC_OscInitStruct
.
PLL
.
PLLM
=
MICROPY_HW_CLK_PLLM
;
RCC_OscInitStruct
.
PLL
.
PLLN
=
MICROPY_HW_CLK_PLLN
;
RCC_OscInitStruct
.
PLL
.
PLLP
=
MICROPY_HW_CLK_PLLP
;
RCC_OscInitStruct
.
PLL
.
PLLQ
=
MICROPY_HW_CLK_PLLQ
;
if
(
HAL_RCC_OscConfig
(
&
RCC_OscInitStruct
)
!=
HAL_OK
)
{
__fatal_error
(
"HAL_RCC_OscConfig"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment