amiro-os / modules / STM32F4Discovery / module.c @ 2dd2e257
History | View | Annotate | Download (4.702 KB)
| 1 | 07ff44a7 | Thomas Schöpping | /*
|
|---|---|---|---|
| 2 | AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
||
| 3 | 84f0ce9e | Thomas Schöpping | Copyright (C) 2016..2019 Thomas Schöpping et al.
|
| 4 | 07ff44a7 | Thomas Schöpping | |
| 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 | /**
|
||
| 20 | * @file
|
||
| 21 | * @brief Structures and constant for the PowerManagement module.
|
||
| 22 | *
|
||
| 23 | * @addtogroup powermanagement_module
|
||
| 24 | * @{
|
||
| 25 | */
|
||
| 26 | |||
| 27 | #include "module.h" |
||
| 28 | |||
| 29 | #include <amiroos.h> |
||
| 30 | |||
| 31 | /*===========================================================================*/
|
||
| 32 | /**
|
||
| 33 | * @name Module specific functions
|
||
| 34 | * @{
|
||
| 35 | */
|
||
| 36 | /*===========================================================================*/
|
||
| 37 | |||
| 38 | /** @} */
|
||
| 39 | |||
| 40 | /*===========================================================================*/
|
||
| 41 | /**
|
||
| 42 | * @name ChibiOS/HAL configuration
|
||
| 43 | * @{
|
||
| 44 | */
|
||
| 45 | /*===========================================================================*/
|
||
| 46 | |||
| 47 | SerialConfig moduleHalProgIfConfig = {
|
||
| 48 | /* bit rate */ 115200, |
||
| 49 | /* CR1 */ 0, |
||
| 50 | /* CR1 */ 0, |
||
| 51 | /* CR1 */ 0, |
||
| 52 | }; |
||
| 53 | |||
| 54 | /** @} */
|
||
| 55 | |||
| 56 | /*===========================================================================*/
|
||
| 57 | /**
|
||
| 58 | * @name GPIO definitions
|
||
| 59 | * @{
|
||
| 60 | */
|
||
| 61 | /*===========================================================================*/
|
||
| 62 | |||
| 63 | /**
|
||
| 64 | * @brief Red LED output signal GPIO.
|
||
| 65 | */
|
||
| 66 | static apalGpio_t _gpioLedRed = {
|
||
| 67 | /* port */ GPIOD,
|
||
| 68 | /* pad */ GPIOD_LED5,
|
||
| 69 | }; |
||
| 70 | ROMCONST apalControlGpio_t moduleGpioLedRed = {
|
||
| 71 | /* GPIO */ &_gpioLedRed,
|
||
| 72 | /* meta */ {
|
||
| 73 | /* direction */ APAL_GPIO_DIRECTION_OUTPUT,
|
||
| 74 | /* active state */ APAL_GPIO_ACTIVE_HIGH,
|
||
| 75 | /* interrupt edge */ APAL_GPIO_EDGE_NONE,
|
||
| 76 | }, |
||
| 77 | }; |
||
| 78 | |||
| 79 | /**
|
||
| 80 | * @brief Green LED output signal GPIO.
|
||
| 81 | */
|
||
| 82 | static apalGpio_t _gpioLedGreen = {
|
||
| 83 | /* port */ GPIOD,
|
||
| 84 | /* pad */ GPIOD_LED4,
|
||
| 85 | }; |
||
| 86 | ROMCONST apalControlGpio_t moduleGpioLedGreen = {
|
||
| 87 | /* GPIO */ &_gpioLedGreen,
|
||
| 88 | /* meta */ {
|
||
| 89 | /* direction */ APAL_GPIO_DIRECTION_OUTPUT,
|
||
| 90 | /* active state */ APAL_GPIO_ACTIVE_HIGH,
|
||
| 91 | /* interrupt edge */ APAL_GPIO_EDGE_NONE,
|
||
| 92 | }, |
||
| 93 | }; |
||
| 94 | |||
| 95 | /**
|
||
| 96 | * @brief Blue LED output signal GPIO.
|
||
| 97 | */
|
||
| 98 | static apalGpio_t _gpioLedBlue = {
|
||
| 99 | /* port */ GPIOD,
|
||
| 100 | /* pad */ GPIOD_LED6,
|
||
| 101 | }; |
||
| 102 | ROMCONST apalControlGpio_t moduleGpioLedBlue = {
|
||
| 103 | /* GPIO */ &_gpioLedBlue,
|
||
| 104 | /* meta */ {
|
||
| 105 | /* direction */ APAL_GPIO_DIRECTION_OUTPUT,
|
||
| 106 | /* active state */ APAL_GPIO_ACTIVE_HIGH,
|
||
| 107 | /* interrupt edge */ APAL_GPIO_EDGE_NONE,
|
||
| 108 | }, |
||
| 109 | }; |
||
| 110 | |||
| 111 | /**
|
||
| 112 | * @brief Orange LED output signal GPIO.
|
||
| 113 | */
|
||
| 114 | static apalGpio_t _gpioLedOrange = {
|
||
| 115 | /* port */ GPIOD,
|
||
| 116 | /* pad */ GPIOD_LED3,
|
||
| 117 | }; |
||
| 118 | ROMCONST apalControlGpio_t moduleGpioLedOrange = {
|
||
| 119 | /* GPIO */ &_gpioLedOrange,
|
||
| 120 | /* meta */ {
|
||
| 121 | /* direction */ APAL_GPIO_DIRECTION_OUTPUT,
|
||
| 122 | /* active state */ APAL_GPIO_ACTIVE_HIGH,
|
||
| 123 | /* interrupt edge */ APAL_GPIO_EDGE_NONE,
|
||
| 124 | }, |
||
| 125 | }; |
||
| 126 | |||
| 127 | /**
|
||
| 128 | * @brief User button input signal GPIO.
|
||
| 129 | */
|
||
| 130 | static apalGpio_t _gpioUserButton = {
|
||
| 131 | /* port */ GPIOA,
|
||
| 132 | /* pad */ GPIOA_BUTTON,
|
||
| 133 | }; |
||
| 134 | ROMCONST apalControlGpio_t moduleGpioUserButton = {
|
||
| 135 | /* GPIO */ &_gpioUserButton,
|
||
| 136 | /* meta */ {
|
||
| 137 | /* direction */ APAL_GPIO_DIRECTION_INPUT,
|
||
| 138 | /* active state */ APAL_GPIO_ACTIVE_HIGH,
|
||
| 139 | /* interrupt edge */ APAL_GPIO_EDGE_BOTH,
|
||
| 140 | }, |
||
| 141 | }; |
||
| 142 | |||
| 143 | /** @} */
|
||
| 144 | |||
| 145 | /*===========================================================================*/
|
||
| 146 | /**
|
||
| 147 | * @name AMiRo-OS core configurations
|
||
| 148 | * @{
|
||
| 149 | */
|
||
| 150 | /*===========================================================================*/
|
||
| 151 | |||
| 152 | 2dd2e257 | Thomas Schöpping | #if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
| 153 | 07ff44a7 | Thomas Schöpping | ROMCONST char* moduleShellPrompt = "STM32F407Discovery"; |
| 154 | #endif
|
||
| 155 | |||
| 156 | /** @} */
|
||
| 157 | |||
| 158 | /*===========================================================================*/
|
||
| 159 | /**
|
||
| 160 | * @name Startup Shutdown Synchronization Protocol (SSSP)
|
||
| 161 | * @{
|
||
| 162 | */
|
||
| 163 | /*===========================================================================*/
|
||
| 164 | |||
| 165 | /** @} */
|
||
| 166 | |||
| 167 | /*===========================================================================*/
|
||
| 168 | /**
|
||
| 169 | * @name Low-level drivers
|
||
| 170 | * @{
|
||
| 171 | */
|
||
| 172 | /*===========================================================================*/
|
||
| 173 | |||
| 174 | /** @} */
|
||
| 175 | |||
| 176 | /*===========================================================================*/
|
||
| 177 | /**
|
||
| 178 | * @name Unit tests (UT)
|
||
| 179 | * @{
|
||
| 180 | */
|
||
| 181 | /*===========================================================================*/
|
||
| 182 | #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
||
| 183 | |||
| 184 | #endif /* AMIROOS_CFG_TESTS_ENABLE == true */ |
||
| 185 | |||
| 186 | /** @} */
|
||
| 187 | /** @} */ |