amiro-os / os / modules / PowerManagement_1-1 / board.c @ 680d05e5
History | View | Annotate | Download (2.744 KB)
1 | e545e620 | Thomas Schöpping | /*
|
---|---|---|---|
2 | AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
||
3 | Copyright (C) 2016..2018 Thomas Schöpping et al.
|
||
4 | |||
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
|
||
7 | the Free Software Foundation, either version 3 of the License, or
|
||
8 | (at your option) any later version.
|
||
9 | |||
10 | This program is distributed in the hope that it will be useful,
|
||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | GNU General Public License for more details.
|
||
14 | |||
15 | You should have received a copy of the GNU General Public License
|
||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
17 | */
|
||
18 | |||
19 | #include <hal.h> |
||
20 | |||
21 | #if HAL_USE_PAL || defined(__DOXYGEN__)
|
||
22 | /**
|
||
23 | * @brief PAL setup.
|
||
24 | * @details Digital I/O ports static configuration as defined in @p board.h.
|
||
25 | * This variable is used by the HAL when initializing the PAL driver.
|
||
26 | */
|
||
27 | const PALConfig pal_default_config = {
|
||
28 | #if STM32_HAS_GPIOA
|
||
29 | {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, |
||
30 | VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, |
||
31 | #endif
|
||
32 | #if STM32_HAS_GPIOB
|
||
33 | {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, |
||
34 | VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, |
||
35 | #endif
|
||
36 | #if STM32_HAS_GPIOC
|
||
37 | {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, |
||
38 | VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, |
||
39 | #endif
|
||
40 | #if STM32_HAS_GPIOD
|
||
41 | {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, |
||
42 | VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, |
||
43 | #endif
|
||
44 | #if STM32_HAS_GPIOE
|
||
45 | {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, |
||
46 | VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, |
||
47 | #endif
|
||
48 | #if STM32_HAS_GPIOF
|
||
49 | {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, |
||
50 | VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, |
||
51 | #endif
|
||
52 | #if STM32_HAS_GPIOG
|
||
53 | {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, |
||
54 | VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, |
||
55 | #endif
|
||
56 | #if STM32_HAS_GPIOH
|
||
57 | {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, |
||
58 | VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, |
||
59 | #endif
|
||
60 | #if STM32_HAS_GPIOI
|
||
61 | {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, |
||
62 | VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} |
||
63 | #endif
|
||
64 | }; |
||
65 | #endif
|
||
66 | |||
67 | /**
|
||
68 | * @brief Early initialization code.
|
||
69 | * @details This initialization must be performed just after stack setup
|
||
70 | * and before any other initialization.
|
||
71 | */
|
||
72 | void __early_init(void) { |
||
73 | |||
74 | stm32_clock_init(); |
||
75 | } |
||
76 | |||
77 | /**
|
||
78 | * @brief Board-specific initialization code.
|
||
79 | * @todo Add your board-specific code, if any.
|
||
80 | */
|
||
81 | void boardInit(void) { |
||
82 | } |