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