Wakeup Light with touch user interface, anti-aliased Font, SD card access and RTC usage on STM32F746NG-DISCO board
Dependencies: BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src
STMLIBRARIES/stm32fxxx_hal.h@14:2044ad5cd3fe, 2016-02-21 (annotated)
- Committer:
- the_sz
- Date:
- Sun Feb 21 04:26:17 2016 +0000
- Revision:
- 14:2044ad5cd3fe
- Parent:
- 12:a89096944f20
all fonts are working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
the_sz | 12:a89096944f20 | 1 | /** |
the_sz | 12:a89096944f20 | 2 | * @author Tilen Majerle |
the_sz | 12:a89096944f20 | 3 | * @email tilen@majerle.eu |
the_sz | 12:a89096944f20 | 4 | * @website http://stm32f4-discovery.com |
the_sz | 12:a89096944f20 | 5 | * @version v1.0 |
the_sz | 12:a89096944f20 | 6 | * @license GNU GPL v3 |
the_sz | 12:a89096944f20 | 7 | @verbatim |
the_sz | 12:a89096944f20 | 8 | ---------------------------------------------------------------------- |
the_sz | 12:a89096944f20 | 9 | Copyright (C) Tilen Majerle, 2015 |
the_sz | 12:a89096944f20 | 10 | |
the_sz | 12:a89096944f20 | 11 | This program is free software: you can redistribute it and/or modify |
the_sz | 12:a89096944f20 | 12 | it under the terms of the GNU General Public License as published by |
the_sz | 12:a89096944f20 | 13 | the Free Software Foundation, either version 3 of the License, or |
the_sz | 12:a89096944f20 | 14 | any later version. |
the_sz | 12:a89096944f20 | 15 | |
the_sz | 12:a89096944f20 | 16 | This program is distributed in the hope that it will be useful, |
the_sz | 12:a89096944f20 | 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
the_sz | 12:a89096944f20 | 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
the_sz | 12:a89096944f20 | 19 | GNU General Public License for more details. |
the_sz | 12:a89096944f20 | 20 | |
the_sz | 12:a89096944f20 | 21 | You should have received a copy of the GNU General Public License |
the_sz | 12:a89096944f20 | 22 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
the_sz | 12:a89096944f20 | 23 | ---------------------------------------------------------------------- |
the_sz | 12:a89096944f20 | 24 | @endverbatim |
the_sz | 12:a89096944f20 | 25 | */ |
the_sz | 12:a89096944f20 | 26 | #ifndef TM_STM32Fxxx_H |
the_sz | 12:a89096944f20 | 27 | #define TM_STM32Fxxx_H |
the_sz | 12:a89096944f20 | 28 | |
the_sz | 12:a89096944f20 | 29 | /* C++ detection */ |
the_sz | 12:a89096944f20 | 30 | #ifdef __cplusplus |
the_sz | 12:a89096944f20 | 31 | extern "C" { |
the_sz | 12:a89096944f20 | 32 | #endif |
the_sz | 12:a89096944f20 | 33 | |
the_sz | 12:a89096944f20 | 34 | /** |
the_sz | 12:a89096944f20 | 35 | * @addtogroup TM_STM32Fxxx_HAL_Libraries |
the_sz | 12:a89096944f20 | 36 | * @{ |
the_sz | 12:a89096944f20 | 37 | * |
the_sz | 12:a89096944f20 | 38 | * |
the_sz | 12:a89096944f20 | 39 | * \par Beginning for libraries |
the_sz | 12:a89096944f20 | 40 | * |
the_sz | 12:a89096944f20 | 41 | * For start using these libraries, check @ref TM_HAL. |
the_sz | 12:a89096944f20 | 42 | */ |
the_sz | 12:a89096944f20 | 43 | |
the_sz | 12:a89096944f20 | 44 | /** |
the_sz | 12:a89096944f20 | 45 | * @defgroup TM_HAL |
the_sz | 12:a89096944f20 | 46 | * @brief Main description and usage of TM HAL based libraries |
the_sz | 12:a89096944f20 | 47 | * @{ |
the_sz | 12:a89096944f20 | 48 | * |
the_sz | 12:a89096944f20 | 49 | * \par About libraries |
the_sz | 12:a89096944f20 | 50 | * |
the_sz | 12:a89096944f20 | 51 | * These libraries are provided by Tilen Majerle and are developed under GNU GPL v3 licence. For more information about that, please check website of license. |
the_sz | 12:a89096944f20 | 52 | * |
the_sz | 12:a89096944f20 | 53 | * To use it, I suppose you know C language and at least basics of STM32 devices (especially STM32F0, STM32F4 or STM32F7 series). |
the_sz | 12:a89096944f20 | 54 | * |
the_sz | 12:a89096944f20 | 55 | * \par Download libraries |
the_sz | 12:a89096944f20 | 56 | * |
the_sz | 12:a89096944f20 | 57 | * Download for all libraries is on this link: http://stm32f4-discovery.com/?wpdmdl=2618 |
the_sz | 12:a89096944f20 | 58 | * |
the_sz | 12:a89096944f20 | 59 | * \par Examples |
the_sz | 12:a89096944f20 | 60 | * |
the_sz | 12:a89096944f20 | 61 | * Each library has Keil uVision based example on my Github account, https://github.com/MaJerle/stm32fxxx_hal_libraries. |
the_sz | 12:a89096944f20 | 62 | * |
the_sz | 12:a89096944f20 | 63 | * If you are beginner, then I suggest you to download entire repository from Github, install basic demo version of Keil uVision and open examples directly from download. |
the_sz | 12:a89096944f20 | 64 | * Almost all examples works with demo version of Keil uVision. |
the_sz | 12:a89096944f20 | 65 | * |
the_sz | 12:a89096944f20 | 66 | * \par Libraries structure |
the_sz | 12:a89096944f20 | 67 | * |
the_sz | 12:a89096944f20 | 68 | * Each library is structured in the same way where you have these parts: |
the_sz | 12:a89096944f20 | 69 | * - Header file: |
the_sz | 12:a89096944f20 | 70 | * - Library description with link on website |
the_sz | 12:a89096944f20 | 71 | * - Includes section |
the_sz | 12:a89096944f20 | 72 | * - Defines section for different configurations in library |
the_sz | 12:a89096944f20 | 73 | * - Enumerations and structures section |
the_sz | 12:a89096944f20 | 74 | * - Function declaration section |
the_sz | 12:a89096944f20 | 75 | * - Source file: |
the_sz | 12:a89096944f20 | 76 | * - Function implementations |
the_sz | 12:a89096944f20 | 77 | * |
the_sz | 12:a89096944f20 | 78 | * Each library includes at least these 2 files: |
the_sz | 12:a89096944f20 | 79 | * - stm32fxxx_hal.h file: |
the_sz | 12:a89096944f20 | 80 | * This file was done by me for better organization between several STM32 families to use with my libraries for future use. |
the_sz | 12:a89096944f20 | 81 | * It sets some basic defines, which can also be set using compiler's preprocessor defines. Check file for more information with detailed description. |
the_sz | 12:a89096944f20 | 82 | * |
the_sz | 12:a89096944f20 | 83 | * - defines.h file: |
the_sz | 12:a89096944f20 | 84 | * <b>This file is totally based on user and should also be created by user</b>. |
the_sz | 12:a89096944f20 | 85 | * |
the_sz | 12:a89096944f20 | 86 | * It is used for library configuration settings, so you don't have to edit library file. |
the_sz | 12:a89096944f20 | 87 | * If you edit library file, then if new version is out, it will be overwritten what you don't wanna have. |
the_sz | 12:a89096944f20 | 88 | * |
the_sz | 12:a89096944f20 | 89 | * Check example below for meaning. |
the_sz | 12:a89096944f20 | 90 | * |
the_sz | 12:a89096944f20 | 91 | \code |
the_sz | 12:a89096944f20 | 92 | //------------------------------------ |
the_sz | 12:a89096944f20 | 93 | //tm_stm32_exti.h file: |
the_sz | 12:a89096944f20 | 94 | //------------------------------------ |
the_sz | 12:a89096944f20 | 95 | //Content in this file is similar to this below: |
the_sz | 12:a89096944f20 | 96 | |
the_sz | 12:a89096944f20 | 97 | //Include defines.h file for user configuration |
the_sz | 12:a89096944f20 | 98 | #include "defines.h" |
the_sz | 12:a89096944f20 | 99 | |
the_sz | 12:a89096944f20 | 100 | //Set default NVIC preemption priority if not defined by user to 0x03 |
the_sz | 12:a89096944f20 | 101 | #ifndef EXTI_NVIC_PRIORITY |
the_sz | 12:a89096944f20 | 102 | #define EXTI_NVIC_PRIORITY 0x03 |
the_sz | 12:a89096944f20 | 103 | #endif |
the_sz | 12:a89096944f20 | 104 | |
the_sz | 12:a89096944f20 | 105 | //------------------------------------ |
the_sz | 12:a89096944f20 | 106 | //defines.h file: (set by user) |
the_sz | 12:a89096944f20 | 107 | //------------------------------------ |
the_sz | 12:a89096944f20 | 108 | |
the_sz | 12:a89096944f20 | 109 | //User wants to change that, use defines.h file like this: |
the_sz | 12:a89096944f20 | 110 | #ifndef DEFINES_FILE |
the_sz | 12:a89096944f20 | 111 | #define DEFINES_FILE |
the_sz | 12:a89096944f20 | 112 | |
the_sz | 12:a89096944f20 | 113 | //Let's set EXTI NVIC preemption priority to highest, so we will do: |
the_sz | 12:a89096944f20 | 114 | #define EXTI_NVIC_PRIORITY 0x00 |
the_sz | 12:a89096944f20 | 115 | |
the_sz | 12:a89096944f20 | 116 | #endif |
the_sz | 12:a89096944f20 | 117 | \endcode |
the_sz | 12:a89096944f20 | 118 | * |
the_sz | 12:a89096944f20 | 119 | * Code above shows how you can use defines.h file to change default library settings. |
the_sz | 12:a89096944f20 | 120 | * |
the_sz | 12:a89096944f20 | 121 | * \par HAL Source from ST |
the_sz | 12:a89096944f20 | 122 | * |
the_sz | 12:a89096944f20 | 123 | * TM HAL libraries works on STM32Cube provided from ST and are not included in package of libraries. |
the_sz | 12:a89096944f20 | 124 | * |
the_sz | 12:a89096944f20 | 125 | * @note You have to go to ST website and download STM32Cube package for your family and use that STM32Fxxx_HAL_Drivers libraries in your project together with my libraries. |
the_sz | 12:a89096944f20 | 126 | * On my Github, you have example how they are used together. |
the_sz | 12:a89096944f20 | 127 | * |
the_sz | 12:a89096944f20 | 128 | * \par About defines.h file |
the_sz | 12:a89096944f20 | 129 | * |
the_sz | 12:a89096944f20 | 130 | * Please check above about this. |
the_sz | 12:a89096944f20 | 131 | * |
the_sz | 12:a89096944f20 | 132 | */ |
the_sz | 12:a89096944f20 | 133 | |
the_sz | 12:a89096944f20 | 134 | /** |
the_sz | 12:a89096944f20 | 135 | * @defgroup TM_HAL_Family |
the_sz | 12:a89096944f20 | 136 | * @brief In stm32fxxx_hal.h file you have to specify STM32 family used for HAL drivers. |
the_sz | 12:a89096944f20 | 137 | * @{ |
the_sz | 12:a89096944f20 | 138 | */ |
the_sz | 12:a89096944f20 | 139 | |
the_sz | 12:a89096944f20 | 140 | /* Defines for family used with libraries */ |
the_sz | 12:a89096944f20 | 141 | /* Uncomment line for your family used with HAL libraries */ |
the_sz | 12:a89096944f20 | 142 | //#define STM32F0xx /*!< Use STM32F0xx libraries */ |
the_sz | 12:a89096944f20 | 143 | //#define STM32F4xx /*!< Use STM32F4xx libraries */ |
the_sz | 12:a89096944f20 | 144 | #define STM32F7xx /*!< Use STM32F7xx libraries */ |
the_sz | 12:a89096944f20 | 145 | |
the_sz | 12:a89096944f20 | 146 | /** |
the_sz | 12:a89096944f20 | 147 | * @} |
the_sz | 12:a89096944f20 | 148 | */ |
the_sz | 12:a89096944f20 | 149 | |
the_sz | 12:a89096944f20 | 150 | /* Include project config file */ |
the_sz | 12:a89096944f20 | 151 | #include "defines.h" |
the_sz | 12:a89096944f20 | 152 | |
the_sz | 12:a89096944f20 | 153 | /* Check if HAL drivers enabled */ |
the_sz | 12:a89096944f20 | 154 | #ifndef USE_HAL_DRIVER |
the_sz | 12:a89096944f20 | 155 | #define USE_HAL_DRIVER |
the_sz | 12:a89096944f20 | 156 | #endif |
the_sz | 12:a89096944f20 | 157 | |
the_sz | 12:a89096944f20 | 158 | /* Include proper header file */ |
the_sz | 12:a89096944f20 | 159 | /* STM32F7xx */ |
the_sz | 12:a89096944f20 | 160 | #if defined(STM32F0xx) || defined(STM32F0XX) |
the_sz | 12:a89096944f20 | 161 | #ifndef STM32F0xx |
the_sz | 12:a89096944f20 | 162 | #define STM32F0xx |
the_sz | 12:a89096944f20 | 163 | #endif |
the_sz | 12:a89096944f20 | 164 | #ifndef STM32F0XX |
the_sz | 12:a89096944f20 | 165 | #define STM32F0XX |
the_sz | 12:a89096944f20 | 166 | #endif |
the_sz | 12:a89096944f20 | 167 | #include "stm32f0xx.h" |
the_sz | 12:a89096944f20 | 168 | #include "stm32f0xx_hal.h" |
the_sz | 12:a89096944f20 | 169 | #endif |
the_sz | 12:a89096944f20 | 170 | |
the_sz | 12:a89096944f20 | 171 | /* STM32F4xx */ |
the_sz | 12:a89096944f20 | 172 | #if defined(STM32F4xx) || defined(STM32F4XX) |
the_sz | 12:a89096944f20 | 173 | #ifndef STM32F4xx |
the_sz | 12:a89096944f20 | 174 | #define STM32F4xx |
the_sz | 12:a89096944f20 | 175 | #endif |
the_sz | 12:a89096944f20 | 176 | #ifndef STM32F4XX |
the_sz | 12:a89096944f20 | 177 | #define STM32F4XX |
the_sz | 12:a89096944f20 | 178 | #endif |
the_sz | 12:a89096944f20 | 179 | #include "stm32f4xx.h" |
the_sz | 12:a89096944f20 | 180 | #include "stm32f4xx_hal.h" |
the_sz | 12:a89096944f20 | 181 | #endif |
the_sz | 12:a89096944f20 | 182 | |
the_sz | 12:a89096944f20 | 183 | /* STM32F7xx */ |
the_sz | 12:a89096944f20 | 184 | #if defined(STM32F7xx) || defined(STM32F7XX) |
the_sz | 12:a89096944f20 | 185 | #ifndef STM32F7xx |
the_sz | 12:a89096944f20 | 186 | #define STM32F7xx |
the_sz | 12:a89096944f20 | 187 | #endif |
the_sz | 12:a89096944f20 | 188 | #ifndef STM32F7XX |
the_sz | 12:a89096944f20 | 189 | #define STM32F7XX |
the_sz | 12:a89096944f20 | 190 | #endif |
the_sz | 12:a89096944f20 | 191 | #include "stm32f7xx.h" |
the_sz | 12:a89096944f20 | 192 | #include "stm32f7xx_hal.h" |
the_sz | 12:a89096944f20 | 193 | #endif |
the_sz | 12:a89096944f20 | 194 | |
the_sz | 12:a89096944f20 | 195 | /* Check if anything defined */ |
the_sz | 12:a89096944f20 | 196 | #if !defined(STM32F0xx) && !defined(STM32F4xx) && !defined(STM32F7xx) |
the_sz | 12:a89096944f20 | 197 | #error "There is not selected STM32 family used. Check stm32fxxx_hal.h file for configuration!" |
the_sz | 12:a89096944f20 | 198 | #endif |
the_sz | 12:a89096944f20 | 199 | |
the_sz | 12:a89096944f20 | 200 | /* Init main libraries used everywhere */ |
the_sz | 12:a89096944f20 | 201 | #include "defines.h" |
the_sz | 12:a89096944f20 | 202 | #include "tm_stm32_rcc.h" |
the_sz | 12:a89096944f20 | 203 | #include "tm_stm32_gpio.h" |
the_sz | 12:a89096944f20 | 204 | |
the_sz | 12:a89096944f20 | 205 | /** |
the_sz | 12:a89096944f20 | 206 | * @} |
the_sz | 12:a89096944f20 | 207 | */ |
the_sz | 12:a89096944f20 | 208 | |
the_sz | 12:a89096944f20 | 209 | /** |
the_sz | 12:a89096944f20 | 210 | * @} |
the_sz | 12:a89096944f20 | 211 | */ |
the_sz | 12:a89096944f20 | 212 | |
the_sz | 12:a89096944f20 | 213 | /* C++ detection */ |
the_sz | 12:a89096944f20 | 214 | #ifdef __cplusplus |
the_sz | 12:a89096944f20 | 215 | } |
the_sz | 12:a89096944f20 | 216 | #endif |
the_sz | 12:a89096944f20 | 217 | |
the_sz | 12:a89096944f20 | 218 | #endif |