├── .gitignore ├── Inc ├── main.h ├── stm32f4xx_hal_conf.h └── stm32f4xx_it.h ├── LICENSE ├── Makefile ├── README.md ├── STM32F411RETx_FLASH.ld ├── Src ├── gpio.tmp ├── license.tmp ├── main.c ├── stm32f4xx_hal_msp.c ├── stm32f4xx_it.c ├── system.tmp └── system_stm32f4xx.c ├── cubefix.sh ├── img ├── image-to-mem.py └── parrot_128x128.png ├── main.ioc ├── mx.scratch ├── st7735 ├── fonts.c ├── fonts.h ├── st7735.c ├── st7735.h └── testimg.h └── startup_stm32f411xe.s /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.backup 3 | .mxproject 4 | -------------------------------------------------------------------------------- /Inc/main.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : main.hpp 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | ** This notice applies to any and all portions of this file 7 | * that are not between comment pairs USER CODE BEGIN and 8 | * USER CODE END. Other portions of this file, whether 9 | * inserted by the user or by software development tools 10 | * are owned by their respective copyright owners. 11 | * 12 | * COPYRIGHT(c) 2018 STMicroelectronics 13 | * 14 | * Redistribution and use in source and binary forms, with or without modification, 15 | * are permitted provided that the following conditions are met: 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 22 | * may be used to endorse or promote products derived from this software 23 | * without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ****************************************************************************** 37 | */ 38 | /* Define to prevent recursive inclusion -------------------------------------*/ 39 | #ifndef __MAIN_H 40 | #define __MAIN_H 41 | /* Includes ------------------------------------------------------------------*/ 42 | 43 | /* Includes ------------------------------------------------------------------*/ 44 | /* USER CODE BEGIN Includes */ 45 | 46 | /* USER CODE END Includes */ 47 | 48 | /* Private define ------------------------------------------------------------*/ 49 | 50 | #define B1_Pin GPIO_PIN_13 51 | #define B1_GPIO_Port GPIOC 52 | #define USART_TX_Pin GPIO_PIN_2 53 | #define USART_TX_GPIO_Port GPIOA 54 | #define USART_RX_Pin GPIO_PIN_3 55 | #define USART_RX_GPIO_Port GPIOA 56 | #define TMS_Pin GPIO_PIN_13 57 | #define TMS_GPIO_Port GPIOA 58 | #define TCK_Pin GPIO_PIN_14 59 | #define TCK_GPIO_Port GPIOA 60 | #define SWO_Pin GPIO_PIN_3 61 | #define SWO_GPIO_Port GPIOB 62 | 63 | /* ########################## Assert Selection ############################## */ 64 | /** 65 | * @brief Uncomment the line below to expanse the "assert_param" macro in the 66 | * HAL drivers code 67 | */ 68 | /* #define USE_FULL_ASSERT 1U */ 69 | 70 | /* USER CODE BEGIN Private defines */ 71 | 72 | /* USER CODE END Private defines */ 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | void _Error_Handler(char *, int); 78 | 79 | #define Error_Handler() _Error_Handler(__FILE__, __LINE__) 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | /** 85 | * @} 86 | */ 87 | 88 | /** 89 | * @} 90 | */ 91 | 92 | #endif /* __MAIN_H */ 93 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 94 | -------------------------------------------------------------------------------- /Inc/stm32f4xx_hal_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_conf.h 4 | * @brief HAL configuration file. 5 | ****************************************************************************** 6 | * @attention 7 | * 8 | *

© COPYRIGHT(c) 2018 STMicroelectronics

9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright notice, 15 | * this list of conditions and the following disclaimer in the documentation 16 | * and/or other materials provided with the distribution. 17 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | ****************************************************************************** 33 | */ 34 | 35 | /* Define to prevent recursive inclusion -------------------------------------*/ 36 | #ifndef __STM32F4xx_HAL_CONF_H 37 | #define __STM32F4xx_HAL_CONF_H 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | #include "main.h" 44 | /* Exported types ------------------------------------------------------------*/ 45 | /* Exported constants --------------------------------------------------------*/ 46 | 47 | /* ########################## Module Selection ############################## */ 48 | /** 49 | * @brief This is the list of modules to be used in the HAL driver 50 | */ 51 | #define HAL_MODULE_ENABLED 52 | 53 | /* #define HAL_ADC_MODULE_ENABLED */ 54 | /* #define HAL_CRYP_MODULE_ENABLED */ 55 | /* #define HAL_CAN_MODULE_ENABLED */ 56 | /* #define HAL_CRC_MODULE_ENABLED */ 57 | /* #define HAL_CRYP_MODULE_ENABLED */ 58 | /* #define HAL_DAC_MODULE_ENABLED */ 59 | /* #define HAL_DCMI_MODULE_ENABLED */ 60 | /* #define HAL_DMA2D_MODULE_ENABLED */ 61 | /* #define HAL_ETH_MODULE_ENABLED */ 62 | /* #define HAL_NAND_MODULE_ENABLED */ 63 | /* #define HAL_NOR_MODULE_ENABLED */ 64 | /* #define HAL_PCCARD_MODULE_ENABLED */ 65 | /* #define HAL_SRAM_MODULE_ENABLED */ 66 | /* #define HAL_SDRAM_MODULE_ENABLED */ 67 | /* #define HAL_HASH_MODULE_ENABLED */ 68 | /* #define HAL_I2C_MODULE_ENABLED */ 69 | /* #define HAL_I2S_MODULE_ENABLED */ 70 | /* #define HAL_IWDG_MODULE_ENABLED */ 71 | /* #define HAL_LTDC_MODULE_ENABLED */ 72 | /* #define HAL_RNG_MODULE_ENABLED */ 73 | /* #define HAL_RTC_MODULE_ENABLED */ 74 | /* #define HAL_SAI_MODULE_ENABLED */ 75 | /* #define HAL_SD_MODULE_ENABLED */ 76 | /* #define HAL_MMC_MODULE_ENABLED */ 77 | #define HAL_SPI_MODULE_ENABLED 78 | /* #define HAL_TIM_MODULE_ENABLED */ 79 | #define HAL_UART_MODULE_ENABLED 80 | /* #define HAL_USART_MODULE_ENABLED */ 81 | /* #define HAL_IRDA_MODULE_ENABLED */ 82 | /* #define HAL_SMARTCARD_MODULE_ENABLED */ 83 | /* #define HAL_WWDG_MODULE_ENABLED */ 84 | /* #define HAL_PCD_MODULE_ENABLED */ 85 | /* #define HAL_HCD_MODULE_ENABLED */ 86 | /* #define HAL_DSI_MODULE_ENABLED */ 87 | /* #define HAL_QSPI_MODULE_ENABLED */ 88 | /* #define HAL_QSPI_MODULE_ENABLED */ 89 | /* #define HAL_CEC_MODULE_ENABLED */ 90 | /* #define HAL_FMPI2C_MODULE_ENABLED */ 91 | /* #define HAL_SPDIFRX_MODULE_ENABLED */ 92 | /* #define HAL_DFSDM_MODULE_ENABLED */ 93 | /* #define HAL_LPTIM_MODULE_ENABLED */ 94 | #define HAL_GPIO_MODULE_ENABLED 95 | #define HAL_DMA_MODULE_ENABLED 96 | #define HAL_RCC_MODULE_ENABLED 97 | #define HAL_FLASH_MODULE_ENABLED 98 | #define HAL_PWR_MODULE_ENABLED 99 | #define HAL_CORTEX_MODULE_ENABLED 100 | 101 | /* ########################## HSE/HSI Values adaptation ##################### */ 102 | /** 103 | * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. 104 | * This value is used by the RCC HAL module to compute the system frequency 105 | * (when HSE is used as system clock source, directly or through the PLL). 106 | */ 107 | #if !defined (HSE_VALUE) 108 | #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ 109 | #endif /* HSE_VALUE */ 110 | 111 | #if !defined (HSE_STARTUP_TIMEOUT) 112 | #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ 113 | #endif /* HSE_STARTUP_TIMEOUT */ 114 | 115 | /** 116 | * @brief Internal High Speed oscillator (HSI) value. 117 | * This value is used by the RCC HAL module to compute the system frequency 118 | * (when HSI is used as system clock source, directly or through the PLL). 119 | */ 120 | #if !defined (HSI_VALUE) 121 | #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ 122 | #endif /* HSI_VALUE */ 123 | 124 | /** 125 | * @brief Internal Low Speed oscillator (LSI) value. 126 | */ 127 | #if !defined (LSI_VALUE) 128 | #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ 129 | #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz 130 | The real value may vary depending on the variations 131 | in voltage and temperature.*/ 132 | /** 133 | * @brief External Low Speed oscillator (LSE) value. 134 | */ 135 | #if !defined (LSE_VALUE) 136 | #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ 137 | #endif /* LSE_VALUE */ 138 | 139 | #if !defined (LSE_STARTUP_TIMEOUT) 140 | #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ 141 | #endif /* LSE_STARTUP_TIMEOUT */ 142 | 143 | /** 144 | * @brief External clock source for I2S peripheral 145 | * This value is used by the I2S HAL module to compute the I2S clock source 146 | * frequency, this source is inserted directly through I2S_CKIN pad. 147 | */ 148 | #if !defined (EXTERNAL_CLOCK_VALUE) 149 | #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ 150 | #endif /* EXTERNAL_CLOCK_VALUE */ 151 | 152 | /* Tip: To avoid modifying this file each time you need to use different HSE, 153 | === you can define the HSE value in your toolchain compiler preprocessor. */ 154 | 155 | /* ########################### System Configuration ######################### */ 156 | /** 157 | * @brief This is the HAL system configuration section 158 | */ 159 | #define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ 160 | #define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ 161 | #define USE_RTOS 0U 162 | #define PREFETCH_ENABLE 1U 163 | #define INSTRUCTION_CACHE_ENABLE 1U 164 | #define DATA_CACHE_ENABLE 1U 165 | 166 | /* ########################## Assert Selection ############################## */ 167 | /** 168 | * @brief Uncomment the line below to expanse the "assert_param" macro in the 169 | * HAL drivers code 170 | */ 171 | /* #define USE_FULL_ASSERT 1U */ 172 | 173 | /* ################## Ethernet peripheral configuration ##################### */ 174 | 175 | /* Section 1 : Ethernet peripheral configuration */ 176 | 177 | /* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ 178 | #define MAC_ADDR0 2U 179 | #define MAC_ADDR1 0U 180 | #define MAC_ADDR2 0U 181 | #define MAC_ADDR3 0U 182 | #define MAC_ADDR4 0U 183 | #define MAC_ADDR5 0U 184 | 185 | /* Definition of the Ethernet driver buffers size and count */ 186 | #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ 187 | #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ 188 | #define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ 189 | #define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ 190 | 191 | /* Section 2: PHY configuration section */ 192 | 193 | /* DP83848_PHY_ADDRESS Address*/ 194 | #define DP83848_PHY_ADDRESS 0x01U 195 | /* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ 196 | #define PHY_RESET_DELAY ((uint32_t)0x000000FFU) 197 | /* PHY Configuration delay */ 198 | #define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) 199 | 200 | #define PHY_READ_TO ((uint32_t)0x0000FFFFU) 201 | #define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) 202 | 203 | /* Section 3: Common PHY Registers */ 204 | 205 | #define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ 206 | #define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ 207 | 208 | #define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ 209 | #define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ 210 | #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ 211 | #define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ 212 | #define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ 213 | #define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ 214 | #define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ 215 | #define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ 216 | #define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ 217 | #define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ 218 | 219 | #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ 220 | #define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ 221 | #define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ 222 | 223 | /* Section 4: Extended PHY Registers */ 224 | #define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ 225 | 226 | #define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ 227 | #define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ 228 | 229 | /* ################## SPI peripheral configuration ########################## */ 230 | 231 | /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver 232 | * Activated: CRC code is present inside driver 233 | * Deactivated: CRC code cleaned from driver 234 | */ 235 | 236 | #define USE_SPI_CRC 0U 237 | 238 | /* Includes ------------------------------------------------------------------*/ 239 | /** 240 | * @brief Include module's header file 241 | */ 242 | 243 | #ifdef HAL_RCC_MODULE_ENABLED 244 | #include "stm32f4xx_hal_rcc.h" 245 | #endif /* HAL_RCC_MODULE_ENABLED */ 246 | 247 | #ifdef HAL_GPIO_MODULE_ENABLED 248 | #include "stm32f4xx_hal_gpio.h" 249 | #endif /* HAL_GPIO_MODULE_ENABLED */ 250 | 251 | #ifdef HAL_DMA_MODULE_ENABLED 252 | #include "stm32f4xx_hal_dma.h" 253 | #endif /* HAL_DMA_MODULE_ENABLED */ 254 | 255 | #ifdef HAL_CORTEX_MODULE_ENABLED 256 | #include "stm32f4xx_hal_cortex.h" 257 | #endif /* HAL_CORTEX_MODULE_ENABLED */ 258 | 259 | #ifdef HAL_ADC_MODULE_ENABLED 260 | #include "stm32f4xx_hal_adc.h" 261 | #endif /* HAL_ADC_MODULE_ENABLED */ 262 | 263 | #ifdef HAL_CAN_MODULE_ENABLED 264 | #include "stm32f4xx_hal_can.h" 265 | #endif /* HAL_CAN_MODULE_ENABLED */ 266 | 267 | #ifdef HAL_CRC_MODULE_ENABLED 268 | #include "stm32f4xx_hal_crc.h" 269 | #endif /* HAL_CRC_MODULE_ENABLED */ 270 | 271 | #ifdef HAL_CRYP_MODULE_ENABLED 272 | #include "stm32f4xx_hal_cryp.h" 273 | #endif /* HAL_CRYP_MODULE_ENABLED */ 274 | 275 | #ifdef HAL_DMA2D_MODULE_ENABLED 276 | #include "stm32f4xx_hal_dma2d.h" 277 | #endif /* HAL_DMA2D_MODULE_ENABLED */ 278 | 279 | #ifdef HAL_DAC_MODULE_ENABLED 280 | #include "stm32f4xx_hal_dac.h" 281 | #endif /* HAL_DAC_MODULE_ENABLED */ 282 | 283 | #ifdef HAL_DCMI_MODULE_ENABLED 284 | #include "stm32f4xx_hal_dcmi.h" 285 | #endif /* HAL_DCMI_MODULE_ENABLED */ 286 | 287 | #ifdef HAL_ETH_MODULE_ENABLED 288 | #include "stm32f4xx_hal_eth.h" 289 | #endif /* HAL_ETH_MODULE_ENABLED */ 290 | 291 | #ifdef HAL_FLASH_MODULE_ENABLED 292 | #include "stm32f4xx_hal_flash.h" 293 | #endif /* HAL_FLASH_MODULE_ENABLED */ 294 | 295 | #ifdef HAL_SRAM_MODULE_ENABLED 296 | #include "stm32f4xx_hal_sram.h" 297 | #endif /* HAL_SRAM_MODULE_ENABLED */ 298 | 299 | #ifdef HAL_NOR_MODULE_ENABLED 300 | #include "stm32f4xx_hal_nor.h" 301 | #endif /* HAL_NOR_MODULE_ENABLED */ 302 | 303 | #ifdef HAL_NAND_MODULE_ENABLED 304 | #include "stm32f4xx_hal_nand.h" 305 | #endif /* HAL_NAND_MODULE_ENABLED */ 306 | 307 | #ifdef HAL_PCCARD_MODULE_ENABLED 308 | #include "stm32f4xx_hal_pccard.h" 309 | #endif /* HAL_PCCARD_MODULE_ENABLED */ 310 | 311 | #ifdef HAL_SDRAM_MODULE_ENABLED 312 | #include "stm32f4xx_hal_sdram.h" 313 | #endif /* HAL_SDRAM_MODULE_ENABLED */ 314 | 315 | #ifdef HAL_HASH_MODULE_ENABLED 316 | #include "stm32f4xx_hal_hash.h" 317 | #endif /* HAL_HASH_MODULE_ENABLED */ 318 | 319 | #ifdef HAL_I2C_MODULE_ENABLED 320 | #include "stm32f4xx_hal_i2c.h" 321 | #endif /* HAL_I2C_MODULE_ENABLED */ 322 | 323 | #ifdef HAL_I2S_MODULE_ENABLED 324 | #include "stm32f4xx_hal_i2s.h" 325 | #endif /* HAL_I2S_MODULE_ENABLED */ 326 | 327 | #ifdef HAL_IWDG_MODULE_ENABLED 328 | #include "stm32f4xx_hal_iwdg.h" 329 | #endif /* HAL_IWDG_MODULE_ENABLED */ 330 | 331 | #ifdef HAL_LTDC_MODULE_ENABLED 332 | #include "stm32f4xx_hal_ltdc.h" 333 | #endif /* HAL_LTDC_MODULE_ENABLED */ 334 | 335 | #ifdef HAL_PWR_MODULE_ENABLED 336 | #include "stm32f4xx_hal_pwr.h" 337 | #endif /* HAL_PWR_MODULE_ENABLED */ 338 | 339 | #ifdef HAL_RNG_MODULE_ENABLED 340 | #include "stm32f4xx_hal_rng.h" 341 | #endif /* HAL_RNG_MODULE_ENABLED */ 342 | 343 | #ifdef HAL_RTC_MODULE_ENABLED 344 | #include "stm32f4xx_hal_rtc.h" 345 | #endif /* HAL_RTC_MODULE_ENABLED */ 346 | 347 | #ifdef HAL_SAI_MODULE_ENABLED 348 | #include "stm32f4xx_hal_sai.h" 349 | #endif /* HAL_SAI_MODULE_ENABLED */ 350 | 351 | #ifdef HAL_SD_MODULE_ENABLED 352 | #include "stm32f4xx_hal_sd.h" 353 | #endif /* HAL_SD_MODULE_ENABLED */ 354 | 355 | #ifdef HAL_MMC_MODULE_ENABLED 356 | #include "stm32f4xx_hal_mmc.h" 357 | #endif /* HAL_MMC_MODULE_ENABLED */ 358 | 359 | #ifdef HAL_SPI_MODULE_ENABLED 360 | #include "stm32f4xx_hal_spi.h" 361 | #endif /* HAL_SPI_MODULE_ENABLED */ 362 | 363 | #ifdef HAL_TIM_MODULE_ENABLED 364 | #include "stm32f4xx_hal_tim.h" 365 | #endif /* HAL_TIM_MODULE_ENABLED */ 366 | 367 | #ifdef HAL_UART_MODULE_ENABLED 368 | #include "stm32f4xx_hal_uart.h" 369 | #endif /* HAL_UART_MODULE_ENABLED */ 370 | 371 | #ifdef HAL_USART_MODULE_ENABLED 372 | #include "stm32f4xx_hal_usart.h" 373 | #endif /* HAL_USART_MODULE_ENABLED */ 374 | 375 | #ifdef HAL_IRDA_MODULE_ENABLED 376 | #include "stm32f4xx_hal_irda.h" 377 | #endif /* HAL_IRDA_MODULE_ENABLED */ 378 | 379 | #ifdef HAL_SMARTCARD_MODULE_ENABLED 380 | #include "stm32f4xx_hal_smartcard.h" 381 | #endif /* HAL_SMARTCARD_MODULE_ENABLED */ 382 | 383 | #ifdef HAL_WWDG_MODULE_ENABLED 384 | #include "stm32f4xx_hal_wwdg.h" 385 | #endif /* HAL_WWDG_MODULE_ENABLED */ 386 | 387 | #ifdef HAL_PCD_MODULE_ENABLED 388 | #include "stm32f4xx_hal_pcd.h" 389 | #endif /* HAL_PCD_MODULE_ENABLED */ 390 | 391 | #ifdef HAL_HCD_MODULE_ENABLED 392 | #include "stm32f4xx_hal_hcd.h" 393 | #endif /* HAL_HCD_MODULE_ENABLED */ 394 | 395 | #ifdef HAL_DSI_MODULE_ENABLED 396 | #include "stm32f4xx_hal_dsi.h" 397 | #endif /* HAL_DSI_MODULE_ENABLED */ 398 | 399 | #ifdef HAL_QSPI_MODULE_ENABLED 400 | #include "stm32f4xx_hal_qspi.h" 401 | #endif /* HAL_QSPI_MODULE_ENABLED */ 402 | 403 | #ifdef HAL_CEC_MODULE_ENABLED 404 | #include "stm32f4xx_hal_cec.h" 405 | #endif /* HAL_CEC_MODULE_ENABLED */ 406 | 407 | #ifdef HAL_FMPI2C_MODULE_ENABLED 408 | #include "stm32f4xx_hal_fmpi2c.h" 409 | #endif /* HAL_FMPI2C_MODULE_ENABLED */ 410 | 411 | #ifdef HAL_SPDIFRX_MODULE_ENABLED 412 | #include "stm32f4xx_hal_spdifrx.h" 413 | #endif /* HAL_SPDIFRX_MODULE_ENABLED */ 414 | 415 | #ifdef HAL_DFSDM_MODULE_ENABLED 416 | #include "stm32f4xx_hal_dfsdm.h" 417 | #endif /* HAL_DFSDM_MODULE_ENABLED */ 418 | 419 | #ifdef HAL_LPTIM_MODULE_ENABLED 420 | #include "stm32f4xx_hal_lptim.h" 421 | #endif /* HAL_LPTIM_MODULE_ENABLED */ 422 | 423 | /* Exported macro ------------------------------------------------------------*/ 424 | #ifdef USE_FULL_ASSERT 425 | /** 426 | * @brief The assert_param macro is used for function's parameters check. 427 | * @param expr: If expr is false, it calls assert_failed function 428 | * which reports the name of the source file and the source 429 | * line number of the call that failed. 430 | * If expr is true, it returns no value. 431 | * @retval None 432 | */ 433 | #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) 434 | /* Exported functions ------------------------------------------------------- */ 435 | void assert_failed(uint8_t* file, uint32_t line); 436 | #else 437 | #define assert_param(expr) ((void)0U) 438 | #endif /* USE_FULL_ASSERT */ 439 | 440 | #ifdef __cplusplus 441 | } 442 | #endif 443 | 444 | #endif /* __STM32F4xx_HAL_CONF_H */ 445 | 446 | 447 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 448 | -------------------------------------------------------------------------------- /Inc/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.h 4 | * @brief This file contains the headers of the interrupt handlers. 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2018 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | 34 | /* Define to prevent recursive inclusion -------------------------------------*/ 35 | #ifndef __STM32F4xx_IT_H 36 | #define __STM32F4xx_IT_H 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* Includes ------------------------------------------------------------------*/ 43 | #include "stm32f4xx_hal.h" 44 | #include "main.h" 45 | /* Exported types ------------------------------------------------------------*/ 46 | /* Exported constants --------------------------------------------------------*/ 47 | /* Exported macro ------------------------------------------------------------*/ 48 | /* Exported functions ------------------------------------------------------- */ 49 | 50 | void SysTick_Handler(void); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif /* __STM32F4xx_IT_H */ 57 | 58 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Aleksander Alekseev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ########################################################################################################################## 2 | # File automatically-generated by tool: [projectgenerator] version: [2.26.0] date: [Thu Jan 04 15:34:05 MSK 2018] 3 | ########################################################################################################################## 4 | 5 | # ------------------------------------------------ 6 | # Generic Makefile (based on gcc) 7 | # 8 | # ChangeLog : 9 | # 2017-02-10 - Several enhancements + project update mode 10 | # 2015-07-22 - first version 11 | # ------------------------------------------------ 12 | 13 | ###################################### 14 | # target 15 | ###################################### 16 | TARGET = main 17 | FIRMWARE = $(HOME)/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0 18 | 19 | 20 | ###################################### 21 | # building variables 22 | ###################################### 23 | # debug build? 24 | DEBUG = 1 25 | # optimization 26 | OPT = -Og -Wall 27 | 28 | 29 | ####################################### 30 | # paths 31 | ####################################### 32 | # source path 33 | SOURCES_DIR = \ 34 | Drivers/STM32F4xx_HAL_Driver \ 35 | Application/User/Src/stm32f4xx_it.c \ 36 | Application/User/Src/main.c \ 37 | Drivers \ 38 | Application \ 39 | Application/User \ 40 | Application/MAKEFILE \ 41 | Drivers/CMSIS \ 42 | Application/User/Src/stm32f4xx_hal_msp.c \ 43 | Application/User/Src 44 | 45 | # firmware library path 46 | PERIFLIB_PATH = 47 | 48 | # Build path 49 | BUILD_DIR = build 50 | 51 | ###################################### 52 | # source 53 | ###################################### 54 | # C sources 55 | C_SOURCES = \ 56 | Src/main.c \ 57 | st7735/st7735.c \ 58 | st7735/fonts.c \ 59 | Src/stm32f4xx_it.c \ 60 | Src/system_stm32f4xx.c \ 61 | Src/stm32f4xx_hal_msp.c \ 62 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ 63 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \ 64 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \ 65 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \ 66 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ 67 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ 68 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \ 69 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \ 70 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \ 71 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \ 72 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \ 73 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \ 74 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ 75 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \ 76 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c \ 77 | $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c 78 | 79 | # $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c 80 | # $(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c 81 | 82 | # ASM sources 83 | ASM_SOURCES = \ 84 | startup_stm32f411xe.s 85 | 86 | 87 | ###################################### 88 | # firmware library 89 | ###################################### 90 | PERIFLIB_SOURCES = 91 | 92 | 93 | ####################################### 94 | # binaries 95 | ####################################### 96 | BINPATH=/usr/bin 97 | PREFIX=arm-none-eabi- 98 | CC = $(BINPATH)/$(PREFIX)gcc 99 | AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp 100 | CP = $(BINPATH)/$(PREFIX)objcopy 101 | AR = $(BINPATH)/$(PREFIX)ar 102 | SZ = $(BINPATH)/$(PREFIX)size 103 | HEX = $(CP) -O ihex 104 | BIN = $(CP) -O binary -S 105 | 106 | ####################################### 107 | # CFLAGS 108 | ####################################### 109 | # cpu 110 | CPU = -mcpu=cortex-m4 111 | 112 | # fpu 113 | FPU = -mfpu=fpv4-sp-d16 114 | 115 | # float-abi 116 | FLOAT-ABI = -mfloat-abi=hard 117 | 118 | # mcu 119 | MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) 120 | 121 | # macros for gcc 122 | # AS defines 123 | AS_DEFS = 124 | 125 | # C defines 126 | C_DEFS = \ 127 | -DUSE_HAL_DRIVER \ 128 | -DSTM32F411xE 129 | 130 | 131 | # AS includes 132 | AS_INCLUDES = 133 | 134 | # C includes 135 | C_INCLUDES = \ 136 | -IInc \ 137 | -Ist7735 \ 138 | -I$(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Inc \ 139 | -I$(FIRMWARE)/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy \ 140 | -I$(FIRMWARE)/Drivers/CMSIS/Device/ST/STM32F4xx/Include \ 141 | -I$(FIRMWARE)/Drivers/CMSIS/Include 142 | 143 | 144 | # compile gcc flags 145 | ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 146 | 147 | CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections 148 | 149 | ifeq ($(DEBUG), 1) 150 | CFLAGS += -g -gdwarf-2 151 | endif 152 | 153 | 154 | # Generate dependency information 155 | CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" 156 | 157 | 158 | ####################################### 159 | # LDFLAGS 160 | ####################################### 161 | # link script 162 | LDSCRIPT = STM32F411RETx_FLASH.ld 163 | 164 | # libraries 165 | LIBS = -lc -lm -lnosys 166 | LIBDIR = 167 | LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections 168 | 169 | # default action: build all 170 | all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin 171 | 172 | 173 | ####################################### 174 | # build the application 175 | ####################################### 176 | # list of objects 177 | OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) 178 | vpath %.c $(sort $(dir $(C_SOURCES))) 179 | # list of ASM program objects 180 | OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) 181 | vpath %.s $(sort $(dir $(ASM_SOURCES))) 182 | 183 | $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 184 | $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ 185 | 186 | $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) 187 | $(AS) -c $(CFLAGS) $< -o $@ 188 | 189 | $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile 190 | $(CC) $(OBJECTS) $(LDFLAGS) -o $@ 191 | $(SZ) $@ 192 | 193 | $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 194 | $(HEX) $< $@ 195 | 196 | $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) 197 | $(BIN) $< $@ 198 | 199 | $(BUILD_DIR): 200 | mkdir $@ 201 | 202 | ####################################### 203 | # clean up 204 | ####################################### 205 | clean: 206 | -rm -fR .dep $(BUILD_DIR) 207 | 208 | flash: all 209 | st-flash --reset write build/$(TARGET).bin 0x8000000 210 | 211 | erase: 212 | st-flash --reset erase 213 | 214 | uart: 215 | screen /dev/ttyACM0 216 | 217 | ####################################### 218 | # dependencies 219 | ####################################### 220 | -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*) 221 | 222 | # *** EOF *** 223 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stm32-st7735 2 | 3 | STM32 HAL-based library for ST7735 displays. 4 | 5 | See also: 6 | 7 | * https://github.com/afiskon/stm32-fatfs-examples 8 | * https://github.com/afiskon/stm32-i2c-lcd-1602 9 | * https://github.com/afiskon/stm32-ssd1306 10 | * https://github.com/afiskon/stm32-ssd1351 11 | * https://github.com/afiskon/stm32-ili9341 12 | -------------------------------------------------------------------------------- /STM32F411RETx_FLASH.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ***************************************************************************** 3 | ** 4 | 5 | ** File : LinkerScript.ld 6 | ** 7 | ** Abstract : Linker script for STM32F411RETx Device with 8 | ** 512KByte FLASH, 128KByte RAM 9 | ** 10 | ** Set heap size, stack size and stack location according 11 | ** to application requirements. 12 | ** 13 | ** Set memory bank area and size if external memory is used. 14 | ** 15 | ** Target : STMicroelectronics STM32 16 | ** 17 | ** 18 | ** Distribution: The file is distributed as is, without any warranty 19 | ** of any kind. 20 | ** 21 | ** (c)Copyright Ac6. 22 | ** You may use this file as-is or modify it according to the needs of your 23 | ** project. Distribution of this file (unmodified or modified) is not 24 | ** permitted. Ac6 permit registered System Workbench for MCU users the 25 | ** rights to distribute the assembled, compiled & linked contents of this 26 | ** file as part of an application binary file, provided that it is built 27 | ** using the System Workbench for MCU toolchain. 28 | ** 29 | ***************************************************************************** 30 | */ 31 | 32 | /* Entry Point */ 33 | ENTRY(Reset_Handler) 34 | 35 | /* Highest address of the user mode stack */ 36 | _estack = 0x20020000; /* end of RAM */ 37 | /* Generate a link error if heap and stack don't fit into RAM */ 38 | _Min_Heap_Size = 0x200; /* required amount of heap */ 39 | _Min_Stack_Size = 0x400; /* required amount of stack */ 40 | 41 | /* Specify the memory areas */ 42 | MEMORY 43 | { 44 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K 45 | FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K 46 | } 47 | 48 | /* Define output sections */ 49 | SECTIONS 50 | { 51 | /* The startup code goes first into FLASH */ 52 | .isr_vector : 53 | { 54 | . = ALIGN(4); 55 | KEEP(*(.isr_vector)) /* Startup code */ 56 | . = ALIGN(4); 57 | } >FLASH 58 | 59 | /* The program code and other data goes into FLASH */ 60 | .text : 61 | { 62 | . = ALIGN(4); 63 | *(.text) /* .text sections (code) */ 64 | *(.text*) /* .text* sections (code) */ 65 | *(.glue_7) /* glue arm to thumb code */ 66 | *(.glue_7t) /* glue thumb to arm code */ 67 | *(.eh_frame) 68 | 69 | KEEP (*(.init)) 70 | KEEP (*(.fini)) 71 | 72 | . = ALIGN(4); 73 | _etext = .; /* define a global symbols at end of code */ 74 | } >FLASH 75 | 76 | /* Constant data goes into FLASH */ 77 | .rodata : 78 | { 79 | . = ALIGN(4); 80 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 81 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 82 | . = ALIGN(4); 83 | } >FLASH 84 | 85 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH 86 | .ARM : { 87 | __exidx_start = .; 88 | *(.ARM.exidx*) 89 | __exidx_end = .; 90 | } >FLASH 91 | 92 | .preinit_array : 93 | { 94 | PROVIDE_HIDDEN (__preinit_array_start = .); 95 | KEEP (*(.preinit_array*)) 96 | PROVIDE_HIDDEN (__preinit_array_end = .); 97 | } >FLASH 98 | .init_array : 99 | { 100 | PROVIDE_HIDDEN (__init_array_start = .); 101 | KEEP (*(SORT(.init_array.*))) 102 | KEEP (*(.init_array*)) 103 | PROVIDE_HIDDEN (__init_array_end = .); 104 | } >FLASH 105 | .fini_array : 106 | { 107 | PROVIDE_HIDDEN (__fini_array_start = .); 108 | KEEP (*(SORT(.fini_array.*))) 109 | KEEP (*(.fini_array*)) 110 | PROVIDE_HIDDEN (__fini_array_end = .); 111 | } >FLASH 112 | 113 | /* used by the startup to initialize data */ 114 | _sidata = LOADADDR(.data); 115 | 116 | /* Initialized data sections goes into RAM, load LMA copy after code */ 117 | .data : 118 | { 119 | . = ALIGN(4); 120 | _sdata = .; /* create a global symbol at data start */ 121 | *(.data) /* .data sections */ 122 | *(.data*) /* .data* sections */ 123 | 124 | . = ALIGN(4); 125 | _edata = .; /* define a global symbol at data end */ 126 | } >RAM AT> FLASH 127 | 128 | 129 | /* Uninitialized data section */ 130 | . = ALIGN(4); 131 | .bss : 132 | { 133 | /* This is used by the startup in order to initialize the .bss secion */ 134 | _sbss = .; /* define a global symbol at bss start */ 135 | __bss_start__ = _sbss; 136 | *(.bss) 137 | *(.bss*) 138 | *(COMMON) 139 | 140 | . = ALIGN(4); 141 | _ebss = .; /* define a global symbol at bss end */ 142 | __bss_end__ = _ebss; 143 | } >RAM 144 | 145 | /* User_heap_stack section, used to check that there is enough RAM left */ 146 | ._user_heap_stack : 147 | { 148 | . = ALIGN(8); 149 | PROVIDE ( end = . ); 150 | PROVIDE ( _end = . ); 151 | . = . + _Min_Heap_Size; 152 | . = . + _Min_Stack_Size; 153 | . = ALIGN(8); 154 | } >RAM 155 | 156 | 157 | 158 | /* Remove information from the standard libraries */ 159 | /DISCARD/ : 160 | { 161 | libc.a ( * ) 162 | libm.a ( * ) 163 | libgcc.a ( * ) 164 | } 165 | 166 | .ARM.attributes 0 : { *(.ARM.attributes) } 167 | } 168 | 169 | 170 | -------------------------------------------------------------------------------- /Src/gpio.tmp: -------------------------------------------------------------------------------- 1 | 2 | #n/** Configure pins as #n #t#t #t* Analog #n #t#t #t* Input #n #t#t #t* Output#n #t#t #t* EVENT_OUT#n #t#t #t* EXTI 3 | */ 4 | static void MX_GPIO_Init(void) 5 | { 6 | #n 7 | #tGPIO_InitTypeDef GPIO_InitStruct; 8 | #n#t/* GPIO Ports Clock Enable */ 9 | #t__HAL_RCC_GPIOC_CLK_ENABLE(); 10 | #t__HAL_RCC_GPIOH_CLK_ENABLE(); 11 | #t__HAL_RCC_GPIOA_CLK_ENABLE(); 12 | #t__HAL_RCC_GPIOB_CLK_ENABLE(); 13 | #n#t/*Configure GPIO pin Output Level */ 14 | #tHAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, GPIO_PIN_RESET); 15 | #n#t/*Configure GPIO pin Output Level */ 16 | #tHAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET); 17 | #n#t/*Configure GPIO pin Output Level */ 18 | #tHAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); 19 | #n#t/*Configure GPIO pin : B1_Pin */ 20 | #tGPIO_InitStruct.Pin = B1_Pin; 21 | #tGPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; 22 | #tGPIO_InitStruct.Pull = GPIO_NOPULL; 23 | #tHAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct); 24 | #n#t/*Configure GPIO pin : PC7 */ 25 | #tGPIO_InitStruct.Pin = GPIO_PIN_7; 26 | #tGPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 27 | #tGPIO_InitStruct.Pull = GPIO_NOPULL; 28 | #tGPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 29 | #tHAL_GPIO_Init(GPIOC, &GPIO_InitStruct); 30 | #n#t/*Configure GPIO pin : PA9 */ 31 | #tGPIO_InitStruct.Pin = GPIO_PIN_9; 32 | #tGPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 33 | #tGPIO_InitStruct.Pull = GPIO_NOPULL; 34 | #tGPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 35 | #tHAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 36 | #n#t/*Configure GPIO pin : PB6 */ 37 | #tGPIO_InitStruct.Pin = GPIO_PIN_6; 38 | #tGPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 39 | #tGPIO_InitStruct.Pull = GPIO_NOPULL; 40 | #tGPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 41 | #tHAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 42 | #n 43 | } 44 | #n 45 | -------------------------------------------------------------------------------- /Src/license.tmp: -------------------------------------------------------------------------------- 1 | ** This notice applies to any and all portions of this file 2 | * that are not between comment pairs USER CODE BEGIN and 3 | * USER CODE END. Other portions of this file, whether 4 | * inserted by the user or by software development tools 5 | * are owned by their respective copyright owners. 6 | * 7 | * COPYRIGHT(c) 2018 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | -------------------------------------------------------------------------------- /Src/main.c: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include "stm32f4xx_hal.h" 3 | 4 | /* USER CODE BEGIN Includes */ 5 | /* vim: set ai et ts=4 sw=4: */ 6 | #include 7 | #include "st7735.h" 8 | #include "fonts.h" 9 | #include "testimg.h" 10 | /* USER CODE END Includes */ 11 | 12 | /* Private variables ---------------------------------------------------------*/ 13 | SPI_HandleTypeDef hspi1; 14 | 15 | UART_HandleTypeDef huart2; 16 | 17 | /* USER CODE BEGIN PV */ 18 | /* Private variables ---------------------------------------------------------*/ 19 | 20 | /* USER CODE END PV */ 21 | 22 | /* Private function prototypes -----------------------------------------------*/ 23 | void SystemClock_Config(void); 24 | static void MX_GPIO_Init(void); 25 | static void MX_SPI1_Init(void); 26 | static void MX_USART2_UART_Init(void); 27 | 28 | /* USER CODE BEGIN PFP */ 29 | /* Private function prototypes -----------------------------------------------*/ 30 | 31 | /* USER CODE END PFP */ 32 | 33 | /* USER CODE BEGIN 0 */ 34 | 35 | void init() { 36 | ST7735_Init(); 37 | 38 | const char ready[] = "Ready!\r\n"; 39 | HAL_UART_Transmit(&huart2, (uint8_t*)ready, sizeof(ready)-1, HAL_MAX_DELAY); 40 | } 41 | 42 | void loop() { 43 | // Check border 44 | ST7735_FillScreen(ST7735_BLACK); 45 | 46 | for(int x = 0; x < ST7735_WIDTH; x++) { 47 | ST7735_DrawPixel(x, 0, ST7735_RED); 48 | ST7735_DrawPixel(x, ST7735_HEIGHT-1, ST7735_RED); 49 | } 50 | 51 | for(int y = 0; y < ST7735_HEIGHT; y++) { 52 | ST7735_DrawPixel(0, y, ST7735_RED); 53 | ST7735_DrawPixel(ST7735_WIDTH-1, y, ST7735_RED); 54 | } 55 | 56 | HAL_Delay(3000); 57 | 58 | // Check fonts 59 | ST7735_FillScreen(ST7735_BLACK); 60 | ST7735_WriteString(0, 0, "Font_7x10, red on black, lorem ipsum dolor sit amet", Font_7x10, ST7735_RED, ST7735_BLACK); 61 | ST7735_WriteString(0, 3*10, "Font_11x18, green, lorem ipsum", Font_11x18, ST7735_GREEN, ST7735_BLACK); 62 | ST7735_WriteString(0, 3*10+3*18, "Font_16x26", Font_16x26, ST7735_BLUE, ST7735_BLACK); 63 | HAL_Delay(2000); 64 | 65 | // Check colors 66 | ST7735_FillScreen(ST7735_BLACK); 67 | ST7735_WriteString(0, 0, "BLACK", Font_11x18, ST7735_WHITE, ST7735_BLACK); 68 | HAL_Delay(500); 69 | 70 | ST7735_FillScreen(ST7735_BLUE); 71 | ST7735_WriteString(0, 0, "BLUE", Font_11x18, ST7735_BLACK, ST7735_BLUE); 72 | HAL_Delay(500); 73 | 74 | ST7735_FillScreen(ST7735_RED); 75 | ST7735_WriteString(0, 0, "RED", Font_11x18, ST7735_BLACK, ST7735_RED); 76 | HAL_Delay(500); 77 | 78 | ST7735_FillScreen(ST7735_GREEN); 79 | ST7735_WriteString(0, 0, "GREEN", Font_11x18, ST7735_BLACK, ST7735_GREEN); 80 | HAL_Delay(500); 81 | 82 | ST7735_FillScreen(ST7735_CYAN); 83 | ST7735_WriteString(0, 0, "CYAN", Font_11x18, ST7735_BLACK, ST7735_CYAN); 84 | HAL_Delay(500); 85 | 86 | ST7735_FillScreen(ST7735_MAGENTA); 87 | ST7735_WriteString(0, 0, "MAGENTA", Font_11x18, ST7735_BLACK, ST7735_MAGENTA); 88 | HAL_Delay(500); 89 | 90 | ST7735_FillScreen(ST7735_YELLOW); 91 | ST7735_WriteString(0, 0, "YELLOW", Font_11x18, ST7735_BLACK, ST7735_YELLOW); 92 | HAL_Delay(500); 93 | 94 | ST7735_FillScreen(ST7735_WHITE); 95 | ST7735_WriteString(0, 0, "WHITE", Font_11x18, ST7735_BLACK, ST7735_WHITE); 96 | HAL_Delay(500); 97 | 98 | #ifdef ST7735_IS_128X128 99 | // Display test image 128x128 100 | ST7735_DrawImage(0, 0, ST7735_WIDTH, ST7735_HEIGHT, (uint16_t*)test_img_128x128); 101 | 102 | /* 103 | // Display test image 128x128 pixel by pixel 104 | for(int x = 0; x < ST7735_WIDTH; x++) { 105 | for(int y = 0; y < ST7735_HEIGHT; y++) { 106 | uint16_t color565 = test_img_128x128[y][x]; 107 | // fix endiness 108 | color565 = ((color565 & 0xFF00) >> 8) | ((color565 & 0xFF) << 8); 109 | ST7735_DrawPixel(x, y, color565); 110 | } 111 | } 112 | */ 113 | HAL_Delay(15000); 114 | #endif // ST7735_IS_128X128 115 | 116 | } 117 | 118 | /* USER CODE END 0 */ 119 | 120 | int main(void) 121 | { 122 | 123 | /* USER CODE BEGIN 1 */ 124 | 125 | /* USER CODE END 1 */ 126 | 127 | /* MCU Configuration----------------------------------------------------------*/ 128 | 129 | /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ 130 | HAL_Init(); 131 | 132 | /* USER CODE BEGIN Init */ 133 | 134 | /* USER CODE END Init */ 135 | 136 | /* Configure the system clock */ 137 | SystemClock_Config(); 138 | 139 | /* USER CODE BEGIN SysInit */ 140 | 141 | /* USER CODE END SysInit */ 142 | 143 | /* Initialize all configured peripherals */ 144 | MX_GPIO_Init(); 145 | MX_SPI1_Init(); 146 | MX_USART2_UART_Init(); 147 | 148 | /* USER CODE BEGIN 2 */ 149 | 150 | /* USER CODE END 2 */ 151 | 152 | /* Infinite loop */ 153 | /* USER CODE BEGIN WHILE */ 154 | init(); 155 | while (1) 156 | { 157 | loop(); 158 | /* USER CODE END WHILE */ 159 | 160 | /* USER CODE BEGIN 3 */ 161 | 162 | } 163 | /* USER CODE END 3 */ 164 | 165 | } 166 | 167 | /** System Clock Configuration 168 | */ 169 | void SystemClock_Config(void) 170 | { 171 | 172 | RCC_OscInitTypeDef RCC_OscInitStruct; 173 | RCC_ClkInitTypeDef RCC_ClkInitStruct; 174 | 175 | /**Configure the main internal regulator output voltage 176 | */ 177 | __HAL_RCC_PWR_CLK_ENABLE(); 178 | 179 | __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); 180 | 181 | /**Initializes the CPU, AHB and APB busses clocks 182 | */ 183 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; 184 | RCC_OscInitStruct.HSIState = RCC_HSI_ON; 185 | RCC_OscInitStruct.HSICalibrationValue = 16; 186 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 187 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; 188 | RCC_OscInitStruct.PLL.PLLM = 16; 189 | RCC_OscInitStruct.PLL.PLLN = 336; 190 | RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; 191 | RCC_OscInitStruct.PLL.PLLQ = 4; 192 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 193 | { 194 | _Error_Handler(__FILE__, __LINE__); 195 | } 196 | 197 | /**Initializes the CPU, AHB and APB busses clocks 198 | */ 199 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK 200 | |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; 201 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 202 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 203 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; 204 | RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; 205 | 206 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) 207 | { 208 | _Error_Handler(__FILE__, __LINE__); 209 | } 210 | 211 | /**Configure the Systick interrupt time 212 | */ 213 | HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000); 214 | 215 | /**Configure the Systick 216 | */ 217 | HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); 218 | 219 | /* SysTick_IRQn interrupt configuration */ 220 | HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); 221 | } 222 | 223 | /* SPI1 init function */ 224 | static void MX_SPI1_Init(void) 225 | { 226 | 227 | /* SPI1 parameter configuration*/ 228 | hspi1.Instance = SPI1; 229 | hspi1.Init.Mode = SPI_MODE_MASTER; 230 | hspi1.Init.Direction = SPI_DIRECTION_1LINE; 231 | hspi1.Init.DataSize = SPI_DATASIZE_8BIT; 232 | hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; 233 | hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; 234 | hspi1.Init.NSS = SPI_NSS_SOFT; 235 | hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; 236 | hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; 237 | hspi1.Init.TIMode = SPI_TIMODE_DISABLE; 238 | hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; 239 | hspi1.Init.CRCPolynomial = 10; 240 | if (HAL_SPI_Init(&hspi1) != HAL_OK) 241 | { 242 | _Error_Handler(__FILE__, __LINE__); 243 | } 244 | 245 | } 246 | 247 | /* USART2 init function */ 248 | static void MX_USART2_UART_Init(void) 249 | { 250 | 251 | huart2.Instance = USART2; 252 | huart2.Init.BaudRate = 9600; 253 | huart2.Init.WordLength = UART_WORDLENGTH_8B; 254 | huart2.Init.StopBits = UART_STOPBITS_1; 255 | huart2.Init.Parity = UART_PARITY_NONE; 256 | huart2.Init.Mode = UART_MODE_TX_RX; 257 | huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; 258 | huart2.Init.OverSampling = UART_OVERSAMPLING_16; 259 | if (HAL_UART_Init(&huart2) != HAL_OK) 260 | { 261 | _Error_Handler(__FILE__, __LINE__); 262 | } 263 | 264 | } 265 | 266 | /** Configure pins as 267 | * Analog 268 | * Input 269 | * Output 270 | * EVENT_OUT 271 | * EXTI 272 | */ 273 | static void MX_GPIO_Init(void) 274 | { 275 | 276 | GPIO_InitTypeDef GPIO_InitStruct; 277 | 278 | /* GPIO Ports Clock Enable */ 279 | __HAL_RCC_GPIOC_CLK_ENABLE(); 280 | __HAL_RCC_GPIOH_CLK_ENABLE(); 281 | __HAL_RCC_GPIOA_CLK_ENABLE(); 282 | __HAL_RCC_GPIOB_CLK_ENABLE(); 283 | 284 | /*Configure GPIO pin Output Level */ 285 | HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, GPIO_PIN_RESET); 286 | 287 | /*Configure GPIO pin Output Level */ 288 | HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET); 289 | 290 | /*Configure GPIO pin Output Level */ 291 | HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); 292 | 293 | /*Configure GPIO pin : B1_Pin */ 294 | GPIO_InitStruct.Pin = B1_Pin; 295 | GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING; 296 | GPIO_InitStruct.Pull = GPIO_NOPULL; 297 | HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct); 298 | 299 | /*Configure GPIO pin : PC7 */ 300 | GPIO_InitStruct.Pin = GPIO_PIN_7; 301 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 302 | GPIO_InitStruct.Pull = GPIO_NOPULL; 303 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 304 | HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); 305 | 306 | /*Configure GPIO pin : PA9 */ 307 | GPIO_InitStruct.Pin = GPIO_PIN_9; 308 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 309 | GPIO_InitStruct.Pull = GPIO_NOPULL; 310 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 311 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 312 | 313 | /*Configure GPIO pin : PB6 */ 314 | GPIO_InitStruct.Pin = GPIO_PIN_6; 315 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; 316 | GPIO_InitStruct.Pull = GPIO_NOPULL; 317 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; 318 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); 319 | 320 | } 321 | 322 | /* USER CODE BEGIN 4 */ 323 | 324 | /* USER CODE END 4 */ 325 | 326 | /** 327 | * @brief This function is executed in case of error occurrence. 328 | * @param None 329 | * @retval None 330 | */ 331 | void _Error_Handler(char * file, int line) 332 | { 333 | /* USER CODE BEGIN Error_Handler_Debug */ 334 | /* User can add his own implementation to report the HAL error return state */ 335 | while(1) 336 | { 337 | } 338 | /* USER CODE END Error_Handler_Debug */ 339 | } 340 | 341 | #ifdef USE_FULL_ASSERT 342 | 343 | /** 344 | * @brief Reports the name of the source file and the source line number 345 | * where the assert_param error has occurred. 346 | * @param file: pointer to the source file name 347 | * @param line: assert_param error line source number 348 | * @retval None 349 | */ 350 | void assert_failed(uint8_t* file, uint32_t line) 351 | { 352 | /* USER CODE BEGIN 6 */ 353 | /* User can add his own implementation to report the file name and line number, 354 | ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ 355 | /* USER CODE END 6 */ 356 | 357 | } 358 | 359 | #endif 360 | 361 | /** 362 | * @} 363 | */ 364 | 365 | /** 366 | * @} 367 | */ 368 | 369 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 370 | -------------------------------------------------------------------------------- /Src/stm32f4xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : stm32f4xx_hal_msp.c 4 | * Description : This file provides code for the MSP Initialization 5 | * and de-Initialization codes. 6 | ****************************************************************************** 7 | ** This notice applies to any and all portions of this file 8 | * that are not between comment pairs USER CODE BEGIN and 9 | * USER CODE END. Other portions of this file, whether 10 | * inserted by the user or by software development tools 11 | * are owned by their respective copyright owners. 12 | * 13 | * COPYRIGHT(c) 2018 STMicroelectronics 14 | * 15 | * Redistribution and use in source and binary forms, with or without modification, 16 | * are permitted provided that the following conditions are met: 17 | * 1. Redistributions of source code must retain the above copyright notice, 18 | * this list of conditions and the following disclaimer. 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 23 | * may be used to endorse or promote products derived from this software 24 | * without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 27 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 32 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 33 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 34 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | ****************************************************************************** 38 | */ 39 | /* Includes ------------------------------------------------------------------*/ 40 | #include "stm32f4xx_hal.h" 41 | 42 | extern void _Error_Handler(char *, int); 43 | /* USER CODE BEGIN 0 */ 44 | 45 | /* USER CODE END 0 */ 46 | /** 47 | * Initializes the Global MSP. 48 | */ 49 | void HAL_MspInit(void) 50 | { 51 | /* USER CODE BEGIN MspInit 0 */ 52 | 53 | /* USER CODE END MspInit 0 */ 54 | 55 | HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0); 56 | 57 | /* System interrupt init*/ 58 | /* MemoryManagement_IRQn interrupt configuration */ 59 | HAL_NVIC_SetPriority(MemoryManagement_IRQn, 0, 0); 60 | /* BusFault_IRQn interrupt configuration */ 61 | HAL_NVIC_SetPriority(BusFault_IRQn, 0, 0); 62 | /* UsageFault_IRQn interrupt configuration */ 63 | HAL_NVIC_SetPriority(UsageFault_IRQn, 0, 0); 64 | /* SVCall_IRQn interrupt configuration */ 65 | HAL_NVIC_SetPriority(SVCall_IRQn, 0, 0); 66 | /* DebugMonitor_IRQn interrupt configuration */ 67 | HAL_NVIC_SetPriority(DebugMonitor_IRQn, 0, 0); 68 | /* PendSV_IRQn interrupt configuration */ 69 | HAL_NVIC_SetPriority(PendSV_IRQn, 0, 0); 70 | /* SysTick_IRQn interrupt configuration */ 71 | HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); 72 | 73 | /* USER CODE BEGIN MspInit 1 */ 74 | 75 | /* USER CODE END MspInit 1 */ 76 | } 77 | 78 | void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi) 79 | { 80 | 81 | GPIO_InitTypeDef GPIO_InitStruct; 82 | if(hspi->Instance==SPI1) 83 | { 84 | /* USER CODE BEGIN SPI1_MspInit 0 */ 85 | 86 | /* USER CODE END SPI1_MspInit 0 */ 87 | /* Peripheral clock enable */ 88 | __HAL_RCC_SPI1_CLK_ENABLE(); 89 | 90 | /**SPI1 GPIO Configuration 91 | PA5 ------> SPI1_SCK 92 | PA7 ------> SPI1_MOSI 93 | */ 94 | GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7; 95 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 96 | GPIO_InitStruct.Pull = GPIO_NOPULL; 97 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 98 | GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; 99 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 100 | 101 | /* USER CODE BEGIN SPI1_MspInit 1 */ 102 | 103 | /* USER CODE END SPI1_MspInit 1 */ 104 | } 105 | 106 | } 107 | 108 | void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi) 109 | { 110 | 111 | if(hspi->Instance==SPI1) 112 | { 113 | /* USER CODE BEGIN SPI1_MspDeInit 0 */ 114 | 115 | /* USER CODE END SPI1_MspDeInit 0 */ 116 | /* Peripheral clock disable */ 117 | __HAL_RCC_SPI1_CLK_DISABLE(); 118 | 119 | /**SPI1 GPIO Configuration 120 | PA5 ------> SPI1_SCK 121 | PA7 ------> SPI1_MOSI 122 | */ 123 | HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_7); 124 | 125 | /* USER CODE BEGIN SPI1_MspDeInit 1 */ 126 | 127 | /* USER CODE END SPI1_MspDeInit 1 */ 128 | } 129 | 130 | } 131 | 132 | void HAL_UART_MspInit(UART_HandleTypeDef* huart) 133 | { 134 | 135 | GPIO_InitTypeDef GPIO_InitStruct; 136 | if(huart->Instance==USART2) 137 | { 138 | /* USER CODE BEGIN USART2_MspInit 0 */ 139 | 140 | /* USER CODE END USART2_MspInit 0 */ 141 | /* Peripheral clock enable */ 142 | __HAL_RCC_USART2_CLK_ENABLE(); 143 | 144 | /**USART2 GPIO Configuration 145 | PA2 ------> USART2_TX 146 | PA3 ------> USART2_RX 147 | */ 148 | GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin; 149 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 150 | GPIO_InitStruct.Pull = GPIO_PULLUP; 151 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 152 | GPIO_InitStruct.Alternate = GPIO_AF7_USART2; 153 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 154 | 155 | /* USER CODE BEGIN USART2_MspInit 1 */ 156 | 157 | /* USER CODE END USART2_MspInit 1 */ 158 | } 159 | 160 | } 161 | 162 | void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) 163 | { 164 | 165 | if(huart->Instance==USART2) 166 | { 167 | /* USER CODE BEGIN USART2_MspDeInit 0 */ 168 | 169 | /* USER CODE END USART2_MspDeInit 0 */ 170 | /* Peripheral clock disable */ 171 | __HAL_RCC_USART2_CLK_DISABLE(); 172 | 173 | /**USART2 GPIO Configuration 174 | PA2 ------> USART2_TX 175 | PA3 ------> USART2_RX 176 | */ 177 | HAL_GPIO_DeInit(GPIOA, USART_TX_Pin|USART_RX_Pin); 178 | 179 | /* USER CODE BEGIN USART2_MspDeInit 1 */ 180 | 181 | /* USER CODE END USART2_MspDeInit 1 */ 182 | } 183 | 184 | } 185 | 186 | /* USER CODE BEGIN 1 */ 187 | 188 | /* USER CODE END 1 */ 189 | 190 | /** 191 | * @} 192 | */ 193 | 194 | /** 195 | * @} 196 | */ 197 | 198 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 199 | -------------------------------------------------------------------------------- /Src/stm32f4xx_it.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.c 4 | * @brief Interrupt Service Routines. 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2018 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Includes ------------------------------------------------------------------*/ 34 | #include "stm32f4xx_hal.h" 35 | #include "stm32f4xx.h" 36 | #include "stm32f4xx_it.h" 37 | 38 | /* USER CODE BEGIN 0 */ 39 | 40 | /* USER CODE END 0 */ 41 | 42 | /* External variables --------------------------------------------------------*/ 43 | 44 | /******************************************************************************/ 45 | /* Cortex-M4 Processor Interruption and Exception Handlers */ 46 | /******************************************************************************/ 47 | 48 | /** 49 | * @brief This function handles System tick timer. 50 | */ 51 | void SysTick_Handler(void) 52 | { 53 | /* USER CODE BEGIN SysTick_IRQn 0 */ 54 | 55 | /* USER CODE END SysTick_IRQn 0 */ 56 | HAL_IncTick(); 57 | HAL_SYSTICK_IRQHandler(); 58 | /* USER CODE BEGIN SysTick_IRQn 1 */ 59 | 60 | /* USER CODE END SysTick_IRQn 1 */ 61 | } 62 | 63 | /******************************************************************************/ 64 | /* STM32F4xx Peripheral Interrupt Handlers */ 65 | /* Add here the Interrupt Handlers for the used peripherals. */ 66 | /* For the available peripheral interrupt handler names, */ 67 | /* please refer to the startup file (startup_stm32f4xx.s). */ 68 | /******************************************************************************/ 69 | 70 | /* USER CODE BEGIN 1 */ 71 | 72 | /* USER CODE END 1 */ 73 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 74 | -------------------------------------------------------------------------------- /Src/system.tmp: -------------------------------------------------------------------------------- 1 | #n 2 | #n 3 | #tHAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);#n 4 | #t/* System interrupt init*/ 5 | #t/* MemoryManagement_IRQn interrupt configuration */ 6 | #tNVIC_SetPriority(MemoryManagement_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); 7 | #t/* BusFault_IRQn interrupt configuration */ 8 | #tNVIC_SetPriority(BusFault_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); 9 | #t/* UsageFault_IRQn interrupt configuration */ 10 | #tNVIC_SetPriority(UsageFault_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); 11 | #t/* SVCall_IRQn interrupt configuration */ 12 | #tNVIC_SetPriority(SVCall_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); 13 | #t/* DebugMonitor_IRQn interrupt configuration */ 14 | #tNVIC_SetPriority(DebugMonitor_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); 15 | #t/* PendSV_IRQn interrupt configuration */ 16 | #tNVIC_SetPriority(PendSV_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); 17 | #t/* SysTick_IRQn interrupt configuration */ 18 | #tNVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0)); 19 | #n 20 | #n 21 | -------------------------------------------------------------------------------- /Src/system_stm32f4xx.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.c 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. 6 | * 7 | * This file provides two functions and one global variable to be called from 8 | * user application: 9 | * - SystemInit(): This function is called at startup just after reset and 10 | * before branch to main program. This call is made inside 11 | * the "startup_stm32f4xx.s" file. 12 | * 13 | * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used 14 | * by the user application to setup the SysTick 15 | * timer or configure other parameters. 16 | * 17 | * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must 18 | * be called whenever the core clock is changed 19 | * during program execution. 20 | * 21 | * 22 | ****************************************************************************** 23 | * @attention 24 | * 25 | *

© COPYRIGHT 2017 STMicroelectronics

26 | * 27 | * Redistribution and use in source and binary forms, with or without modification, 28 | * are permitted provided that the following conditions are met: 29 | * 1. Redistributions of source code must retain the above copyright notice, 30 | * this list of conditions and the following disclaimer. 31 | * 2. Redistributions in binary form must reproduce the above copyright notice, 32 | * this list of conditions and the following disclaimer in the documentation 33 | * and/or other materials provided with the distribution. 34 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 35 | * may be used to endorse or promote products derived from this software 36 | * without specific prior written permission. 37 | * 38 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 39 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 40 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 41 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 42 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 43 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 44 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 45 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 46 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 47 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 48 | * 49 | ****************************************************************************** 50 | */ 51 | 52 | /** @addtogroup CMSIS 53 | * @{ 54 | */ 55 | 56 | /** @addtogroup stm32f4xx_system 57 | * @{ 58 | */ 59 | 60 | /** @addtogroup STM32F4xx_System_Private_Includes 61 | * @{ 62 | */ 63 | 64 | 65 | #include "stm32f4xx.h" 66 | 67 | #if !defined (HSE_VALUE) 68 | #define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ 69 | #endif /* HSE_VALUE */ 70 | 71 | #if !defined (HSI_VALUE) 72 | #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ 73 | #endif /* HSI_VALUE */ 74 | 75 | /** 76 | * @} 77 | */ 78 | 79 | /** @addtogroup STM32F4xx_System_Private_TypesDefinitions 80 | * @{ 81 | */ 82 | 83 | /** 84 | * @} 85 | */ 86 | 87 | /** @addtogroup STM32F4xx_System_Private_Defines 88 | * @{ 89 | */ 90 | 91 | /************************* Miscellaneous Configuration ************************/ 92 | /*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ 93 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ 94 | || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ 95 | || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) 96 | /* #define DATA_IN_ExtSRAM */ 97 | #endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx ||\ 98 | STM32F412Zx || STM32F412Vx */ 99 | 100 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ 101 | || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) 102 | /* #define DATA_IN_ExtSDRAM */ 103 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx ||\ 104 | STM32F479xx */ 105 | 106 | /*!< Uncomment the following line if you need to relocate your vector Table in 107 | Internal SRAM. */ 108 | /* #define VECT_TAB_SRAM */ 109 | #define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. 110 | This value must be a multiple of 0x200. */ 111 | /******************************************************************************/ 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | /** @addtogroup STM32F4xx_System_Private_Macros 118 | * @{ 119 | */ 120 | 121 | /** 122 | * @} 123 | */ 124 | 125 | /** @addtogroup STM32F4xx_System_Private_Variables 126 | * @{ 127 | */ 128 | /* This variable is updated in three ways: 129 | 1) by calling CMSIS function SystemCoreClockUpdate() 130 | 2) by calling HAL API function HAL_RCC_GetHCLKFreq() 131 | 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency 132 | Note: If you use this function to configure the system clock; then there 133 | is no need to call the 2 first functions listed above, since SystemCoreClock 134 | variable is updated automatically. 135 | */ 136 | uint32_t SystemCoreClock = 16000000; 137 | const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; 138 | const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; 139 | /** 140 | * @} 141 | */ 142 | 143 | /** @addtogroup STM32F4xx_System_Private_FunctionPrototypes 144 | * @{ 145 | */ 146 | 147 | #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) 148 | static void SystemInit_ExtMemCtl(void); 149 | #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ 150 | 151 | /** 152 | * @} 153 | */ 154 | 155 | /** @addtogroup STM32F4xx_System_Private_Functions 156 | * @{ 157 | */ 158 | 159 | /** 160 | * @brief Setup the microcontroller system 161 | * Initialize the FPU setting, vector table location and External memory 162 | * configuration. 163 | * @param None 164 | * @retval None 165 | */ 166 | void SystemInit(void) 167 | { 168 | /* FPU settings ------------------------------------------------------------*/ 169 | #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) 170 | SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ 171 | #endif 172 | /* Reset the RCC clock configuration to the default reset state ------------*/ 173 | /* Set HSION bit */ 174 | RCC->CR |= (uint32_t)0x00000001; 175 | 176 | /* Reset CFGR register */ 177 | RCC->CFGR = 0x00000000; 178 | 179 | /* Reset HSEON, CSSON and PLLON bits */ 180 | RCC->CR &= (uint32_t)0xFEF6FFFF; 181 | 182 | /* Reset PLLCFGR register */ 183 | RCC->PLLCFGR = 0x24003010; 184 | 185 | /* Reset HSEBYP bit */ 186 | RCC->CR &= (uint32_t)0xFFFBFFFF; 187 | 188 | /* Disable all interrupts */ 189 | RCC->CIR = 0x00000000; 190 | 191 | #if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) 192 | SystemInit_ExtMemCtl(); 193 | #endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ 194 | 195 | /* Configure the Vector Table location add offset address ------------------*/ 196 | #ifdef VECT_TAB_SRAM 197 | SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ 198 | #else 199 | SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ 200 | #endif 201 | } 202 | 203 | /** 204 | * @brief Update SystemCoreClock variable according to Clock Register Values. 205 | * The SystemCoreClock variable contains the core clock (HCLK), it can 206 | * be used by the user application to setup the SysTick timer or configure 207 | * other parameters. 208 | * 209 | * @note Each time the core clock (HCLK) changes, this function must be called 210 | * to update SystemCoreClock variable value. Otherwise, any configuration 211 | * based on this variable will be incorrect. 212 | * 213 | * @note - The system frequency computed by this function is not the real 214 | * frequency in the chip. It is calculated based on the predefined 215 | * constant and the selected clock source: 216 | * 217 | * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) 218 | * 219 | * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) 220 | * 221 | * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) 222 | * or HSI_VALUE(*) multiplied/divided by the PLL factors. 223 | * 224 | * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value 225 | * 16 MHz) but the real value may vary depending on the variations 226 | * in voltage and temperature. 227 | * 228 | * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value 229 | * depends on the application requirements), user has to ensure that HSE_VALUE 230 | * is same as the real frequency of the crystal used. Otherwise, this function 231 | * may have wrong result. 232 | * 233 | * - The result of this function could be not correct when using fractional 234 | * value for HSE crystal. 235 | * 236 | * @param None 237 | * @retval None 238 | */ 239 | void SystemCoreClockUpdate(void) 240 | { 241 | uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; 242 | 243 | /* Get SYSCLK source -------------------------------------------------------*/ 244 | tmp = RCC->CFGR & RCC_CFGR_SWS; 245 | 246 | switch (tmp) 247 | { 248 | case 0x00: /* HSI used as system clock source */ 249 | SystemCoreClock = HSI_VALUE; 250 | break; 251 | case 0x04: /* HSE used as system clock source */ 252 | SystemCoreClock = HSE_VALUE; 253 | break; 254 | case 0x08: /* PLL used as system clock source */ 255 | 256 | /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N 257 | SYSCLK = PLL_VCO / PLL_P 258 | */ 259 | pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; 260 | pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; 261 | 262 | if (pllsource != 0) 263 | { 264 | /* HSE used as PLL clock source */ 265 | pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); 266 | } 267 | else 268 | { 269 | /* HSI used as PLL clock source */ 270 | pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); 271 | } 272 | 273 | pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >>16) + 1 ) *2; 274 | SystemCoreClock = pllvco/pllp; 275 | break; 276 | default: 277 | SystemCoreClock = HSI_VALUE; 278 | break; 279 | } 280 | /* Compute HCLK frequency --------------------------------------------------*/ 281 | /* Get HCLK prescaler */ 282 | tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; 283 | /* HCLK frequency */ 284 | SystemCoreClock >>= tmp; 285 | } 286 | 287 | #if defined (DATA_IN_ExtSRAM) && defined (DATA_IN_ExtSDRAM) 288 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ 289 | || defined(STM32F469xx) || defined(STM32F479xx) 290 | /** 291 | * @brief Setup the external memory controller. 292 | * Called in startup_stm32f4xx.s before jump to main. 293 | * This function configures the external memories (SRAM/SDRAM) 294 | * This SRAM/SDRAM will be used as program data memory (including heap and stack). 295 | * @param None 296 | * @retval None 297 | */ 298 | void SystemInit_ExtMemCtl(void) 299 | { 300 | __IO uint32_t tmp = 0x00; 301 | 302 | register uint32_t tmpreg = 0, timeout = 0xFFFF; 303 | register __IO uint32_t index; 304 | 305 | /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ 306 | RCC->AHB1ENR |= 0x000001F8; 307 | 308 | /* Delay after an RCC peripheral clock enabling */ 309 | tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); 310 | 311 | /* Connect PDx pins to FMC Alternate function */ 312 | GPIOD->AFR[0] = 0x00CCC0CC; 313 | GPIOD->AFR[1] = 0xCCCCCCCC; 314 | /* Configure PDx pins in Alternate function mode */ 315 | GPIOD->MODER = 0xAAAA0A8A; 316 | /* Configure PDx pins speed to 100 MHz */ 317 | GPIOD->OSPEEDR = 0xFFFF0FCF; 318 | /* Configure PDx pins Output type to push-pull */ 319 | GPIOD->OTYPER = 0x00000000; 320 | /* No pull-up, pull-down for PDx pins */ 321 | GPIOD->PUPDR = 0x00000000; 322 | 323 | /* Connect PEx pins to FMC Alternate function */ 324 | GPIOE->AFR[0] = 0xC00CC0CC; 325 | GPIOE->AFR[1] = 0xCCCCCCCC; 326 | /* Configure PEx pins in Alternate function mode */ 327 | GPIOE->MODER = 0xAAAA828A; 328 | /* Configure PEx pins speed to 100 MHz */ 329 | GPIOE->OSPEEDR = 0xFFFFC3CF; 330 | /* Configure PEx pins Output type to push-pull */ 331 | GPIOE->OTYPER = 0x00000000; 332 | /* No pull-up, pull-down for PEx pins */ 333 | GPIOE->PUPDR = 0x00000000; 334 | 335 | /* Connect PFx pins to FMC Alternate function */ 336 | GPIOF->AFR[0] = 0xCCCCCCCC; 337 | GPIOF->AFR[1] = 0xCCCCCCCC; 338 | /* Configure PFx pins in Alternate function mode */ 339 | GPIOF->MODER = 0xAA800AAA; 340 | /* Configure PFx pins speed to 50 MHz */ 341 | GPIOF->OSPEEDR = 0xAA800AAA; 342 | /* Configure PFx pins Output type to push-pull */ 343 | GPIOF->OTYPER = 0x00000000; 344 | /* No pull-up, pull-down for PFx pins */ 345 | GPIOF->PUPDR = 0x00000000; 346 | 347 | /* Connect PGx pins to FMC Alternate function */ 348 | GPIOG->AFR[0] = 0xCCCCCCCC; 349 | GPIOG->AFR[1] = 0xCCCCCCCC; 350 | /* Configure PGx pins in Alternate function mode */ 351 | GPIOG->MODER = 0xAAAAAAAA; 352 | /* Configure PGx pins speed to 50 MHz */ 353 | GPIOG->OSPEEDR = 0xAAAAAAAA; 354 | /* Configure PGx pins Output type to push-pull */ 355 | GPIOG->OTYPER = 0x00000000; 356 | /* No pull-up, pull-down for PGx pins */ 357 | GPIOG->PUPDR = 0x00000000; 358 | 359 | /* Connect PHx pins to FMC Alternate function */ 360 | GPIOH->AFR[0] = 0x00C0CC00; 361 | GPIOH->AFR[1] = 0xCCCCCCCC; 362 | /* Configure PHx pins in Alternate function mode */ 363 | GPIOH->MODER = 0xAAAA08A0; 364 | /* Configure PHx pins speed to 50 MHz */ 365 | GPIOH->OSPEEDR = 0xAAAA08A0; 366 | /* Configure PHx pins Output type to push-pull */ 367 | GPIOH->OTYPER = 0x00000000; 368 | /* No pull-up, pull-down for PHx pins */ 369 | GPIOH->PUPDR = 0x00000000; 370 | 371 | /* Connect PIx pins to FMC Alternate function */ 372 | GPIOI->AFR[0] = 0xCCCCCCCC; 373 | GPIOI->AFR[1] = 0x00000CC0; 374 | /* Configure PIx pins in Alternate function mode */ 375 | GPIOI->MODER = 0x0028AAAA; 376 | /* Configure PIx pins speed to 50 MHz */ 377 | GPIOI->OSPEEDR = 0x0028AAAA; 378 | /* Configure PIx pins Output type to push-pull */ 379 | GPIOI->OTYPER = 0x00000000; 380 | /* No pull-up, pull-down for PIx pins */ 381 | GPIOI->PUPDR = 0x00000000; 382 | 383 | /*-- FMC Configuration -------------------------------------------------------*/ 384 | /* Enable the FMC interface clock */ 385 | RCC->AHB3ENR |= 0x00000001; 386 | /* Delay after an RCC peripheral clock enabling */ 387 | tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); 388 | 389 | FMC_Bank5_6->SDCR[0] = 0x000019E4; 390 | FMC_Bank5_6->SDTR[0] = 0x01115351; 391 | 392 | /* SDRAM initialization sequence */ 393 | /* Clock enable command */ 394 | FMC_Bank5_6->SDCMR = 0x00000011; 395 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 396 | while((tmpreg != 0) && (timeout-- > 0)) 397 | { 398 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 399 | } 400 | 401 | /* Delay */ 402 | for (index = 0; index<1000; index++); 403 | 404 | /* PALL command */ 405 | FMC_Bank5_6->SDCMR = 0x00000012; 406 | timeout = 0xFFFF; 407 | while((tmpreg != 0) && (timeout-- > 0)) 408 | { 409 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 410 | } 411 | 412 | /* Auto refresh command */ 413 | FMC_Bank5_6->SDCMR = 0x00000073; 414 | timeout = 0xFFFF; 415 | while((tmpreg != 0) && (timeout-- > 0)) 416 | { 417 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 418 | } 419 | 420 | /* MRD register program */ 421 | FMC_Bank5_6->SDCMR = 0x00046014; 422 | timeout = 0xFFFF; 423 | while((tmpreg != 0) && (timeout-- > 0)) 424 | { 425 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 426 | } 427 | 428 | /* Set refresh count */ 429 | tmpreg = FMC_Bank5_6->SDRTR; 430 | FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); 431 | 432 | /* Disable write protection */ 433 | tmpreg = FMC_Bank5_6->SDCR[0]; 434 | FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); 435 | 436 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) 437 | /* Configure and enable Bank1_SRAM2 */ 438 | FMC_Bank1->BTCR[2] = 0x00001011; 439 | FMC_Bank1->BTCR[3] = 0x00000201; 440 | FMC_Bank1E->BWTR[2] = 0x0fffffff; 441 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ 442 | #if defined(STM32F469xx) || defined(STM32F479xx) 443 | /* Configure and enable Bank1_SRAM2 */ 444 | FMC_Bank1->BTCR[2] = 0x00001091; 445 | FMC_Bank1->BTCR[3] = 0x00110212; 446 | FMC_Bank1E->BWTR[2] = 0x0fffffff; 447 | #endif /* STM32F469xx || STM32F479xx */ 448 | 449 | (void)(tmp); 450 | } 451 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ 452 | #elif defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM) 453 | /** 454 | * @brief Setup the external memory controller. 455 | * Called in startup_stm32f4xx.s before jump to main. 456 | * This function configures the external memories (SRAM/SDRAM) 457 | * This SRAM/SDRAM will be used as program data memory (including heap and stack). 458 | * @param None 459 | * @retval None 460 | */ 461 | void SystemInit_ExtMemCtl(void) 462 | { 463 | __IO uint32_t tmp = 0x00; 464 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ 465 | || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) 466 | #if defined (DATA_IN_ExtSDRAM) 467 | register uint32_t tmpreg = 0, timeout = 0xFFFF; 468 | register __IO uint32_t index; 469 | 470 | #if defined(STM32F446xx) 471 | /* Enable GPIOA, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG interface 472 | clock */ 473 | RCC->AHB1ENR |= 0x0000007D; 474 | #else 475 | /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface 476 | clock */ 477 | RCC->AHB1ENR |= 0x000001F8; 478 | #endif /* STM32F446xx */ 479 | /* Delay after an RCC peripheral clock enabling */ 480 | tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); 481 | 482 | #if defined(STM32F446xx) 483 | /* Connect PAx pins to FMC Alternate function */ 484 | GPIOA->AFR[0] |= 0xC0000000; 485 | GPIOA->AFR[1] |= 0x00000000; 486 | /* Configure PDx pins in Alternate function mode */ 487 | GPIOA->MODER |= 0x00008000; 488 | /* Configure PDx pins speed to 50 MHz */ 489 | GPIOA->OSPEEDR |= 0x00008000; 490 | /* Configure PDx pins Output type to push-pull */ 491 | GPIOA->OTYPER |= 0x00000000; 492 | /* No pull-up, pull-down for PDx pins */ 493 | GPIOA->PUPDR |= 0x00000000; 494 | 495 | /* Connect PCx pins to FMC Alternate function */ 496 | GPIOC->AFR[0] |= 0x00CC0000; 497 | GPIOC->AFR[1] |= 0x00000000; 498 | /* Configure PDx pins in Alternate function mode */ 499 | GPIOC->MODER |= 0x00000A00; 500 | /* Configure PDx pins speed to 50 MHz */ 501 | GPIOC->OSPEEDR |= 0x00000A00; 502 | /* Configure PDx pins Output type to push-pull */ 503 | GPIOC->OTYPER |= 0x00000000; 504 | /* No pull-up, pull-down for PDx pins */ 505 | GPIOC->PUPDR |= 0x00000000; 506 | #endif /* STM32F446xx */ 507 | 508 | /* Connect PDx pins to FMC Alternate function */ 509 | GPIOD->AFR[0] = 0x000000CC; 510 | GPIOD->AFR[1] = 0xCC000CCC; 511 | /* Configure PDx pins in Alternate function mode */ 512 | GPIOD->MODER = 0xA02A000A; 513 | /* Configure PDx pins speed to 50 MHz */ 514 | GPIOD->OSPEEDR = 0xA02A000A; 515 | /* Configure PDx pins Output type to push-pull */ 516 | GPIOD->OTYPER = 0x00000000; 517 | /* No pull-up, pull-down for PDx pins */ 518 | GPIOD->PUPDR = 0x00000000; 519 | 520 | /* Connect PEx pins to FMC Alternate function */ 521 | GPIOE->AFR[0] = 0xC00000CC; 522 | GPIOE->AFR[1] = 0xCCCCCCCC; 523 | /* Configure PEx pins in Alternate function mode */ 524 | GPIOE->MODER = 0xAAAA800A; 525 | /* Configure PEx pins speed to 50 MHz */ 526 | GPIOE->OSPEEDR = 0xAAAA800A; 527 | /* Configure PEx pins Output type to push-pull */ 528 | GPIOE->OTYPER = 0x00000000; 529 | /* No pull-up, pull-down for PEx pins */ 530 | GPIOE->PUPDR = 0x00000000; 531 | 532 | /* Connect PFx pins to FMC Alternate function */ 533 | GPIOF->AFR[0] = 0xCCCCCCCC; 534 | GPIOF->AFR[1] = 0xCCCCCCCC; 535 | /* Configure PFx pins in Alternate function mode */ 536 | GPIOF->MODER = 0xAA800AAA; 537 | /* Configure PFx pins speed to 50 MHz */ 538 | GPIOF->OSPEEDR = 0xAA800AAA; 539 | /* Configure PFx pins Output type to push-pull */ 540 | GPIOF->OTYPER = 0x00000000; 541 | /* No pull-up, pull-down for PFx pins */ 542 | GPIOF->PUPDR = 0x00000000; 543 | 544 | /* Connect PGx pins to FMC Alternate function */ 545 | GPIOG->AFR[0] = 0xCCCCCCCC; 546 | GPIOG->AFR[1] = 0xCCCCCCCC; 547 | /* Configure PGx pins in Alternate function mode */ 548 | GPIOG->MODER = 0xAAAAAAAA; 549 | /* Configure PGx pins speed to 50 MHz */ 550 | GPIOG->OSPEEDR = 0xAAAAAAAA; 551 | /* Configure PGx pins Output type to push-pull */ 552 | GPIOG->OTYPER = 0x00000000; 553 | /* No pull-up, pull-down for PGx pins */ 554 | GPIOG->PUPDR = 0x00000000; 555 | 556 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ 557 | || defined(STM32F469xx) || defined(STM32F479xx) 558 | /* Connect PHx pins to FMC Alternate function */ 559 | GPIOH->AFR[0] = 0x00C0CC00; 560 | GPIOH->AFR[1] = 0xCCCCCCCC; 561 | /* Configure PHx pins in Alternate function mode */ 562 | GPIOH->MODER = 0xAAAA08A0; 563 | /* Configure PHx pins speed to 50 MHz */ 564 | GPIOH->OSPEEDR = 0xAAAA08A0; 565 | /* Configure PHx pins Output type to push-pull */ 566 | GPIOH->OTYPER = 0x00000000; 567 | /* No pull-up, pull-down for PHx pins */ 568 | GPIOH->PUPDR = 0x00000000; 569 | 570 | /* Connect PIx pins to FMC Alternate function */ 571 | GPIOI->AFR[0] = 0xCCCCCCCC; 572 | GPIOI->AFR[1] = 0x00000CC0; 573 | /* Configure PIx pins in Alternate function mode */ 574 | GPIOI->MODER = 0x0028AAAA; 575 | /* Configure PIx pins speed to 50 MHz */ 576 | GPIOI->OSPEEDR = 0x0028AAAA; 577 | /* Configure PIx pins Output type to push-pull */ 578 | GPIOI->OTYPER = 0x00000000; 579 | /* No pull-up, pull-down for PIx pins */ 580 | GPIOI->PUPDR = 0x00000000; 581 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ 582 | 583 | /*-- FMC Configuration -------------------------------------------------------*/ 584 | /* Enable the FMC interface clock */ 585 | RCC->AHB3ENR |= 0x00000001; 586 | /* Delay after an RCC peripheral clock enabling */ 587 | tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); 588 | 589 | /* Configure and enable SDRAM bank1 */ 590 | #if defined(STM32F446xx) 591 | FMC_Bank5_6->SDCR[0] = 0x00001954; 592 | #else 593 | FMC_Bank5_6->SDCR[0] = 0x000019E4; 594 | #endif /* STM32F446xx */ 595 | FMC_Bank5_6->SDTR[0] = 0x01115351; 596 | 597 | /* SDRAM initialization sequence */ 598 | /* Clock enable command */ 599 | FMC_Bank5_6->SDCMR = 0x00000011; 600 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 601 | while((tmpreg != 0) && (timeout-- > 0)) 602 | { 603 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 604 | } 605 | 606 | /* Delay */ 607 | for (index = 0; index<1000; index++); 608 | 609 | /* PALL command */ 610 | FMC_Bank5_6->SDCMR = 0x00000012; 611 | timeout = 0xFFFF; 612 | while((tmpreg != 0) && (timeout-- > 0)) 613 | { 614 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 615 | } 616 | 617 | /* Auto refresh command */ 618 | #if defined(STM32F446xx) 619 | FMC_Bank5_6->SDCMR = 0x000000F3; 620 | #else 621 | FMC_Bank5_6->SDCMR = 0x00000073; 622 | #endif /* STM32F446xx */ 623 | timeout = 0xFFFF; 624 | while((tmpreg != 0) && (timeout-- > 0)) 625 | { 626 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 627 | } 628 | 629 | /* MRD register program */ 630 | #if defined(STM32F446xx) 631 | FMC_Bank5_6->SDCMR = 0x00044014; 632 | #else 633 | FMC_Bank5_6->SDCMR = 0x00046014; 634 | #endif /* STM32F446xx */ 635 | timeout = 0xFFFF; 636 | while((tmpreg != 0) && (timeout-- > 0)) 637 | { 638 | tmpreg = FMC_Bank5_6->SDSR & 0x00000020; 639 | } 640 | 641 | /* Set refresh count */ 642 | tmpreg = FMC_Bank5_6->SDRTR; 643 | #if defined(STM32F446xx) 644 | FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C<<1)); 645 | #else 646 | FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C<<1)); 647 | #endif /* STM32F446xx */ 648 | 649 | /* Disable write protection */ 650 | tmpreg = FMC_Bank5_6->SDCR[0]; 651 | FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); 652 | #endif /* DATA_IN_ExtSDRAM */ 653 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ 654 | 655 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx)\ 656 | || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)\ 657 | || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) 658 | 659 | #if defined(DATA_IN_ExtSRAM) 660 | /*-- GPIOs Configuration -----------------------------------------------------*/ 661 | /* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */ 662 | RCC->AHB1ENR |= 0x00000078; 663 | /* Delay after an RCC peripheral clock enabling */ 664 | tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); 665 | 666 | /* Connect PDx pins to FMC Alternate function */ 667 | GPIOD->AFR[0] = 0x00CCC0CC; 668 | GPIOD->AFR[1] = 0xCCCCCCCC; 669 | /* Configure PDx pins in Alternate function mode */ 670 | GPIOD->MODER = 0xAAAA0A8A; 671 | /* Configure PDx pins speed to 100 MHz */ 672 | GPIOD->OSPEEDR = 0xFFFF0FCF; 673 | /* Configure PDx pins Output type to push-pull */ 674 | GPIOD->OTYPER = 0x00000000; 675 | /* No pull-up, pull-down for PDx pins */ 676 | GPIOD->PUPDR = 0x00000000; 677 | 678 | /* Connect PEx pins to FMC Alternate function */ 679 | GPIOE->AFR[0] = 0xC00CC0CC; 680 | GPIOE->AFR[1] = 0xCCCCCCCC; 681 | /* Configure PEx pins in Alternate function mode */ 682 | GPIOE->MODER = 0xAAAA828A; 683 | /* Configure PEx pins speed to 100 MHz */ 684 | GPIOE->OSPEEDR = 0xFFFFC3CF; 685 | /* Configure PEx pins Output type to push-pull */ 686 | GPIOE->OTYPER = 0x00000000; 687 | /* No pull-up, pull-down for PEx pins */ 688 | GPIOE->PUPDR = 0x00000000; 689 | 690 | /* Connect PFx pins to FMC Alternate function */ 691 | GPIOF->AFR[0] = 0x00CCCCCC; 692 | GPIOF->AFR[1] = 0xCCCC0000; 693 | /* Configure PFx pins in Alternate function mode */ 694 | GPIOF->MODER = 0xAA000AAA; 695 | /* Configure PFx pins speed to 100 MHz */ 696 | GPIOF->OSPEEDR = 0xFF000FFF; 697 | /* Configure PFx pins Output type to push-pull */ 698 | GPIOF->OTYPER = 0x00000000; 699 | /* No pull-up, pull-down for PFx pins */ 700 | GPIOF->PUPDR = 0x00000000; 701 | 702 | /* Connect PGx pins to FMC Alternate function */ 703 | GPIOG->AFR[0] = 0x00CCCCCC; 704 | GPIOG->AFR[1] = 0x000000C0; 705 | /* Configure PGx pins in Alternate function mode */ 706 | GPIOG->MODER = 0x00085AAA; 707 | /* Configure PGx pins speed to 100 MHz */ 708 | GPIOG->OSPEEDR = 0x000CAFFF; 709 | /* Configure PGx pins Output type to push-pull */ 710 | GPIOG->OTYPER = 0x00000000; 711 | /* No pull-up, pull-down for PGx pins */ 712 | GPIOG->PUPDR = 0x00000000; 713 | 714 | /*-- FMC/FSMC Configuration --------------------------------------------------*/ 715 | /* Enable the FMC/FSMC interface clock */ 716 | RCC->AHB3ENR |= 0x00000001; 717 | 718 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) 719 | /* Delay after an RCC peripheral clock enabling */ 720 | tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); 721 | /* Configure and enable Bank1_SRAM2 */ 722 | FMC_Bank1->BTCR[2] = 0x00001011; 723 | FMC_Bank1->BTCR[3] = 0x00000201; 724 | FMC_Bank1E->BWTR[2] = 0x0fffffff; 725 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ 726 | #if defined(STM32F469xx) || defined(STM32F479xx) 727 | /* Delay after an RCC peripheral clock enabling */ 728 | tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); 729 | /* Configure and enable Bank1_SRAM2 */ 730 | FMC_Bank1->BTCR[2] = 0x00001091; 731 | FMC_Bank1->BTCR[3] = 0x00110212; 732 | FMC_Bank1E->BWTR[2] = 0x0fffffff; 733 | #endif /* STM32F469xx || STM32F479xx */ 734 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx)\ 735 | || defined(STM32F412Zx) || defined(STM32F412Vx) 736 | /* Delay after an RCC peripheral clock enabling */ 737 | tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); 738 | /* Configure and enable Bank1_SRAM2 */ 739 | FSMC_Bank1->BTCR[2] = 0x00001011; 740 | FSMC_Bank1->BTCR[3] = 0x00000201; 741 | FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; 742 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ 743 | 744 | #endif /* DATA_IN_ExtSRAM */ 745 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx ||\ 746 | STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ 747 | (void)(tmp); 748 | } 749 | #endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ 750 | /** 751 | * @} 752 | */ 753 | 754 | /** 755 | * @} 756 | */ 757 | 758 | /** 759 | * @} 760 | */ 761 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 762 | -------------------------------------------------------------------------------- /cubefix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Fix project after updating it with STM32CubeMX 4 | 5 | set -e 6 | 7 | cp Makefile.backup Makefile 8 | dos2unix Src/main.c 9 | sed -i -e '1,39d' Src/main.c 10 | -------------------------------------------------------------------------------- /img/image-to-mem.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # vim: set ai et ts=4 sw=4: 4 | 5 | from PIL import Image 6 | import sys 7 | import os 8 | 9 | if len(sys.argv) < 2: 10 | print("Usage: {} ".format(sys.argv[0])) 11 | sys.exit(1) 12 | 13 | fname = sys.argv[1] 14 | 15 | img = Image.open(fname) 16 | if img.width != 128 or img.height != 128: 17 | print("Error: 128x128 image expected"); 18 | sys.exit(2) 19 | 20 | print("const uint16_t test_img_128x128[][128] = {"); 21 | 22 | for y in range(0, img.height): 23 | s = "{" 24 | for x in range(0, img.width): 25 | (r, g, b) = img.getpixel( (x, y) ) 26 | color565 = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3) 27 | # for right endiness, so ST7735_DrawImage would work 28 | color565 = ((color565 & 0xFF00) >> 8) | ((color565 & 0xFF) << 8) 29 | s += "0x{:04X},".format(color565) 30 | s += "}," 31 | print(s) 32 | 33 | print("};") 34 | -------------------------------------------------------------------------------- /img/parrot_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/afiskon/stm32-st7735/b9408107226246a8494e6a729dfaeebfa0a75a5d/img/parrot_128x128.png -------------------------------------------------------------------------------- /main.ioc: -------------------------------------------------------------------------------- 1 | #MicroXplorer Configuration settings - do not modify 2 | File.Version=6 3 | KeepUserPlacement=true 4 | Mcu.Family=STM32F4 5 | Mcu.IP0=NVIC 6 | Mcu.IP1=RCC 7 | Mcu.IP2=SPI1 8 | Mcu.IP3=SYS 9 | Mcu.IP4=USART2 10 | Mcu.IPNb=5 11 | Mcu.Name=STM32F411R(C-E)Tx 12 | Mcu.Package=LQFP64 13 | Mcu.Pin0=PC13-ANTI_TAMP 14 | Mcu.Pin1=PC14-OSC32_IN 15 | Mcu.Pin10=PA9 16 | Mcu.Pin11=PA13 17 | Mcu.Pin12=PA14 18 | Mcu.Pin13=PB3 19 | Mcu.Pin14=PB6 20 | Mcu.Pin15=VP_SYS_VS_Systick 21 | Mcu.Pin2=PC15-OSC32_OUT 22 | Mcu.Pin3=PH0 - OSC_IN 23 | Mcu.Pin4=PH1 - OSC_OUT 24 | Mcu.Pin5=PA2 25 | Mcu.Pin6=PA3 26 | Mcu.Pin7=PA5 27 | Mcu.Pin8=PA7 28 | Mcu.Pin9=PC7 29 | Mcu.PinsNb=16 30 | Mcu.UserConstants= 31 | Mcu.UserName=STM32F411RETx 32 | MxCube.Version=4.23.0 33 | MxDb.Version=DB.4.0.230 34 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:false\:false 35 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:false\:false 36 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:false\:false 37 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:false\:false 38 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:false\:false 39 | NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:false\:false 40 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_0 41 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false 42 | NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:true 43 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:false\:false 44 | PA13.GPIOParameters=GPIO_Label 45 | PA13.GPIO_Label=TMS 46 | PA13.Locked=true 47 | PA13.Signal=SYS_JTMS-SWDIO 48 | PA14.GPIOParameters=GPIO_Label 49 | PA14.GPIO_Label=TCK 50 | PA14.Locked=true 51 | PA14.Signal=SYS_JTCK-SWCLK 52 | PA2.GPIOParameters=GPIO_Label 53 | PA2.GPIO_Label=USART_TX 54 | PA2.Locked=true 55 | PA2.Mode=Asynchronous 56 | PA2.Signal=USART2_TX 57 | PA3.GPIOParameters=GPIO_Label 58 | PA3.GPIO_Label=USART_RX 59 | PA3.Locked=true 60 | PA3.Mode=Asynchronous 61 | PA3.Signal=USART2_RX 62 | PA5.Mode=Simplex_Bidirectional_Master 63 | PA5.Signal=SPI1_SCK 64 | PA7.Mode=Simplex_Bidirectional_Master 65 | PA7.Signal=SPI1_MOSI 66 | PA9.Locked=true 67 | PA9.Signal=GPIO_Output 68 | PB3.GPIOParameters=GPIO_Label 69 | PB3.GPIO_Label=SWO 70 | PB3.Locked=true 71 | PB3.Signal=SYS_JTDO-SWO 72 | PB6.Locked=true 73 | PB6.Signal=GPIO_Output 74 | PC13-ANTI_TAMP.GPIOParameters=GPIO_Label,GPIO_ModeDefaultEXTI 75 | PC13-ANTI_TAMP.GPIO_Label=B1 [Blue PushButton] 76 | PC13-ANTI_TAMP.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING 77 | PC13-ANTI_TAMP.Locked=true 78 | PC13-ANTI_TAMP.Signal=GPXTI13 79 | PC14-OSC32_IN.Locked=true 80 | PC14-OSC32_IN.Signal=RCC_OSC32_IN 81 | PC15-OSC32_OUT.Locked=true 82 | PC15-OSC32_OUT.Signal=RCC_OSC32_OUT 83 | PC7.Locked=true 84 | PC7.Signal=GPIO_Output 85 | PCC.Checker=false 86 | PCC.Line=STM32F411 87 | PCC.MCU=STM32F411R(C-E)Tx 88 | PCC.PartNumber=STM32F411RETx 89 | PCC.Seq0=0 90 | PCC.Series=STM32F4 91 | PCC.Temperature=25 92 | PCC.Vdd=null 93 | PH0\ -\ OSC_IN.Locked=true 94 | PH0\ -\ OSC_IN.Signal=RCC_OSC_IN 95 | PH1\ -\ OSC_OUT.Locked=true 96 | PH1\ -\ OSC_OUT.Signal=RCC_OSC_OUT 97 | PinOutPanel.RotationAngle=0 98 | ProjectManager.AskForMigrate=true 99 | ProjectManager.BackupPrevious=false 100 | ProjectManager.CompilerOptimize=2 101 | ProjectManager.ComputerToolchain=false 102 | ProjectManager.CoupleFile=false 103 | ProjectManager.CustomerFirmwarePackage=/home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0 104 | ProjectManager.DefaultFWLocation=true 105 | ProjectManager.DeletePrevious=true 106 | ProjectManager.DeviceId=STM32F411RETx 107 | ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.18.0 108 | ProjectManager.FreePins=false 109 | ProjectManager.HalAssertFull=false 110 | ProjectManager.HeapSize=0x200 111 | ProjectManager.KeepUserCode=true 112 | ProjectManager.LastFirmware=true 113 | ProjectManager.LibraryCopy=2 114 | ProjectManager.PreviousToolchain= 115 | ProjectManager.ProjectBuild=false 116 | ProjectManager.ProjectFileName=main.ioc 117 | ProjectManager.ProjectName=main 118 | ProjectManager.StackSize=0x400 119 | ProjectManager.TargetToolchain=Makefile 120 | ProjectManager.ToolChainLocation= 121 | ProjectManager.UnderRoot=false 122 | ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL,2-SystemClock_Config-RCC-false-HAL,3-MX_SPI1_Init-SPI1-false-HAL,4-MX_USART2_UART_Init-USART2-false-HAL 123 | RCC.48MHZClocksFreq_Value=84000000 124 | RCC.AHBFreq_Value=84000000 125 | RCC.APB1CLKDivider=RCC_HCLK_DIV2 126 | RCC.APB1Freq_Value=42000000 127 | RCC.APB1TimFreq_Value=84000000 128 | RCC.APB2Freq_Value=84000000 129 | RCC.APB2TimFreq_Value=84000000 130 | RCC.CortexFreq_Value=84000000 131 | RCC.EthernetFreq_Value=84000000 132 | RCC.FCLKCortexFreq_Value=84000000 133 | RCC.FLatency-AdvancedSettings=FLASH_LATENCY_2 134 | RCC.FamilyName=M 135 | RCC.HCLKFreq_Value=84000000 136 | RCC.HSE_VALUE=8000000 137 | RCC.HSI_VALUE=16000000 138 | RCC.I2SClocksFreq_Value=96000000 139 | RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FLatency-AdvancedSettings,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLN,PLLP,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOInputMFreq_Value,VCOOutputFreq_Value,VcooutputI2S 140 | RCC.LSE_VALUE=32768 141 | RCC.LSI_VALUE=32000 142 | RCC.MCO2PinFreq_Value=84000000 143 | RCC.PLLCLKFreq_Value=84000000 144 | RCC.PLLN=336 145 | RCC.PLLP=RCC_PLLP_DIV4 146 | RCC.PLLQCLKFreq_Value=84000000 147 | RCC.RTCFreq_Value=32000 148 | RCC.RTCHSEDivFreq_Value=4000000 149 | RCC.SYSCLKFreq_VALUE=84000000 150 | RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK 151 | RCC.VCOI2SOutputFreq_Value=192000000 152 | RCC.VCOInputFreq_Value=1000000 153 | RCC.VCOInputMFreq_Value=1000000 154 | RCC.VCOOutputFreq_Value=336000000 155 | RCC.VcooutputI2S=96000000 156 | SH.GPXTI13.0=GPIO_EXTI13 157 | SH.GPXTI13.ConfNb=1 158 | SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2 159 | SPI1.CalculateBaudRate=42.0 MBits/s 160 | SPI1.Direction=SPI_DIRECTION_1LINE 161 | SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler 162 | SPI1.Mode=SPI_MODE_MASTER 163 | SPI1.VirtualType=VM_MASTER 164 | USART2.BaudRate=9600 165 | USART2.IPParameters=VirtualMode,BaudRate 166 | USART2.VirtualMode=VM_ASYNC 167 | VP_SYS_VS_Systick.Mode=SysTick 168 | VP_SYS_VS_Systick.Signal=SYS_VS_Systick 169 | board=NUCLEO-F411RE 170 | boardIOC=true 171 | -------------------------------------------------------------------------------- /mx.scratch: -------------------------------------------------------------------------------- 1 | 2 | 3 | /home/eax/projects/sandbox/stm32/stm32-st7735/\main 4 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/CMSIS 5 | /home/eax/STM32Cube/Repository//STM32Cube_FW_F4_V1.18.0/Drivers/CMSIS 6 | 7 | Makefile 8 | 0 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | main 26 | STM32F411RETx 27 | 0x200 28 | 0x400 29 | 30 | NUCLEO-F411RE 31 | 32 | true 33 | 34 | 35 | 0 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | USE_FULL_LL_DRIVER 54 | MBEDTLS_CONFIG_FILE="mbedtls_config.h" 55 | _TIMEVAL_DEFINED 56 | _SYS_TIME_H_ 57 | 58 | 59 | 60 | 61 | Inc 62 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Inc 63 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy 64 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/CMSIS/Device/ST/STM32F4xx/Include 65 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/CMSIS/Include 66 | 67 | 68 | 69 | 70 | 71 | false 72 | 73 | 74 | Drivers 75 | 76 | STM32F4xx_HAL_Driver 77 | 78 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c 79 | 80 | 81 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c 82 | 83 | 84 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c 85 | 86 | 87 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c 88 | 89 | 90 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c 91 | 92 | 93 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c 94 | 95 | 96 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c 97 | 98 | 99 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c 100 | 101 | 102 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c 103 | 104 | 105 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c 106 | 107 | 108 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c 109 | 110 | 111 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c 112 | 113 | 114 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c 115 | 116 | 117 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c 118 | 119 | 120 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c 121 | 122 | 123 | /home/eax/STM32Cube/Repository/STM32Cube_FW_F4_V1.18.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c 124 | 125 | 126 | 127 | CMSIS 128 | 129 | Src/system_stm32f4xx.c 130 | 131 | 132 | 133 | 134 | Application 135 | 136 | User 137 | 138 | Src/main.c 139 | 140 | 141 | 142 | Src/stm32f4xx_it.c 143 | 144 | 145 | 146 | Src/stm32f4xx_hal_msp.c 147 | 148 | 149 | 150 | 151 | 152 | Src 153 | 154 | main.c 155 | 156 | Src/main.c 157 | 158 | 159 | 160 | 161 | Src 162 | 163 | stm32f4xx_hal_msp.c 164 | 165 | Src/stm32f4xx_hal_msp.c 166 | 167 | 168 | 169 | 170 | Src 171 | 172 | stm32f4xx_it.c 173 | 174 | Src/stm32f4xx_it.c 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /st7735/fonts.c: -------------------------------------------------------------------------------- 1 | /* vim: set ai et ts=4 sw=4: */ 2 | #include "fonts.h" 3 | 4 | static const uint16_t Font7x10 [] = { 5 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // sp 6 | 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x1000, 0x0000, 0x0000, // ! 7 | 0x2800, 0x2800, 0x2800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // " 8 | 0x2400, 0x2400, 0x7C00, 0x2400, 0x4800, 0x7C00, 0x4800, 0x4800, 0x0000, 0x0000, // # 9 | 0x3800, 0x5400, 0x5000, 0x3800, 0x1400, 0x5400, 0x5400, 0x3800, 0x1000, 0x0000, // $ 10 | 0x2000, 0x5400, 0x5800, 0x3000, 0x2800, 0x5400, 0x1400, 0x0800, 0x0000, 0x0000, // % 11 | 0x1000, 0x2800, 0x2800, 0x1000, 0x3400, 0x4800, 0x4800, 0x3400, 0x0000, 0x0000, // & 12 | 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ' 13 | 0x0800, 0x1000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x1000, 0x0800, // ( 14 | 0x2000, 0x1000, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x1000, 0x2000, // ) 15 | 0x1000, 0x3800, 0x1000, 0x2800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // * 16 | 0x0000, 0x0000, 0x1000, 0x1000, 0x7C00, 0x1000, 0x1000, 0x0000, 0x0000, 0x0000, // + 17 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x1000, 0x1000, // , 18 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3800, 0x0000, 0x0000, 0x0000, 0x0000, // - 19 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, // . 20 | 0x0800, 0x0800, 0x1000, 0x1000, 0x1000, 0x1000, 0x2000, 0x2000, 0x0000, 0x0000, // / 21 | 0x3800, 0x4400, 0x4400, 0x5400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // 0 22 | 0x1000, 0x3000, 0x5000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // 1 23 | 0x3800, 0x4400, 0x4400, 0x0400, 0x0800, 0x1000, 0x2000, 0x7C00, 0x0000, 0x0000, // 2 24 | 0x3800, 0x4400, 0x0400, 0x1800, 0x0400, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // 3 25 | 0x0800, 0x1800, 0x2800, 0x2800, 0x4800, 0x7C00, 0x0800, 0x0800, 0x0000, 0x0000, // 4 26 | 0x7C00, 0x4000, 0x4000, 0x7800, 0x0400, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // 5 27 | 0x3800, 0x4400, 0x4000, 0x7800, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // 6 28 | 0x7C00, 0x0400, 0x0800, 0x1000, 0x1000, 0x2000, 0x2000, 0x2000, 0x0000, 0x0000, // 7 29 | 0x3800, 0x4400, 0x4400, 0x3800, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // 8 30 | 0x3800, 0x4400, 0x4400, 0x4400, 0x3C00, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // 9 31 | 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, // : 32 | 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000, 0x1000, 0x1000, 0x1000, // ; 33 | 0x0000, 0x0000, 0x0C00, 0x3000, 0x4000, 0x3000, 0x0C00, 0x0000, 0x0000, 0x0000, // < 34 | 0x0000, 0x0000, 0x0000, 0x7C00, 0x0000, 0x7C00, 0x0000, 0x0000, 0x0000, 0x0000, // = 35 | 0x0000, 0x0000, 0x6000, 0x1800, 0x0400, 0x1800, 0x6000, 0x0000, 0x0000, 0x0000, // > 36 | 0x3800, 0x4400, 0x0400, 0x0800, 0x1000, 0x1000, 0x0000, 0x1000, 0x0000, 0x0000, // ? 37 | 0x3800, 0x4400, 0x4C00, 0x5400, 0x5C00, 0x4000, 0x4000, 0x3800, 0x0000, 0x0000, // @ 38 | 0x1000, 0x2800, 0x2800, 0x2800, 0x2800, 0x7C00, 0x4400, 0x4400, 0x0000, 0x0000, // A 39 | 0x7800, 0x4400, 0x4400, 0x7800, 0x4400, 0x4400, 0x4400, 0x7800, 0x0000, 0x0000, // B 40 | 0x3800, 0x4400, 0x4000, 0x4000, 0x4000, 0x4000, 0x4400, 0x3800, 0x0000, 0x0000, // C 41 | 0x7000, 0x4800, 0x4400, 0x4400, 0x4400, 0x4400, 0x4800, 0x7000, 0x0000, 0x0000, // D 42 | 0x7C00, 0x4000, 0x4000, 0x7C00, 0x4000, 0x4000, 0x4000, 0x7C00, 0x0000, 0x0000, // E 43 | 0x7C00, 0x4000, 0x4000, 0x7800, 0x4000, 0x4000, 0x4000, 0x4000, 0x0000, 0x0000, // F 44 | 0x3800, 0x4400, 0x4000, 0x4000, 0x5C00, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // G 45 | 0x4400, 0x4400, 0x4400, 0x7C00, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // H 46 | 0x3800, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x3800, 0x0000, 0x0000, // I 47 | 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // J 48 | 0x4400, 0x4800, 0x5000, 0x6000, 0x5000, 0x4800, 0x4800, 0x4400, 0x0000, 0x0000, // K 49 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x7C00, 0x0000, 0x0000, // L 50 | 0x4400, 0x6C00, 0x6C00, 0x5400, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // M 51 | 0x4400, 0x6400, 0x6400, 0x5400, 0x5400, 0x4C00, 0x4C00, 0x4400, 0x0000, 0x0000, // N 52 | 0x3800, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // O 53 | 0x7800, 0x4400, 0x4400, 0x4400, 0x7800, 0x4000, 0x4000, 0x4000, 0x0000, 0x0000, // P 54 | 0x3800, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x5400, 0x3800, 0x0400, 0x0000, // Q 55 | 0x7800, 0x4400, 0x4400, 0x4400, 0x7800, 0x4800, 0x4800, 0x4400, 0x0000, 0x0000, // R 56 | 0x3800, 0x4400, 0x4000, 0x3000, 0x0800, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // S 57 | 0x7C00, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // T 58 | 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // U 59 | 0x4400, 0x4400, 0x4400, 0x2800, 0x2800, 0x2800, 0x1000, 0x1000, 0x0000, 0x0000, // V 60 | 0x4400, 0x4400, 0x5400, 0x5400, 0x5400, 0x6C00, 0x2800, 0x2800, 0x0000, 0x0000, // W 61 | 0x4400, 0x2800, 0x2800, 0x1000, 0x1000, 0x2800, 0x2800, 0x4400, 0x0000, 0x0000, // X 62 | 0x4400, 0x4400, 0x2800, 0x2800, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // Y 63 | 0x7C00, 0x0400, 0x0800, 0x1000, 0x1000, 0x2000, 0x4000, 0x7C00, 0x0000, 0x0000, // Z 64 | 0x1800, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1800, // [ 65 | 0x2000, 0x2000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0800, 0x0800, 0x0000, 0x0000, /* \ */ 66 | 0x3000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x3000, // ] 67 | 0x1000, 0x2800, 0x2800, 0x4400, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ^ 68 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFE00, // _ 69 | 0x2000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ` 70 | 0x0000, 0x0000, 0x3800, 0x4400, 0x3C00, 0x4400, 0x4C00, 0x3400, 0x0000, 0x0000, // a 71 | 0x4000, 0x4000, 0x5800, 0x6400, 0x4400, 0x4400, 0x6400, 0x5800, 0x0000, 0x0000, // b 72 | 0x0000, 0x0000, 0x3800, 0x4400, 0x4000, 0x4000, 0x4400, 0x3800, 0x0000, 0x0000, // c 73 | 0x0400, 0x0400, 0x3400, 0x4C00, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0000, 0x0000, // d 74 | 0x0000, 0x0000, 0x3800, 0x4400, 0x7C00, 0x4000, 0x4400, 0x3800, 0x0000, 0x0000, // e 75 | 0x0C00, 0x1000, 0x7C00, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // f 76 | 0x0000, 0x0000, 0x3400, 0x4C00, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0400, 0x7800, // g 77 | 0x4000, 0x4000, 0x5800, 0x6400, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // h 78 | 0x1000, 0x0000, 0x7000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // i 79 | 0x1000, 0x0000, 0x7000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0xE000, // j 80 | 0x4000, 0x4000, 0x4800, 0x5000, 0x6000, 0x5000, 0x4800, 0x4400, 0x0000, 0x0000, // k 81 | 0x7000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // l 82 | 0x0000, 0x0000, 0x7800, 0x5400, 0x5400, 0x5400, 0x5400, 0x5400, 0x0000, 0x0000, // m 83 | 0x0000, 0x0000, 0x5800, 0x6400, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // n 84 | 0x0000, 0x0000, 0x3800, 0x4400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // o 85 | 0x0000, 0x0000, 0x5800, 0x6400, 0x4400, 0x4400, 0x6400, 0x5800, 0x4000, 0x4000, // p 86 | 0x0000, 0x0000, 0x3400, 0x4C00, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0400, 0x0400, // q 87 | 0x0000, 0x0000, 0x5800, 0x6400, 0x4000, 0x4000, 0x4000, 0x4000, 0x0000, 0x0000, // r 88 | 0x0000, 0x0000, 0x3800, 0x4400, 0x3000, 0x0800, 0x4400, 0x3800, 0x0000, 0x0000, // s 89 | 0x2000, 0x2000, 0x7800, 0x2000, 0x2000, 0x2000, 0x2000, 0x1800, 0x0000, 0x0000, // t 90 | 0x0000, 0x0000, 0x4400, 0x4400, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0000, 0x0000, // u 91 | 0x0000, 0x0000, 0x4400, 0x4400, 0x2800, 0x2800, 0x2800, 0x1000, 0x0000, 0x0000, // v 92 | 0x0000, 0x0000, 0x5400, 0x5400, 0x5400, 0x6C00, 0x2800, 0x2800, 0x0000, 0x0000, // w 93 | 0x0000, 0x0000, 0x4400, 0x2800, 0x1000, 0x1000, 0x2800, 0x4400, 0x0000, 0x0000, // x 94 | 0x0000, 0x0000, 0x4400, 0x4400, 0x2800, 0x2800, 0x1000, 0x1000, 0x1000, 0x6000, // y 95 | 0x0000, 0x0000, 0x7C00, 0x0800, 0x1000, 0x2000, 0x4000, 0x7C00, 0x0000, 0x0000, // z 96 | 0x1800, 0x1000, 0x1000, 0x1000, 0x2000, 0x2000, 0x1000, 0x1000, 0x1000, 0x1800, // { 97 | 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, // | 98 | 0x3000, 0x1000, 0x1000, 0x1000, 0x0800, 0x0800, 0x1000, 0x1000, 0x1000, 0x3000, // } 99 | 0x0000, 0x0000, 0x0000, 0x7400, 0x4C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ~ 100 | }; 101 | 102 | static const uint16_t Font11x18 [] = { 103 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // sp 104 | 0x0000, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // ! 105 | 0x0000, 0x1B00, 0x1B00, 0x1B00, 0x1B00, 0x1B00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // " 106 | 0x0000, 0x1980, 0x1980, 0x1980, 0x1980, 0x7FC0, 0x7FC0, 0x1980, 0x3300, 0x7FC0, 0x7FC0, 0x3300, 0x3300, 0x3300, 0x3300, 0x0000, 0x0000, 0x0000, // # 107 | 0x0000, 0x1E00, 0x3F00, 0x7580, 0x6580, 0x7400, 0x3C00, 0x1E00, 0x0700, 0x0580, 0x6580, 0x6580, 0x7580, 0x3F00, 0x1E00, 0x0400, 0x0400, 0x0000, // $ 108 | 0x0000, 0x7000, 0xD800, 0xD840, 0xD8C0, 0xD980, 0x7300, 0x0600, 0x0C00, 0x1B80, 0x36C0, 0x66C0, 0x46C0, 0x06C0, 0x0380, 0x0000, 0x0000, 0x0000, // % 109 | 0x0000, 0x1E00, 0x3F00, 0x3300, 0x3300, 0x3300, 0x1E00, 0x0C00, 0x3CC0, 0x66C0, 0x6380, 0x6180, 0x6380, 0x3EC0, 0x1C80, 0x0000, 0x0000, 0x0000, // & 110 | 0x0000, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ' 111 | 0x0080, 0x0100, 0x0300, 0x0600, 0x0600, 0x0400, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0400, 0x0600, 0x0600, 0x0300, 0x0100, 0x0080, // ( 112 | 0x2000, 0x1000, 0x1800, 0x0C00, 0x0C00, 0x0400, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0400, 0x0C00, 0x0C00, 0x1800, 0x1000, 0x2000, // ) 113 | 0x0000, 0x0C00, 0x2D00, 0x3F00, 0x1E00, 0x3300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // * 114 | 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0xFFC0, 0xFFC0, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // + 115 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0400, 0x0400, 0x0800, // , 116 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x1E00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // - 117 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // . 118 | 0x0000, 0x0300, 0x0300, 0x0300, 0x0600, 0x0600, 0x0600, 0x0600, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x1800, 0x1800, 0x1800, 0x0000, 0x0000, 0x0000, // / 119 | 0x0000, 0x1E00, 0x3F00, 0x3300, 0x6180, 0x6180, 0x6180, 0x6D80, 0x6D80, 0x6180, 0x6180, 0x6180, 0x3300, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 0 120 | 0x0000, 0x0600, 0x0E00, 0x1E00, 0x3600, 0x2600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // 1 121 | 0x0000, 0x1E00, 0x3F00, 0x7380, 0x6180, 0x6180, 0x0180, 0x0300, 0x0600, 0x0C00, 0x1800, 0x3000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // 2 122 | 0x0000, 0x1C00, 0x3E00, 0x6300, 0x6300, 0x0300, 0x0E00, 0x0E00, 0x0300, 0x0180, 0x0180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 3 123 | 0x0000, 0x0600, 0x0E00, 0x0E00, 0x1E00, 0x1E00, 0x1600, 0x3600, 0x3600, 0x6600, 0x7F80, 0x7F80, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // 4 124 | 0x0000, 0x7F00, 0x7F00, 0x6000, 0x6000, 0x6000, 0x6E00, 0x7F00, 0x6380, 0x0180, 0x0180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 5 125 | 0x0000, 0x1E00, 0x3F00, 0x3380, 0x6180, 0x6000, 0x6E00, 0x7F00, 0x7380, 0x6180, 0x6180, 0x6180, 0x3380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 6 126 | 0x0000, 0x7F80, 0x7F80, 0x0180, 0x0300, 0x0300, 0x0600, 0x0600, 0x0C00, 0x0C00, 0x0C00, 0x0800, 0x1800, 0x1800, 0x1800, 0x0000, 0x0000, 0x0000, // 7 127 | 0x0000, 0x1E00, 0x3F00, 0x6380, 0x6180, 0x6180, 0x2100, 0x1E00, 0x3F00, 0x6180, 0x6180, 0x6180, 0x6180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 8 128 | 0x0000, 0x1E00, 0x3F00, 0x7300, 0x6180, 0x6180, 0x6180, 0x7380, 0x3F80, 0x1D80, 0x0180, 0x6180, 0x7300, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 9 129 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // : 130 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0400, 0x0400, 0x0800, // ; 131 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0380, 0x0E00, 0x3800, 0x6000, 0x3800, 0x0E00, 0x0380, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // < 132 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // = 133 | 0x0000, 0x0000, 0x0000, 0x0000, 0x4000, 0x7000, 0x1C00, 0x0700, 0x0180, 0x0700, 0x1C00, 0x7000, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // > 134 | 0x0000, 0x1F00, 0x3F80, 0x71C0, 0x60C0, 0x00C0, 0x01C0, 0x0380, 0x0700, 0x0E00, 0x0C00, 0x0C00, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // ? 135 | 0x0000, 0x1E00, 0x3F00, 0x3180, 0x7180, 0x6380, 0x6F80, 0x6D80, 0x6D80, 0x6F80, 0x6780, 0x6000, 0x3200, 0x3E00, 0x1C00, 0x0000, 0x0000, 0x0000, // @ 136 | 0x0000, 0x0E00, 0x0E00, 0x1B00, 0x1B00, 0x1B00, 0x1B00, 0x3180, 0x3180, 0x3F80, 0x3F80, 0x3180, 0x60C0, 0x60C0, 0x60C0, 0x0000, 0x0000, 0x0000, // A 137 | 0x0000, 0x7C00, 0x7E00, 0x6300, 0x6300, 0x6300, 0x6300, 0x7E00, 0x7E00, 0x6300, 0x6180, 0x6180, 0x6380, 0x7F00, 0x7E00, 0x0000, 0x0000, 0x0000, // B 138 | 0x0000, 0x1E00, 0x3F00, 0x3180, 0x6180, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6180, 0x3180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // C 139 | 0x0000, 0x7C00, 0x7F00, 0x6300, 0x6380, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6300, 0x6300, 0x7E00, 0x7C00, 0x0000, 0x0000, 0x0000, // D 140 | 0x0000, 0x7F80, 0x7F80, 0x6000, 0x6000, 0x6000, 0x6000, 0x7F00, 0x7F00, 0x6000, 0x6000, 0x6000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // E 141 | 0x0000, 0x7F80, 0x7F80, 0x6000, 0x6000, 0x6000, 0x6000, 0x7F00, 0x7F00, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x0000, 0x0000, 0x0000, // F 142 | 0x0000, 0x1E00, 0x3F00, 0x3180, 0x6180, 0x6000, 0x6000, 0x6000, 0x6380, 0x6380, 0x6180, 0x6180, 0x3180, 0x3F80, 0x1E00, 0x0000, 0x0000, 0x0000, // G 143 | 0x0000, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x7F80, 0x7F80, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // H 144 | 0x0000, 0x3F00, 0x3F00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x3F00, 0x3F00, 0x0000, 0x0000, 0x0000, // I 145 | 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x6180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // J 146 | 0x0000, 0x60C0, 0x6180, 0x6300, 0x6600, 0x6600, 0x6C00, 0x7800, 0x7C00, 0x6600, 0x6600, 0x6300, 0x6180, 0x6180, 0x60C0, 0x0000, 0x0000, 0x0000, // K 147 | 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // L 148 | 0x0000, 0x71C0, 0x71C0, 0x7BC0, 0x7AC0, 0x6AC0, 0x6AC0, 0x6EC0, 0x64C0, 0x60C0, 0x60C0, 0x60C0, 0x60C0, 0x60C0, 0x60C0, 0x0000, 0x0000, 0x0000, // M 149 | 0x0000, 0x7180, 0x7180, 0x7980, 0x7980, 0x7980, 0x6D80, 0x6D80, 0x6D80, 0x6580, 0x6780, 0x6780, 0x6780, 0x6380, 0x6380, 0x0000, 0x0000, 0x0000, // N 150 | 0x0000, 0x1E00, 0x3F00, 0x3300, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x3300, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // O 151 | 0x0000, 0x7E00, 0x7F00, 0x6380, 0x6180, 0x6180, 0x6180, 0x6380, 0x7F00, 0x7E00, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x0000, 0x0000, 0x0000, // P 152 | 0x0000, 0x1E00, 0x3F00, 0x3300, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6580, 0x6780, 0x3300, 0x3F80, 0x1E40, 0x0000, 0x0000, 0x0000, // Q 153 | 0x0000, 0x7E00, 0x7F00, 0x6380, 0x6180, 0x6180, 0x6380, 0x7F00, 0x7E00, 0x6600, 0x6300, 0x6300, 0x6180, 0x6180, 0x60C0, 0x0000, 0x0000, 0x0000, // R 154 | 0x0000, 0x0E00, 0x1F00, 0x3180, 0x3180, 0x3000, 0x3800, 0x1E00, 0x0700, 0x0380, 0x6180, 0x6180, 0x3180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // S 155 | 0x0000, 0xFFC0, 0xFFC0, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // T 156 | 0x0000, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // U 157 | 0x0000, 0x60C0, 0x60C0, 0x60C0, 0x3180, 0x3180, 0x3180, 0x1B00, 0x1B00, 0x1B00, 0x1B00, 0x0E00, 0x0E00, 0x0E00, 0x0400, 0x0000, 0x0000, 0x0000, // V 158 | 0x0000, 0xC0C0, 0xC0C0, 0xC0C0, 0xC0C0, 0xC0C0, 0xCCC0, 0x4C80, 0x4C80, 0x5E80, 0x5280, 0x5280, 0x7380, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // W 159 | 0x0000, 0xC0C0, 0x6080, 0x6180, 0x3300, 0x3B00, 0x1E00, 0x0C00, 0x0C00, 0x1E00, 0x1F00, 0x3B00, 0x7180, 0x6180, 0xC0C0, 0x0000, 0x0000, 0x0000, // X 160 | 0x0000, 0xC0C0, 0x6180, 0x6180, 0x3300, 0x3300, 0x1E00, 0x1E00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // Y 161 | 0x0000, 0x3F80, 0x3F80, 0x0180, 0x0300, 0x0300, 0x0600, 0x0C00, 0x0C00, 0x1800, 0x1800, 0x3000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // Z 162 | 0x0F00, 0x0F00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0F00, 0x0F00, // [ 163 | 0x0000, 0x1800, 0x1800, 0x1800, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, 0x0300, 0x0000, 0x0000, 0x0000, /* \ */ 164 | 0x1E00, 0x1E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x1E00, 0x1E00, // ] 165 | 0x0000, 0x0C00, 0x0C00, 0x1E00, 0x1200, 0x3300, 0x3300, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ^ 166 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFE0, 0x0000, // _ 167 | 0x0000, 0x3800, 0x1800, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ` 168 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F00, 0x3F80, 0x6180, 0x0180, 0x1F80, 0x3F80, 0x6180, 0x6380, 0x7F80, 0x38C0, 0x0000, 0x0000, 0x0000, // a 169 | 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6E00, 0x7F00, 0x7380, 0x6180, 0x6180, 0x6180, 0x6180, 0x7380, 0x7F00, 0x6E00, 0x0000, 0x0000, 0x0000, // b 170 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F00, 0x7380, 0x6180, 0x6000, 0x6000, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // c 171 | 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x1D80, 0x3F80, 0x7380, 0x6180, 0x6180, 0x6180, 0x6180, 0x7380, 0x3F80, 0x1D80, 0x0000, 0x0000, 0x0000, // d 172 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F00, 0x7300, 0x6180, 0x7F80, 0x7F80, 0x6000, 0x7180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // e 173 | 0x0000, 0x07C0, 0x0FC0, 0x0C00, 0x0C00, 0x7F80, 0x7F80, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // f 174 | 0x0000, 0x0000, 0x0000, 0x0000, 0x1D80, 0x3F80, 0x7380, 0x6180, 0x6180, 0x6180, 0x6180, 0x7380, 0x3F80, 0x1D80, 0x0180, 0x6380, 0x7F00, 0x3E00, // g 175 | 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6F00, 0x7F80, 0x7180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // h 176 | 0x0000, 0x0600, 0x0600, 0x0000, 0x0000, 0x3E00, 0x3E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // i 177 | 0x0600, 0x0600, 0x0000, 0x0000, 0x3E00, 0x3E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x4600, 0x7E00, 0x3C00, // j 178 | 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6180, 0x6300, 0x6600, 0x6C00, 0x7C00, 0x7600, 0x6300, 0x6300, 0x6180, 0x60C0, 0x0000, 0x0000, 0x0000, // k 179 | 0x0000, 0x3E00, 0x3E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // l 180 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xDD80, 0xFFC0, 0xCEC0, 0xCCC0, 0xCCC0, 0xCCC0, 0xCCC0, 0xCCC0, 0xCCC0, 0xCCC0, 0x0000, 0x0000, 0x0000, // m 181 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6F00, 0x7F80, 0x7180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // n 182 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F00, 0x7380, 0x6180, 0x6180, 0x6180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // o 183 | 0x0000, 0x0000, 0x0000, 0x0000, 0x6E00, 0x7F00, 0x7380, 0x6180, 0x6180, 0x6180, 0x6180, 0x7380, 0x7F00, 0x6E00, 0x6000, 0x6000, 0x6000, 0x6000, // p 184 | 0x0000, 0x0000, 0x0000, 0x0000, 0x1D80, 0x3F80, 0x7380, 0x6180, 0x6180, 0x6180, 0x6180, 0x7380, 0x3F80, 0x1D80, 0x0180, 0x0180, 0x0180, 0x0180, // q 185 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6700, 0x3F80, 0x3900, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x0000, 0x0000, 0x0000, // r 186 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F80, 0x6180, 0x6000, 0x7F00, 0x3F80, 0x0180, 0x6180, 0x7F00, 0x1E00, 0x0000, 0x0000, 0x0000, // s 187 | 0x0000, 0x0000, 0x0800, 0x1800, 0x1800, 0x7F00, 0x7F00, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1800, 0x1F80, 0x0F80, 0x0000, 0x0000, 0x0000, // t 188 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6380, 0x7F80, 0x3D80, 0x0000, 0x0000, 0x0000, // u 189 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x60C0, 0x3180, 0x3180, 0x3180, 0x1B00, 0x1B00, 0x1B00, 0x0E00, 0x0E00, 0x0600, 0x0000, 0x0000, 0x0000, // v 190 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xDD80, 0xDD80, 0xDD80, 0x5500, 0x5500, 0x5500, 0x7700, 0x7700, 0x2200, 0x2200, 0x0000, 0x0000, 0x0000, // w 191 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6180, 0x3300, 0x3300, 0x1E00, 0x0C00, 0x0C00, 0x1E00, 0x3300, 0x3300, 0x6180, 0x0000, 0x0000, 0x0000, // x 192 | 0x0000, 0x0000, 0x0000, 0x0000, 0x6180, 0x6180, 0x3180, 0x3300, 0x3300, 0x1B00, 0x1B00, 0x1B00, 0x0E00, 0x0E00, 0x0E00, 0x1C00, 0x7C00, 0x7000, // y 193 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7FC0, 0x7FC0, 0x0180, 0x0300, 0x0600, 0x0C00, 0x1800, 0x3000, 0x7FC0, 0x7FC0, 0x0000, 0x0000, 0x0000, // z 194 | 0x0380, 0x0780, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0E00, 0x1C00, 0x1C00, 0x0E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0780, 0x0380, // { 195 | 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, // | 196 | 0x3800, 0x3C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0E00, 0x0700, 0x0700, 0x0E00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x3C00, 0x3800, // } 197 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3880, 0x7F80, 0x4700, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ~ 198 | }; 199 | 200 | static const uint16_t Font16x26 [] = { 201 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [ ] 202 | 0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03C0,0x03C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x0000,0x0000,0x0000,0x03E0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [!] 203 | 0x1E3C,0x1E3C,0x1E3C,0x1E3C,0x1E3C,0x1E3C,0x1E3C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = ["] 204 | 0x01CE,0x03CE,0x03DE,0x039E,0x039C,0x079C,0x3FFF,0x7FFF,0x0738,0x0F38,0x0F78,0x0F78,0x0E78,0xFFFF,0xFFFF,0x1EF0,0x1CF0,0x1CE0,0x3CE0,0x3DE0,0x39E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [#] 205 | 0x03FC,0x0FFE,0x1FEE,0x1EE0,0x1EE0,0x1EE0,0x1EE0,0x1FE0,0x0FE0,0x07E0,0x03F0,0x01FC,0x01FE,0x01FE,0x01FE,0x01FE,0x01FE,0x01FE,0x3DFE,0x3FFC,0x0FF0,0x01E0,0x01E0,0x0000,0x0000,0x0000, // Ascii = [$] 206 | 0x3E03,0xF707,0xE78F,0xE78E,0xE39E,0xE3BC,0xE7B8,0xE7F8,0xF7F0,0x3FE0,0x01C0,0x03FF,0x07FF,0x07F3,0x0FF3,0x1EF3,0x3CF3,0x38F3,0x78F3,0xF07F,0xE03F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [%] 207 | 0x07E0,0x0FF8,0x0F78,0x1F78,0x1F78,0x1F78,0x0F78,0x0FF0,0x0FE0,0x1F80,0x7FC3,0xFBC3,0xF3E7,0xF1F7,0xF0F7,0xF0FF,0xF07F,0xF83E,0x7C7F,0x3FFF,0x1FEF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [&] 208 | 0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03C0,0x01C0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = ['] 209 | 0x003F,0x007C,0x01F0,0x01E0,0x03C0,0x07C0,0x0780,0x0780,0x0F80,0x0F00,0x0F00,0x0F00,0x0F00,0x0F00,0x0F00,0x0F80,0x0780,0x0780,0x07C0,0x03C0,0x01E0,0x01F0,0x007C,0x003F,0x000F,0x0000, // Ascii = [(] 210 | 0x7E00,0x1F00,0x07C0,0x03C0,0x01E0,0x01F0,0x00F0,0x00F0,0x00F8,0x0078,0x0078,0x0078,0x0078,0x0078,0x0078,0x00F8,0x00F0,0x00F0,0x01F0,0x01E0,0x03C0,0x07C0,0x1F00,0x7E00,0x7800,0x0000, // Ascii = [)] 211 | 0x03E0,0x03C0,0x01C0,0x39CE,0x3FFF,0x3F7F,0x0320,0x0370,0x07F8,0x0F78,0x1F3C,0x0638,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [*] 212 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0xFFFF,0xFFFF,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [+] 213 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03E0,0x03E0,0x03E0,0x03E0,0x01E0,0x01E0,0x01E0,0x01C0,0x0380, // Ascii = [,] 214 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3FFE,0x3FFE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [-] 215 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03E0,0x03E0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [.] 216 | 0x000F,0x000F,0x001E,0x001E,0x003C,0x003C,0x0078,0x0078,0x00F0,0x00F0,0x01E0,0x01E0,0x03C0,0x03C0,0x0780,0x0780,0x0F00,0x0F00,0x1E00,0x1E00,0x3C00,0x3C00,0x7800,0x7800,0xF000,0x0000, // Ascii = [/] 217 | 0x07F0,0x0FF8,0x1F7C,0x3E3E,0x3C1E,0x7C1F,0x7C1F,0x780F,0x780F,0x780F,0x780F,0x780F,0x780F,0x780F,0x7C1F,0x7C1F,0x3C1E,0x3E3E,0x1F7C,0x0FF8,0x07F0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [0] 218 | 0x00F0,0x07F0,0x3FF0,0x3FF0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x3FFF,0x3FFF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [1] 219 | 0x0FE0,0x3FF8,0x3C7C,0x003C,0x003E,0x003E,0x003E,0x003C,0x003C,0x007C,0x00F8,0x01F0,0x03E0,0x07C0,0x0780,0x0F00,0x1E00,0x3E00,0x3C00,0x3FFE,0x3FFE,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [2] 220 | 0x0FF0,0x1FF8,0x1C7C,0x003E,0x003E,0x003E,0x003C,0x003C,0x00F8,0x0FF0,0x0FF8,0x007C,0x003E,0x001E,0x001E,0x001E,0x001E,0x003E,0x1C7C,0x1FF8,0x1FE0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [3] 221 | 0x0078,0x00F8,0x00F8,0x01F8,0x03F8,0x07F8,0x07F8,0x0F78,0x1E78,0x1E78,0x3C78,0x7878,0x7878,0xFFFF,0xFFFF,0x0078,0x0078,0x0078,0x0078,0x0078,0x0078,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [4] 222 | 0x1FFC,0x1FFC,0x1FFC,0x1E00,0x1E00,0x1E00,0x1E00,0x1E00,0x1FE0,0x1FF8,0x00FC,0x007C,0x003E,0x003E,0x001E,0x003E,0x003E,0x003C,0x1C7C,0x1FF8,0x1FE0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [5] 223 | 0x01FC,0x07FE,0x0F8E,0x1F00,0x1E00,0x3E00,0x3C00,0x3C00,0x3DF8,0x3FFC,0x7F3E,0x7E1F,0x3C0F,0x3C0F,0x3C0F,0x3C0F,0x3E0F,0x1E1F,0x1F3E,0x0FFC,0x03F0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [6] 224 | 0x3FFF,0x3FFF,0x3FFF,0x000F,0x001E,0x001E,0x003C,0x0038,0x0078,0x00F0,0x00F0,0x01E0,0x01E0,0x03C0,0x03C0,0x0780,0x0F80,0x0F80,0x0F00,0x1F00,0x1F00,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [7] 225 | 0x07F8,0x0FFC,0x1F3E,0x1E1E,0x3E1E,0x3E1E,0x1E1E,0x1F3C,0x0FF8,0x07F0,0x0FF8,0x1EFC,0x3E3E,0x3C1F,0x7C1F,0x7C0F,0x7C0F,0x3C1F,0x3F3E,0x1FFC,0x07F0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [8] 226 | 0x07F0,0x0FF8,0x1E7C,0x3C3E,0x3C1E,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x3C1F,0x3E3F,0x1FFF,0x07EF,0x001F,0x001E,0x001E,0x003E,0x003C,0x38F8,0x3FF0,0x1FE0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [9] 227 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03E0,0x03E0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03E0,0x03E0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [:] 228 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03E0,0x03E0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03E0,0x03E0,0x03E0,0x03E0,0x01E0,0x01E0,0x01E0,0x03C0,0x0380, // Ascii = [;] 229 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0003,0x000F,0x003F,0x00FC,0x03F0,0x0FC0,0x3F00,0xFE00,0x3F00,0x0FC0,0x03F0,0x00FC,0x003F,0x000F,0x0003,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [<] 230 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xFFFF,0xFFFF,0x0000,0x0000,0x0000,0xFFFF,0xFFFF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [=] 231 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xE000,0xF800,0x7E00,0x1F80,0x07E0,0x01F8,0x007E,0x001F,0x007E,0x01F8,0x07E0,0x1F80,0x7E00,0xF800,0xE000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [>] 232 | 0x1FF0,0x3FFC,0x383E,0x381F,0x381F,0x001E,0x001E,0x003C,0x0078,0x00F0,0x01E0,0x03C0,0x03C0,0x07C0,0x07C0,0x0000,0x0000,0x0000,0x07C0,0x07C0,0x07C0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [?] 233 | 0x03F8,0x0FFE,0x1F1E,0x3E0F,0x3C7F,0x78FF,0x79EF,0x73C7,0xF3C7,0xF38F,0xF38F,0xF38F,0xF39F,0xF39F,0x73FF,0x7BFF,0x79F7,0x3C00,0x1F1C,0x0FFC,0x03F8,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [@] 234 | 0x0000,0x0000,0x0000,0x03E0,0x03E0,0x07F0,0x07F0,0x07F0,0x0F78,0x0F78,0x0E7C,0x1E3C,0x1E3C,0x3C3E,0x3FFE,0x3FFF,0x781F,0x780F,0xF00F,0xF007,0xF007,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [A] 235 | 0x0000,0x0000,0x0000,0x3FF8,0x3FFC,0x3C3E,0x3C1E,0x3C1E,0x3C1E,0x3C3E,0x3C7C,0x3FF0,0x3FF8,0x3C7E,0x3C1F,0x3C1F,0x3C0F,0x3C0F,0x3C1F,0x3FFE,0x3FF8,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [B] 236 | 0x0000,0x0000,0x0000,0x01FF,0x07FF,0x1F87,0x3E00,0x3C00,0x7C00,0x7800,0x7800,0x7800,0x7800,0x7800,0x7C00,0x7C00,0x3E00,0x3F00,0x1F83,0x07FF,0x01FF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [C] 237 | 0x0000,0x0000,0x0000,0x7FF0,0x7FFC,0x787E,0x781F,0x781F,0x780F,0x780F,0x780F,0x780F,0x780F,0x780F,0x780F,0x780F,0x781F,0x781E,0x787E,0x7FF8,0x7FE0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [D] 238 | 0x0000,0x0000,0x0000,0x3FFF,0x3FFF,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3FFE,0x3FFE,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3FFF,0x3FFF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [E] 239 | 0x0000,0x0000,0x0000,0x1FFF,0x1FFF,0x1E00,0x1E00,0x1E00,0x1E00,0x1E00,0x1E00,0x1FFF,0x1FFF,0x1E00,0x1E00,0x1E00,0x1E00,0x1E00,0x1E00,0x1E00,0x1E00,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [F] 240 | 0x0000,0x0000,0x0000,0x03FE,0x0FFF,0x1F87,0x3E00,0x7C00,0x7C00,0x7800,0xF800,0xF800,0xF87F,0xF87F,0x780F,0x7C0F,0x7C0F,0x3E0F,0x1F8F,0x0FFF,0x03FE,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [G] 241 | 0x0000,0x0000,0x0000,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7FFF,0x7FFF,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x7C1F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [H] 242 | 0x0000,0x0000,0x0000,0x3FFF,0x3FFF,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x3FFF,0x3FFF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [I] 243 | 0x0000,0x0000,0x0000,0x1FFC,0x1FFC,0x007C,0x007C,0x007C,0x007C,0x007C,0x007C,0x007C,0x007C,0x007C,0x007C,0x007C,0x0078,0x0078,0x38F8,0x3FF0,0x3FC0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [J] 244 | 0x0000,0x0000,0x0000,0x3C1F,0x3C1E,0x3C3C,0x3C78,0x3CF0,0x3DE0,0x3FE0,0x3FC0,0x3F80,0x3FC0,0x3FE0,0x3DF0,0x3CF0,0x3C78,0x3C7C,0x3C3E,0x3C1F,0x3C0F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [K] 245 | 0x0000,0x0000,0x0000,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3FFF,0x3FFF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [L] 246 | 0x0000,0x0000,0x0000,0xF81F,0xFC1F,0xFC1F,0xFE3F,0xFE3F,0xFE3F,0xFF7F,0xFF77,0xFF77,0xF7F7,0xF7E7,0xF3E7,0xF3E7,0xF3C7,0xF007,0xF007,0xF007,0xF007,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [M] 247 | 0x0000,0x0000,0x0000,0x7C0F,0x7C0F,0x7E0F,0x7F0F,0x7F0F,0x7F8F,0x7F8F,0x7FCF,0x7BEF,0x79EF,0x79FF,0x78FF,0x78FF,0x787F,0x783F,0x783F,0x781F,0x781F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [N] 248 | 0x0000,0x0000,0x0000,0x07F0,0x1FFC,0x3E3E,0x7C1F,0x780F,0x780F,0xF80F,0xF80F,0xF80F,0xF80F,0xF80F,0xF80F,0x780F,0x780F,0x7C1F,0x3E3E,0x1FFC,0x07F0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [O] 249 | 0x0000,0x0000,0x0000,0x3FFC,0x3FFF,0x3E1F,0x3E0F,0x3E0F,0x3E0F,0x3E0F,0x3E1F,0x3E3F,0x3FFC,0x3FF0,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x3E00,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [P] 250 | 0x0000,0x0000,0x0000,0x07F0,0x1FFC,0x3E3E,0x7C1F,0x780F,0x780F,0xF80F,0xF80F,0xF80F,0xF80F,0xF80F,0xF80F,0x780F,0x780F,0x7C1F,0x3E3E,0x1FFC,0x07F8,0x007C,0x003F,0x000F,0x0003,0x0000, // Ascii = [Q] 251 | 0x0000,0x0000,0x0000,0x3FF0,0x3FFC,0x3C7E,0x3C3E,0x3C1E,0x3C1E,0x3C3E,0x3C3C,0x3CFC,0x3FF0,0x3FE0,0x3DF0,0x3CF8,0x3C7C,0x3C3E,0x3C1E,0x3C1F,0x3C0F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [R] 252 | 0x0000,0x0000,0x0000,0x07FC,0x1FFE,0x3E0E,0x3C00,0x3C00,0x3C00,0x3E00,0x1FC0,0x0FF8,0x03FE,0x007F,0x001F,0x000F,0x000F,0x201F,0x3C3E,0x3FFC,0x1FF0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [S] 253 | 0x0000,0x0000,0x0000,0xFFFF,0xFFFF,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [T] 254 | 0x0000,0x0000,0x0000,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x7C0F,0x3C1E,0x3C1E,0x3E3E,0x1FFC,0x07F0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [U] 255 | 0x0000,0x0000,0x0000,0xF007,0xF007,0xF807,0x780F,0x7C0F,0x3C1E,0x3C1E,0x3E1E,0x1E3C,0x1F3C,0x1F78,0x0F78,0x0FF8,0x07F0,0x07F0,0x07F0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [V] 256 | 0x0000,0x0000,0x0000,0xE003,0xF003,0xF003,0xF007,0xF3E7,0xF3E7,0xF3E7,0x73E7,0x7BF7,0x7FF7,0x7FFF,0x7F7F,0x7F7F,0x7F7E,0x3F7E,0x3E3E,0x3E3E,0x3E3E,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [W] 257 | 0x0000,0x0000,0x0000,0xF807,0x7C0F,0x3E1E,0x3E3E,0x1F3C,0x0FF8,0x07F0,0x07E0,0x03E0,0x03E0,0x07F0,0x0FF8,0x0F7C,0x1E7C,0x3C3E,0x781F,0x780F,0xF00F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [X] 258 | 0x0000,0x0000,0x0000,0xF807,0x7807,0x7C0F,0x3C1E,0x3E1E,0x1F3C,0x0F78,0x0FF8,0x07F0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [Y] 259 | 0x0000,0x0000,0x0000,0x7FFF,0x7FFF,0x000F,0x001F,0x003E,0x007C,0x00F8,0x00F0,0x01E0,0x03E0,0x07C0,0x0F80,0x0F00,0x1E00,0x3E00,0x7C00,0x7FFF,0x7FFF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [Z] 260 | 0x07FF,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x07FF,0x07FF,0x0000, // Ascii = [[] 261 | 0x7800,0x7800,0x3C00,0x3C00,0x1E00,0x1E00,0x0F00,0x0F00,0x0780,0x0780,0x03C0,0x03C0,0x01E0,0x01E0,0x00F0,0x00F0,0x0078,0x0078,0x003C,0x003C,0x001E,0x001E,0x000F,0x000F,0x0007,0x0000, // Ascii = [\] 262 | 0x7FF0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x00F0,0x7FF0,0x7FF0,0x0000, // Ascii = []] 263 | 0x00C0,0x01C0,0x01C0,0x03E0,0x03E0,0x07F0,0x07F0,0x0778,0x0F78,0x0F38,0x1E3C,0x1E3C,0x3C1E,0x3C1E,0x380F,0x780F,0x7807,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [^] 264 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xFFFF,0xFFFF,0x0000,0x0000,0x0000, // Ascii = [_] 265 | 0x00F0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [`] 266 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0FF8,0x3FFC,0x3C7C,0x003E,0x003E,0x003E,0x07FE,0x1FFE,0x3E3E,0x7C3E,0x783E,0x7C3E,0x7C7E,0x3FFF,0x1FCF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [a] 267 | 0x3C00,0x3C00,0x3C00,0x3C00,0x3C00,0x3C00,0x3DF8,0x3FFE,0x3F3E,0x3E1F,0x3C0F,0x3C0F,0x3C0F,0x3C0F,0x3C0F,0x3C0F,0x3C1F,0x3C1E,0x3F3E,0x3FFC,0x3BF0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [b] 268 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03FE,0x0FFF,0x1F87,0x3E00,0x3E00,0x3C00,0x7C00,0x7C00,0x7C00,0x3C00,0x3E00,0x3E00,0x1F87,0x0FFF,0x03FE,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [c] 269 | 0x001F,0x001F,0x001F,0x001F,0x001F,0x001F,0x07FF,0x1FFF,0x3E3F,0x3C1F,0x7C1F,0x7C1F,0x7C1F,0x781F,0x781F,0x7C1F,0x7C1F,0x3C3F,0x3E7F,0x1FFF,0x0FDF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [d] 270 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03F8,0x0FFC,0x1F3E,0x3E1E,0x3C1F,0x7C1F,0x7FFF,0x7FFF,0x7C00,0x7C00,0x3C00,0x3E00,0x1F07,0x0FFF,0x03FE,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [e] 271 | 0x01FF,0x03E1,0x03C0,0x07C0,0x07C0,0x07C0,0x7FFF,0x7FFF,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x07C0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [f] 272 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x07EF,0x1FFF,0x3E7F,0x3C1F,0x7C1F,0x7C1F,0x781F,0x781F,0x781F,0x7C1F,0x7C1F,0x3C3F,0x3E7F,0x1FFF,0x0FDF,0x001E,0x001E,0x001E,0x387C,0x3FF8, // Ascii = [g] 273 | 0x3C00,0x3C00,0x3C00,0x3C00,0x3C00,0x3C00,0x3DFC,0x3FFE,0x3F9E,0x3F1F,0x3E1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [h] 274 | 0x01F0,0x01F0,0x0000,0x0000,0x0000,0x0000,0x7FE0,0x7FE0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [i] 275 | 0x00F8,0x00F8,0x0000,0x0000,0x0000,0x0000,0x3FF8,0x3FF8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F8,0x00F0,0x71F0,0x7FE0, // Ascii = [j] 276 | 0x3C00,0x3C00,0x3C00,0x3C00,0x3C00,0x3C00,0x3C1F,0x3C3E,0x3C7C,0x3CF8,0x3DF0,0x3DE0,0x3FC0,0x3FC0,0x3FE0,0x3DF0,0x3CF8,0x3C7C,0x3C3E,0x3C1F,0x3C1F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [k] 277 | 0x7FF0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x01F0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [l] 278 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xF79E,0xFFFF,0xFFFF,0xFFFF,0xFBE7,0xF9E7,0xF1C7,0xF1C7,0xF1C7,0xF1C7,0xF1C7,0xF1C7,0xF1C7,0xF1C7,0xF1C7,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [m] 279 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3DFC,0x3FFE,0x3F9E,0x3F1F,0x3E1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x3C1F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [n] 280 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x07F0,0x1FFC,0x3E3E,0x3C1F,0x7C1F,0x780F,0x780F,0x780F,0x780F,0x780F,0x7C1F,0x3C1F,0x3E3E,0x1FFC,0x07F0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [o] 281 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3DF8,0x3FFE,0x3F3E,0x3E1F,0x3C0F,0x3C0F,0x3C0F,0x3C0F,0x3C0F,0x3C0F,0x3C1F,0x3E1E,0x3F3E,0x3FFC,0x3FF8,0x3C00,0x3C00,0x3C00,0x3C00,0x3C00, // Ascii = [p] 282 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x07EE,0x1FFE,0x3E7E,0x3C1E,0x7C1E,0x781E,0x781E,0x781E,0x781E,0x781E,0x7C1E,0x7C3E,0x3E7E,0x1FFE,0x0FDE,0x001E,0x001E,0x001E,0x001E,0x001E, // Ascii = [q] 283 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1F7F,0x1FFF,0x1FE7,0x1FC7,0x1F87,0x1F00,0x1F00,0x1F00,0x1F00,0x1F00,0x1F00,0x1F00,0x1F00,0x1F00,0x1F00,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [r] 284 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x07FC,0x1FFE,0x1E0E,0x3E00,0x3E00,0x3F00,0x1FE0,0x07FC,0x00FE,0x003E,0x001E,0x001E,0x3C3E,0x3FFC,0x1FF0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [s] 285 | 0x0000,0x0000,0x0000,0x0780,0x0780,0x0780,0x7FFF,0x7FFF,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x0780,0x07C0,0x03FF,0x01FF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [t] 286 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3C1E,0x3C1E,0x3C1E,0x3C1E,0x3C1E,0x3C1E,0x3C1E,0x3C1E,0x3C1E,0x3C1E,0x3C3E,0x3C7E,0x3EFE,0x1FFE,0x0FDE,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [u] 287 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xF007,0x780F,0x780F,0x3C1E,0x3C1E,0x3E1E,0x1E3C,0x1E3C,0x0F78,0x0F78,0x0FF0,0x07F0,0x07F0,0x03E0,0x03E0,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [v] 288 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xF003,0xF1E3,0xF3E3,0xF3E7,0xF3F7,0xF3F7,0x7FF7,0x7F77,0x7F7F,0x7F7F,0x7F7F,0x3E3E,0x3E3E,0x3E3E,0x3E3E,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [w] 289 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x7C0F,0x3E1E,0x3E3C,0x1F3C,0x0FF8,0x07F0,0x07F0,0x03E0,0x07F0,0x07F8,0x0FF8,0x1E7C,0x3E3E,0x3C1F,0x781F,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [x] 290 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xF807,0x780F,0x7C0F,0x3C1E,0x3C1E,0x1E3C,0x1E3C,0x1F3C,0x0F78,0x0FF8,0x07F0,0x07F0,0x03E0,0x03E0,0x03C0,0x03C0,0x03C0,0x0780,0x0F80,0x7F00, // Ascii = [y] 291 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3FFF,0x3FFF,0x001F,0x003E,0x007C,0x00F8,0x01F0,0x03E0,0x07C0,0x0F80,0x1F00,0x1E00,0x3C00,0x7FFF,0x7FFF,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [z] 292 | 0x01FE,0x03E0,0x03C0,0x03C0,0x03C0,0x03C0,0x01E0,0x01E0,0x01E0,0x01C0,0x03C0,0x3F80,0x3F80,0x03C0,0x01C0,0x01E0,0x01E0,0x01E0,0x03C0,0x03C0,0x03C0,0x03C0,0x03E0,0x01FE,0x007E,0x0000, // Ascii = [{] 293 | 0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x01C0,0x0000, // Ascii = [|] 294 | 0x3FC0,0x03E0,0x01E0,0x01E0,0x01E0,0x01E0,0x01C0,0x03C0,0x03C0,0x01C0,0x01E0,0x00FE,0x00FE,0x01E0,0x01C0,0x03C0,0x03C0,0x01C0,0x01E0,0x01E0,0x01E0,0x01E0,0x03E0,0x3FC0,0x3F00,0x0000, // Ascii = [}] 295 | 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3F07,0x7FC7,0x73E7,0xF1FF,0xF07E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, // Ascii = [~] 296 | }; 297 | 298 | 299 | FontDef Font_7x10 = {7,10,Font7x10}; 300 | FontDef Font_11x18 = {11,18,Font11x18}; 301 | FontDef Font_16x26 = {16,26,Font16x26}; 302 | -------------------------------------------------------------------------------- /st7735/fonts.h: -------------------------------------------------------------------------------- 1 | /* vim: set ai et ts=4 sw=4: */ 2 | #ifndef __FONTS_H__ 3 | #define __FONTS_H__ 4 | 5 | #include 6 | 7 | typedef struct { 8 | const uint8_t width; 9 | uint8_t height; 10 | const uint16_t *data; 11 | } FontDef; 12 | 13 | 14 | extern FontDef Font_7x10; 15 | extern FontDef Font_11x18; 16 | extern FontDef Font_16x26; 17 | 18 | #endif // __FONTS_H__ 19 | -------------------------------------------------------------------------------- /st7735/st7735.c: -------------------------------------------------------------------------------- 1 | /* vim: set ai et ts=4 sw=4: */ 2 | #include "stm32f4xx_hal.h" 3 | #include "st7735.h" 4 | #include "malloc.h" 5 | #include "string.h" 6 | 7 | #define DELAY 0x80 8 | 9 | // based on Adafruit ST7735 library for Arduino 10 | static const uint8_t 11 | init_cmds1[] = { // Init for 7735R, part 1 (red or green tab) 12 | 15, // 15 commands in list: 13 | ST7735_SWRESET, DELAY, // 1: Software reset, 0 args, w/delay 14 | 150, // 150 ms delay 15 | ST7735_SLPOUT , DELAY, // 2: Out of sleep mode, 0 args, w/delay 16 | 255, // 500 ms delay 17 | ST7735_FRMCTR1, 3 , // 3: Frame rate ctrl - normal mode, 3 args: 18 | 0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D) 19 | ST7735_FRMCTR2, 3 , // 4: Frame rate control - idle mode, 3 args: 20 | 0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D) 21 | ST7735_FRMCTR3, 6 , // 5: Frame rate ctrl - partial mode, 6 args: 22 | 0x01, 0x2C, 0x2D, // Dot inversion mode 23 | 0x01, 0x2C, 0x2D, // Line inversion mode 24 | ST7735_INVCTR , 1 , // 6: Display inversion ctrl, 1 arg, no delay: 25 | 0x07, // No inversion 26 | ST7735_PWCTR1 , 3 , // 7: Power control, 3 args, no delay: 27 | 0xA2, 28 | 0x02, // -4.6V 29 | 0x84, // AUTO mode 30 | ST7735_PWCTR2 , 1 , // 8: Power control, 1 arg, no delay: 31 | 0xC5, // VGH25 = 2.4C VGSEL = -10 VGH = 3 * AVDD 32 | ST7735_PWCTR3 , 2 , // 9: Power control, 2 args, no delay: 33 | 0x0A, // Opamp current small 34 | 0x00, // Boost frequency 35 | ST7735_PWCTR4 , 2 , // 10: Power control, 2 args, no delay: 36 | 0x8A, // BCLK/2, Opamp current small & Medium low 37 | 0x2A, 38 | ST7735_PWCTR5 , 2 , // 11: Power control, 2 args, no delay: 39 | 0x8A, 0xEE, 40 | ST7735_VMCTR1 , 1 , // 12: Power control, 1 arg, no delay: 41 | 0x0E, 42 | ST7735_INVOFF , 0 , // 13: Don't invert display, no args, no delay 43 | ST7735_MADCTL , 1 , // 14: Memory access control (directions), 1 arg: 44 | ST7735_ROTATION, // row addr/col addr, bottom to top refresh 45 | ST7735_COLMOD , 1 , // 15: set color mode, 1 arg, no delay: 46 | 0x05 }, // 16-bit color 47 | 48 | #if (defined(ST7735_IS_128X128) || defined(ST7735_IS_160X128)) 49 | init_cmds2[] = { // Init for 7735R, part 2 (1.44" display) 50 | 2, // 2 commands in list: 51 | ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay: 52 | 0x00, 0x00, // XSTART = 0 53 | 0x00, 0x7F, // XEND = 127 54 | ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay: 55 | 0x00, 0x00, // XSTART = 0 56 | 0x00, 0x7F }, // XEND = 127 57 | #endif // ST7735_IS_128X128 58 | 59 | #ifdef ST7735_IS_160X80 60 | init_cmds2[] = { // Init for 7735S, part 2 (160x80 display) 61 | 3, // 3 commands in list: 62 | ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay: 63 | 0x00, 0x00, // XSTART = 0 64 | 0x00, 0x4F, // XEND = 79 65 | ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay: 66 | 0x00, 0x00, // XSTART = 0 67 | 0x00, 0x9F , // XEND = 159 68 | ST7735_INVON, 0 }, // 3: Invert colors 69 | #endif 70 | 71 | init_cmds3[] = { // Init for 7735R, part 3 (red or green tab) 72 | 4, // 4 commands in list: 73 | ST7735_GMCTRP1, 16 , // 1: Gamma Adjustments (pos. polarity), 16 args, no delay: 74 | 0x02, 0x1c, 0x07, 0x12, 75 | 0x37, 0x32, 0x29, 0x2d, 76 | 0x29, 0x25, 0x2B, 0x39, 77 | 0x00, 0x01, 0x03, 0x10, 78 | ST7735_GMCTRN1, 16 , // 2: Gamma Adjustments (neg. polarity), 16 args, no delay: 79 | 0x03, 0x1d, 0x07, 0x06, 80 | 0x2E, 0x2C, 0x29, 0x2D, 81 | 0x2E, 0x2E, 0x37, 0x3F, 82 | 0x00, 0x00, 0x02, 0x10, 83 | ST7735_NORON , DELAY, // 3: Normal display on, no args, w/delay 84 | 10, // 10 ms delay 85 | ST7735_DISPON , DELAY, // 4: Main screen turn on, no args w/delay 86 | 100 }; // 100 ms delay 87 | 88 | static void ST7735_Select() { 89 | HAL_GPIO_WritePin(ST7735_CS_GPIO_Port, ST7735_CS_Pin, GPIO_PIN_RESET); 90 | } 91 | 92 | void ST7735_Unselect() { 93 | HAL_GPIO_WritePin(ST7735_CS_GPIO_Port, ST7735_CS_Pin, GPIO_PIN_SET); 94 | } 95 | 96 | static void ST7735_Reset() { 97 | HAL_GPIO_WritePin(ST7735_RES_GPIO_Port, ST7735_RES_Pin, GPIO_PIN_RESET); 98 | HAL_Delay(5); 99 | HAL_GPIO_WritePin(ST7735_RES_GPIO_Port, ST7735_RES_Pin, GPIO_PIN_SET); 100 | } 101 | 102 | static void ST7735_WriteCommand(uint8_t cmd) { 103 | HAL_GPIO_WritePin(ST7735_DC_GPIO_Port, ST7735_DC_Pin, GPIO_PIN_RESET); 104 | HAL_SPI_Transmit(&ST7735_SPI_PORT, &cmd, sizeof(cmd), HAL_MAX_DELAY); 105 | } 106 | 107 | static void ST7735_WriteData(uint8_t* buff, size_t buff_size) { 108 | HAL_GPIO_WritePin(ST7735_DC_GPIO_Port, ST7735_DC_Pin, GPIO_PIN_SET); 109 | HAL_SPI_Transmit(&ST7735_SPI_PORT, buff, buff_size, HAL_MAX_DELAY); 110 | } 111 | 112 | static void ST7735_ExecuteCommandList(const uint8_t *addr) { 113 | uint8_t numCommands, numArgs; 114 | uint16_t ms; 115 | 116 | numCommands = *addr++; 117 | while(numCommands--) { 118 | uint8_t cmd = *addr++; 119 | ST7735_WriteCommand(cmd); 120 | 121 | numArgs = *addr++; 122 | // If high bit set, delay follows args 123 | ms = numArgs & DELAY; 124 | numArgs &= ~DELAY; 125 | if(numArgs) { 126 | ST7735_WriteData((uint8_t*)addr, numArgs); 127 | addr += numArgs; 128 | } 129 | 130 | if(ms) { 131 | ms = *addr++; 132 | if(ms == 255) ms = 500; 133 | HAL_Delay(ms); 134 | } 135 | } 136 | } 137 | 138 | static void ST7735_SetAddressWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) { 139 | // column address set 140 | ST7735_WriteCommand(ST7735_CASET); 141 | uint8_t data[] = { 0x00, x0 + ST7735_XSTART, 0x00, x1 + ST7735_XSTART }; 142 | ST7735_WriteData(data, sizeof(data)); 143 | 144 | // row address set 145 | ST7735_WriteCommand(ST7735_RASET); 146 | data[1] = y0 + ST7735_YSTART; 147 | data[3] = y1 + ST7735_YSTART; 148 | ST7735_WriteData(data, sizeof(data)); 149 | 150 | // write to RAM 151 | ST7735_WriteCommand(ST7735_RAMWR); 152 | } 153 | 154 | void ST7735_Init() { 155 | ST7735_Select(); 156 | ST7735_Reset(); 157 | ST7735_ExecuteCommandList(init_cmds1); 158 | ST7735_ExecuteCommandList(init_cmds2); 159 | ST7735_ExecuteCommandList(init_cmds3); 160 | ST7735_Unselect(); 161 | } 162 | 163 | void ST7735_DrawPixel(uint16_t x, uint16_t y, uint16_t color) { 164 | if((x >= ST7735_WIDTH) || (y >= ST7735_HEIGHT)) 165 | return; 166 | 167 | ST7735_Select(); 168 | 169 | ST7735_SetAddressWindow(x, y, x+1, y+1); 170 | uint8_t data[] = { color >> 8, color & 0xFF }; 171 | ST7735_WriteData(data, sizeof(data)); 172 | 173 | ST7735_Unselect(); 174 | } 175 | 176 | static void ST7735_WriteChar(uint16_t x, uint16_t y, char ch, FontDef font, uint16_t color, uint16_t bgcolor) { 177 | uint32_t i, b, j; 178 | 179 | ST7735_SetAddressWindow(x, y, x+font.width-1, y+font.height-1); 180 | 181 | for(i = 0; i < font.height; i++) { 182 | b = font.data[(ch - 32) * font.height + i]; 183 | for(j = 0; j < font.width; j++) { 184 | if((b << j) & 0x8000) { 185 | uint8_t data[] = { color >> 8, color & 0xFF }; 186 | ST7735_WriteData(data, sizeof(data)); 187 | } else { 188 | uint8_t data[] = { bgcolor >> 8, bgcolor & 0xFF }; 189 | ST7735_WriteData(data, sizeof(data)); 190 | } 191 | } 192 | } 193 | } 194 | 195 | /* 196 | Simpler (and probably slower) implementation: 197 | 198 | static void ST7735_WriteChar(uint16_t x, uint16_t y, char ch, FontDef font, uint16_t color) { 199 | uint32_t i, b, j; 200 | 201 | for(i = 0; i < font.height; i++) { 202 | b = font.data[(ch - 32) * font.height + i]; 203 | for(j = 0; j < font.width; j++) { 204 | if((b << j) & 0x8000) { 205 | ST7735_DrawPixel(x + j, y + i, color); 206 | } 207 | } 208 | } 209 | } 210 | */ 211 | 212 | void ST7735_WriteString(uint16_t x, uint16_t y, const char* str, FontDef font, uint16_t color, uint16_t bgcolor) { 213 | ST7735_Select(); 214 | 215 | while(*str) { 216 | if(x + font.width >= ST7735_WIDTH) { 217 | x = 0; 218 | y += font.height; 219 | if(y + font.height >= ST7735_HEIGHT) { 220 | break; 221 | } 222 | 223 | if(*str == ' ') { 224 | // skip spaces in the beginning of the new line 225 | str++; 226 | continue; 227 | } 228 | } 229 | 230 | ST7735_WriteChar(x, y, *str, font, color, bgcolor); 231 | x += font.width; 232 | str++; 233 | } 234 | 235 | ST7735_Unselect(); 236 | } 237 | 238 | void ST7735_FillRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) { 239 | // clipping 240 | if((x >= ST7735_WIDTH) || (y >= ST7735_HEIGHT)) return; 241 | if((x + w - 1) >= ST7735_WIDTH) w = ST7735_WIDTH - x; 242 | if((y + h - 1) >= ST7735_HEIGHT) h = ST7735_HEIGHT - y; 243 | 244 | ST7735_Select(); 245 | ST7735_SetAddressWindow(x, y, x+w-1, y+h-1); 246 | 247 | uint8_t data[] = { color >> 8, color & 0xFF }; 248 | HAL_GPIO_WritePin(ST7735_DC_GPIO_Port, ST7735_DC_Pin, GPIO_PIN_SET); 249 | for(y = h; y > 0; y--) { 250 | for(x = w; x > 0; x--) { 251 | HAL_SPI_Transmit(&ST7735_SPI_PORT, data, sizeof(data), HAL_MAX_DELAY); 252 | } 253 | } 254 | 255 | ST7735_Unselect(); 256 | } 257 | 258 | void ST7735_FillRectangleFast(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) { 259 | // clipping 260 | if((x >= ST7735_WIDTH) || (y >= ST7735_HEIGHT)) return; 261 | if((x + w - 1) >= ST7735_WIDTH) w = ST7735_WIDTH - x; 262 | if((y + h - 1) >= ST7735_HEIGHT) h = ST7735_HEIGHT - y; 263 | 264 | ST7735_Select(); 265 | ST7735_SetAddressWindow(x, y, x+w-1, y+h-1); 266 | 267 | // Prepare whole line in a single buffer 268 | uint8_t pixel[] = { color >> 8, color & 0xFF }; 269 | uint8_t *line = malloc(w * sizeof(pixel)); 270 | for(x = 0; x < w; ++x) 271 | memcpy(line + x * sizeof(pixel), pixel, sizeof(pixel)); 272 | 273 | HAL_GPIO_WritePin(ST7735_DC_GPIO_Port, ST7735_DC_Pin, GPIO_PIN_SET); 274 | for(y = h; y > 0; y--) 275 | HAL_SPI_Transmit(&ST7735_SPI_PORT, line, w * sizeof(pixel), HAL_MAX_DELAY); 276 | 277 | free(line); 278 | ST7735_Unselect(); 279 | } 280 | 281 | void ST7735_FillScreen(uint16_t color) { 282 | ST7735_FillRectangle(0, 0, ST7735_WIDTH, ST7735_HEIGHT, color); 283 | } 284 | 285 | void ST7735_FillScreenFast(uint16_t color) { 286 | ST7735_FillRectangleFast(0, 0, ST7735_WIDTH, ST7735_HEIGHT, color); 287 | } 288 | 289 | void ST7735_DrawImage(uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint16_t* data) { 290 | if((x >= ST7735_WIDTH) || (y >= ST7735_HEIGHT)) return; 291 | if((x + w - 1) >= ST7735_WIDTH) return; 292 | if((y + h - 1) >= ST7735_HEIGHT) return; 293 | 294 | ST7735_Select(); 295 | ST7735_SetAddressWindow(x, y, x+w-1, y+h-1); 296 | ST7735_WriteData((uint8_t*)data, sizeof(uint16_t)*w*h); 297 | ST7735_Unselect(); 298 | } 299 | 300 | void ST7735_InvertColors(bool invert) { 301 | ST7735_Select(); 302 | ST7735_WriteCommand(invert ? ST7735_INVON : ST7735_INVOFF); 303 | ST7735_Unselect(); 304 | } 305 | 306 | void ST7735_SetGamma(GammaDef gamma) 307 | { 308 | ST7735_Select(); 309 | ST7735_WriteCommand(ST7735_GAMSET); 310 | ST7735_WriteData((uint8_t *) &gamma, sizeof(gamma)); 311 | ST7735_Unselect(); 312 | } 313 | -------------------------------------------------------------------------------- /st7735/st7735.h: -------------------------------------------------------------------------------- 1 | /* vim: set ai et ts=4 sw=4: */ 2 | #ifndef __ST7735_H__ 3 | #define __ST7735_H__ 4 | 5 | #include "fonts.h" 6 | #include 7 | 8 | #define ST7735_MADCTL_MY 0x80 9 | #define ST7735_MADCTL_MX 0x40 10 | #define ST7735_MADCTL_MV 0x20 11 | #define ST7735_MADCTL_ML 0x10 12 | #define ST7735_MADCTL_RGB 0x00 13 | #define ST7735_MADCTL_BGR 0x08 14 | #define ST7735_MADCTL_MH 0x04 15 | 16 | /*** Redefine if necessary ***/ 17 | #define ST7735_SPI_PORT hspi1 18 | extern SPI_HandleTypeDef ST7735_SPI_PORT; 19 | 20 | #define ST7735_RES_Pin GPIO_PIN_7 21 | #define ST7735_RES_GPIO_Port GPIOC 22 | #define ST7735_CS_Pin GPIO_PIN_6 23 | #define ST7735_CS_GPIO_Port GPIOB 24 | #define ST7735_DC_Pin GPIO_PIN_9 25 | #define ST7735_DC_GPIO_Port GPIOA 26 | 27 | // AliExpress/eBay 1.8" display, default orientation 28 | /* 29 | #define ST7735_IS_160X128 1 30 | #define ST7735_WIDTH 128 31 | #define ST7735_HEIGHT 160 32 | #define ST7735_XSTART 0 33 | #define ST7735_YSTART 0 34 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MY) 35 | */ 36 | 37 | // AliExpress/eBay 1.8" display, rotate right 38 | /* 39 | #define ST7735_IS_160X128 1 40 | #define ST7735_WIDTH 160 41 | #define ST7735_HEIGHT 128 42 | #define ST7735_XSTART 0 43 | #define ST7735_YSTART 0 44 | #define ST7735_ROTATION (ST7735_MADCTL_MY | ST7735_MADCTL_MV) 45 | */ 46 | 47 | // AliExpress/eBay 1.8" display, rotate left 48 | /* 49 | #define ST7735_IS_160X128 1 50 | #define ST7735_WIDTH 160 51 | #define ST7735_HEIGHT 128 52 | #define ST7735_XSTART 0 53 | #define ST7735_YSTART 0 54 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MV) 55 | */ 56 | 57 | // AliExpress/eBay 1.8" display, upside down 58 | /* 59 | #define ST7735_IS_160X128 1 60 | #define ST7735_WIDTH 128 61 | #define ST7735_HEIGHT 160 62 | #define ST7735_XSTART 0 63 | #define ST7735_YSTART 0 64 | #define ST7735_ROTATION (0) 65 | */ 66 | 67 | // WaveShare ST7735S-based 1.8" display, default orientation 68 | /* 69 | #define ST7735_IS_160X128 1 70 | #define ST7735_WIDTH 128 71 | #define ST7735_HEIGHT 160 72 | #define ST7735_XSTART 2 73 | #define ST7735_YSTART 1 74 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MY | ST7735_MADCTL_RGB) 75 | */ 76 | 77 | // WaveShare ST7735S-based 1.8" display, rotate right 78 | /* 79 | #define ST7735_IS_160X128 1 80 | #define ST7735_WIDTH 160 81 | #define ST7735_HEIGHT 128 82 | #define ST7735_XSTART 1 83 | #define ST7735_YSTART 2 84 | #define ST7735_ROTATION (ST7735_MADCTL_MY | ST7735_MADCTL_MV | ST7735_MADCTL_RGB) 85 | */ 86 | 87 | // WaveShare ST7735S-based 1.8" display, rotate left 88 | /* 89 | #define ST7735_IS_160X128 1 90 | #define ST7735_WIDTH 160 91 | #define ST7735_HEIGHT 128 92 | #define ST7735_XSTART 1 93 | #define ST7735_YSTART 2 94 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MV | ST7735_MADCTL_RGB) 95 | */ 96 | 97 | // WaveShare ST7735S-based 1.8" display, upside down 98 | /* 99 | #define ST7735_IS_160X128 1 100 | #define ST7735_WIDTH 128 101 | #define ST7735_HEIGHT 160 102 | #define ST7735_XSTART 2 103 | #define ST7735_YSTART 1 104 | #define ST7735_ROTATION (ST7735_MADCTL_RGB) 105 | */ 106 | 107 | // 1.44" display, default orientation 108 | #define ST7735_IS_128X128 1 109 | #define ST7735_WIDTH 128 110 | #define ST7735_HEIGHT 128 111 | #define ST7735_XSTART 2 112 | #define ST7735_YSTART 3 113 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MY | ST7735_MADCTL_BGR) 114 | 115 | // 1.44" display, rotate right 116 | /* 117 | #define ST7735_IS_128X128 1 118 | #define ST7735_WIDTH 128 119 | #define ST7735_HEIGHT 128 120 | #define ST7735_XSTART 3 121 | #define ST7735_YSTART 2 122 | #define ST7735_ROTATION (ST7735_MADCTL_MY | ST7735_MADCTL_MV | ST7735_MADCTL_BGR) 123 | */ 124 | 125 | // 1.44" display, rotate left 126 | /* 127 | #define ST7735_IS_128X128 1 128 | #define ST7735_WIDTH 128 129 | #define ST7735_HEIGHT 128 130 | #define ST7735_XSTART 1 131 | #define ST7735_YSTART 2 132 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MV | ST7735_MADCTL_BGR) 133 | */ 134 | 135 | // 1.44" display, upside down 136 | /* 137 | #define ST7735_IS_128X128 1 138 | #define ST7735_WIDTH 128 139 | #define ST7735_HEIGHT 128 140 | #define ST7735_XSTART 2 141 | #define ST7735_YSTART 1 142 | #define ST7735_ROTATION (ST7735_MADCTL_BGR) 143 | */ 144 | 145 | // mini 160x80 display (it's unlikely you want the default orientation) 146 | /* 147 | #define ST7735_IS_160X80 1 148 | #define ST7735_XSTART 26 149 | #define ST7735_YSTART 1 150 | #define ST7735_WIDTH 80 151 | #define ST7735_HEIGHT 160 152 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MY | ST7735_MADCTL_BGR) 153 | */ 154 | 155 | // mini 160x80, rotate left 156 | /* 157 | #define ST7735_IS_160X80 1 158 | #define ST7735_XSTART 1 159 | #define ST7735_YSTART 26 160 | #define ST7735_WIDTH 160 161 | #define ST7735_HEIGHT 80 162 | #define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MV | ST7735_MADCTL_BGR) 163 | */ 164 | 165 | // mini 160x80, rotate right 166 | /* 167 | #define ST7735_IS_160X80 1 168 | #define ST7735_XSTART 1 169 | #define ST7735_YSTART 26 170 | #define ST7735_WIDTH 160 171 | #define ST7735_HEIGHT 80 172 | #define ST7735_ROTATION (ST7735_MADCTL_MY | ST7735_MADCTL_MV | ST7735_MADCTL_BGR) 173 | */ 174 | 175 | /****************************/ 176 | 177 | #define ST7735_NOP 0x00 178 | #define ST7735_SWRESET 0x01 179 | #define ST7735_RDDID 0x04 180 | #define ST7735_RDDST 0x09 181 | 182 | #define ST7735_SLPIN 0x10 183 | #define ST7735_SLPOUT 0x11 184 | #define ST7735_PTLON 0x12 185 | #define ST7735_NORON 0x13 186 | 187 | #define ST7735_INVOFF 0x20 188 | #define ST7735_INVON 0x21 189 | #define ST7735_GAMSET 0x26 190 | #define ST7735_DISPOFF 0x28 191 | #define ST7735_DISPON 0x29 192 | #define ST7735_CASET 0x2A 193 | #define ST7735_RASET 0x2B 194 | #define ST7735_RAMWR 0x2C 195 | #define ST7735_RAMRD 0x2E 196 | 197 | #define ST7735_PTLAR 0x30 198 | #define ST7735_COLMOD 0x3A 199 | #define ST7735_MADCTL 0x36 200 | 201 | #define ST7735_FRMCTR1 0xB1 202 | #define ST7735_FRMCTR2 0xB2 203 | #define ST7735_FRMCTR3 0xB3 204 | #define ST7735_INVCTR 0xB4 205 | #define ST7735_DISSET5 0xB6 206 | 207 | #define ST7735_PWCTR1 0xC0 208 | #define ST7735_PWCTR2 0xC1 209 | #define ST7735_PWCTR3 0xC2 210 | #define ST7735_PWCTR4 0xC3 211 | #define ST7735_PWCTR5 0xC4 212 | #define ST7735_VMCTR1 0xC5 213 | 214 | #define ST7735_RDID1 0xDA 215 | #define ST7735_RDID2 0xDB 216 | #define ST7735_RDID3 0xDC 217 | #define ST7735_RDID4 0xDD 218 | 219 | #define ST7735_PWCTR6 0xFC 220 | 221 | #define ST7735_GMCTRP1 0xE0 222 | #define ST7735_GMCTRN1 0xE1 223 | 224 | // Color definitions 225 | #define ST7735_BLACK 0x0000 226 | #define ST7735_BLUE 0x001F 227 | #define ST7735_RED 0xF800 228 | #define ST7735_GREEN 0x07E0 229 | #define ST7735_CYAN 0x07FF 230 | #define ST7735_MAGENTA 0xF81F 231 | #define ST7735_YELLOW 0xFFE0 232 | #define ST7735_WHITE 0xFFFF 233 | #define ST7735_COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3)) 234 | 235 | typedef enum { 236 | GAMMA_10 = 0x01, 237 | GAMMA_25 = 0x02, 238 | GAMMA_22 = 0x04, 239 | GAMMA_18 = 0x08 240 | } GammaDef; 241 | 242 | #ifdef __cplusplus 243 | extern "C" { 244 | #endif 245 | 246 | // call before initializing any SPI devices 247 | void ST7735_Unselect(); 248 | 249 | void ST7735_Init(void); 250 | void ST7735_DrawPixel(uint16_t x, uint16_t y, uint16_t color); 251 | void ST7735_WriteString(uint16_t x, uint16_t y, const char* str, FontDef font, uint16_t color, uint16_t bgcolor); 252 | void ST7735_FillRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color); 253 | void ST7735_FillRectangleFast(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color); 254 | void ST7735_FillScreen(uint16_t color); 255 | void ST7735_FillScreenFast(uint16_t color); 256 | void ST7735_DrawImage(uint16_t x, uint16_t y, uint16_t w, uint16_t h, const uint16_t* data); 257 | void ST7735_InvertColors(bool invert); 258 | void ST7735_SetGamma(GammaDef gamma); 259 | 260 | #ifdef __cplusplus 261 | } 262 | #endif 263 | 264 | #endif // __ST7735_H__ 265 | -------------------------------------------------------------------------------- /startup_stm32f411xe.s: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file startup_stm32f411xe.s 4 | * @author MCD Application Team 5 | * @brief STM32F411xExx Devices vector table for GCC based toolchains. 6 | * This module performs: 7 | * - Set the initial SP 8 | * - Set the initial PC == Reset_Handler, 9 | * - Set the vector table entries with the exceptions ISR address 10 | * - Branches to main in the C library (which eventually 11 | * calls main()). 12 | * After Reset the Cortex-M4 processor is in Thread mode, 13 | * priority is Privileged, and the Stack is set to Main. 14 | ****************************************************************************** 15 | * @attention 16 | * 17 | *

© COPYRIGHT 2017 STMicroelectronics

18 | * 19 | * Redistribution and use in source and binary forms, with or without modification, 20 | * are permitted provided that the following conditions are met: 21 | * 1. Redistributions of source code must retain the above copyright notice, 22 | * this list of conditions and the following disclaimer. 23 | * 2. Redistributions in binary form must reproduce the above copyright notice, 24 | * this list of conditions and the following disclaimer in the documentation 25 | * and/or other materials provided with the distribution. 26 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 27 | * may be used to endorse or promote products derived from this software 28 | * without specific prior written permission. 29 | * 30 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 31 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 32 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 33 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 34 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 35 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 36 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 38 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 39 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | ****************************************************************************** 42 | */ 43 | 44 | .syntax unified 45 | .cpu cortex-m4 46 | .fpu softvfp 47 | .thumb 48 | 49 | .global g_pfnVectors 50 | .global Default_Handler 51 | 52 | /* start address for the initialization values of the .data section. 53 | defined in linker script */ 54 | .word _sidata 55 | /* start address for the .data section. defined in linker script */ 56 | .word _sdata 57 | /* end address for the .data section. defined in linker script */ 58 | .word _edata 59 | /* start address for the .bss section. defined in linker script */ 60 | .word _sbss 61 | /* end address for the .bss section. defined in linker script */ 62 | .word _ebss 63 | /* stack used for SystemInit_ExtMemCtl; always internal RAM used */ 64 | 65 | /** 66 | * @brief This is the code that gets called when the processor first 67 | * starts execution following a reset event. Only the absolutely 68 | * necessary set is performed, after which the application 69 | * supplied main() routine is called. 70 | * @param None 71 | * @retval : None 72 | */ 73 | 74 | .section .text.Reset_Handler 75 | .weak Reset_Handler 76 | .type Reset_Handler, %function 77 | Reset_Handler: 78 | ldr sp, =_estack /* set stack pointer */ 79 | 80 | /* Copy the data segment initializers from flash to SRAM */ 81 | movs r1, #0 82 | b LoopCopyDataInit 83 | 84 | CopyDataInit: 85 | ldr r3, =_sidata 86 | ldr r3, [r3, r1] 87 | str r3, [r0, r1] 88 | adds r1, r1, #4 89 | 90 | LoopCopyDataInit: 91 | ldr r0, =_sdata 92 | ldr r3, =_edata 93 | adds r2, r0, r1 94 | cmp r2, r3 95 | bcc CopyDataInit 96 | ldr r2, =_sbss 97 | b LoopFillZerobss 98 | /* Zero fill the bss segment. */ 99 | FillZerobss: 100 | movs r3, #0 101 | str r3, [r2], #4 102 | 103 | LoopFillZerobss: 104 | ldr r3, = _ebss 105 | cmp r2, r3 106 | bcc FillZerobss 107 | 108 | /* Call the clock system intitialization function.*/ 109 | bl SystemInit 110 | /* Call static constructors */ 111 | bl __libc_init_array 112 | /* Call the application's entry point.*/ 113 | bl main 114 | bx lr 115 | .size Reset_Handler, .-Reset_Handler 116 | 117 | /** 118 | * @brief This is the code that gets called when the processor receives an 119 | * unexpected interrupt. This simply enters an infinite loop, preserving 120 | * the system state for examination by a debugger. 121 | * @param None 122 | * @retval None 123 | */ 124 | .section .text.Default_Handler,"ax",%progbits 125 | Default_Handler: 126 | Infinite_Loop: 127 | b Infinite_Loop 128 | .size Default_Handler, .-Default_Handler 129 | /****************************************************************************** 130 | * 131 | * The minimal vector table for a Cortex M3. Note that the proper constructs 132 | * must be placed on this to ensure that it ends up at physical address 133 | * 0x0000.0000. 134 | * 135 | *******************************************************************************/ 136 | .section .isr_vector,"a",%progbits 137 | .type g_pfnVectors, %object 138 | .size g_pfnVectors, .-g_pfnVectors 139 | 140 | g_pfnVectors: 141 | .word _estack 142 | .word Reset_Handler 143 | .word NMI_Handler 144 | .word HardFault_Handler 145 | .word MemManage_Handler 146 | .word BusFault_Handler 147 | .word UsageFault_Handler 148 | .word 0 149 | .word 0 150 | .word 0 151 | .word 0 152 | .word SVC_Handler 153 | .word DebugMon_Handler 154 | .word 0 155 | .word PendSV_Handler 156 | .word SysTick_Handler 157 | 158 | /* External Interrupts */ 159 | .word WWDG_IRQHandler /* Window WatchDog */ 160 | .word PVD_IRQHandler /* PVD through EXTI Line detection */ 161 | .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */ 162 | .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */ 163 | .word FLASH_IRQHandler /* FLASH */ 164 | .word RCC_IRQHandler /* RCC */ 165 | .word EXTI0_IRQHandler /* EXTI Line0 */ 166 | .word EXTI1_IRQHandler /* EXTI Line1 */ 167 | .word EXTI2_IRQHandler /* EXTI Line2 */ 168 | .word EXTI3_IRQHandler /* EXTI Line3 */ 169 | .word EXTI4_IRQHandler /* EXTI Line4 */ 170 | .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */ 171 | .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */ 172 | .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */ 173 | .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */ 174 | .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */ 175 | .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */ 176 | .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */ 177 | .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */ 178 | .word 0 /* Reserved */ 179 | .word 0 /* Reserved */ 180 | .word 0 /* Reserved */ 181 | .word 0 /* Reserved */ 182 | .word EXTI9_5_IRQHandler /* External Line[9:5]s */ 183 | .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */ 184 | .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */ 185 | .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */ 186 | .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ 187 | .word TIM2_IRQHandler /* TIM2 */ 188 | .word TIM3_IRQHandler /* TIM3 */ 189 | .word TIM4_IRQHandler /* TIM4 */ 190 | .word I2C1_EV_IRQHandler /* I2C1 Event */ 191 | .word I2C1_ER_IRQHandler /* I2C1 Error */ 192 | .word I2C2_EV_IRQHandler /* I2C2 Event */ 193 | .word I2C2_ER_IRQHandler /* I2C2 Error */ 194 | .word SPI1_IRQHandler /* SPI1 */ 195 | .word SPI2_IRQHandler /* SPI2 */ 196 | .word USART1_IRQHandler /* USART1 */ 197 | .word USART2_IRQHandler /* USART2 */ 198 | .word 0 /* Reserved */ 199 | .word EXTI15_10_IRQHandler /* External Line[15:10]s */ 200 | .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */ 201 | .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */ 202 | .word 0 /* Reserved */ 203 | .word 0 /* Reserved */ 204 | .word 0 /* Reserved */ 205 | .word 0 /* Reserved */ 206 | .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */ 207 | .word 0 /* Reserved */ 208 | .word SDIO_IRQHandler /* SDIO */ 209 | .word TIM5_IRQHandler /* TIM5 */ 210 | .word SPI3_IRQHandler /* SPI3 */ 211 | .word 0 /* Reserved */ 212 | .word 0 /* Reserved */ 213 | .word 0 /* Reserved */ 214 | .word 0 /* Reserved */ 215 | .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */ 216 | .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */ 217 | .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */ 218 | .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */ 219 | .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */ 220 | .word 0 /* Reserved */ 221 | .word 0 /* Reserved */ 222 | .word 0 /* Reserved */ 223 | .word 0 /* Reserved */ 224 | .word 0 /* Reserved */ 225 | .word 0 /* Reserved */ 226 | .word OTG_FS_IRQHandler /* USB OTG FS */ 227 | .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */ 228 | .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */ 229 | .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */ 230 | .word USART6_IRQHandler /* USART6 */ 231 | .word I2C3_EV_IRQHandler /* I2C3 event */ 232 | .word I2C3_ER_IRQHandler /* I2C3 error */ 233 | .word 0 /* Reserved */ 234 | .word 0 /* Reserved */ 235 | .word 0 /* Reserved */ 236 | .word 0 /* Reserved */ 237 | .word 0 /* Reserved */ 238 | .word 0 /* Reserved */ 239 | .word 0 /* Reserved */ 240 | .word FPU_IRQHandler /* FPU */ 241 | .word 0 /* Reserved */ 242 | .word 0 /* Reserved */ 243 | .word SPI4_IRQHandler /* SPI4 */ 244 | .word SPI5_IRQHandler /* SPI5 */ 245 | 246 | /******************************************************************************* 247 | * 248 | * Provide weak aliases for each Exception handler to the Default_Handler. 249 | * As they are weak aliases, any function with the same name will override 250 | * this definition. 251 | * 252 | *******************************************************************************/ 253 | .weak NMI_Handler 254 | .thumb_set NMI_Handler,Default_Handler 255 | 256 | .weak HardFault_Handler 257 | .thumb_set HardFault_Handler,Default_Handler 258 | 259 | .weak MemManage_Handler 260 | .thumb_set MemManage_Handler,Default_Handler 261 | 262 | .weak BusFault_Handler 263 | .thumb_set BusFault_Handler,Default_Handler 264 | 265 | .weak UsageFault_Handler 266 | .thumb_set UsageFault_Handler,Default_Handler 267 | 268 | .weak SVC_Handler 269 | .thumb_set SVC_Handler,Default_Handler 270 | 271 | .weak DebugMon_Handler 272 | .thumb_set DebugMon_Handler,Default_Handler 273 | 274 | .weak PendSV_Handler 275 | .thumb_set PendSV_Handler,Default_Handler 276 | 277 | .weak SysTick_Handler 278 | .thumb_set SysTick_Handler,Default_Handler 279 | 280 | .weak WWDG_IRQHandler 281 | .thumb_set WWDG_IRQHandler,Default_Handler 282 | 283 | .weak PVD_IRQHandler 284 | .thumb_set PVD_IRQHandler,Default_Handler 285 | 286 | .weak TAMP_STAMP_IRQHandler 287 | .thumb_set TAMP_STAMP_IRQHandler,Default_Handler 288 | 289 | .weak RTC_WKUP_IRQHandler 290 | .thumb_set RTC_WKUP_IRQHandler,Default_Handler 291 | 292 | .weak FLASH_IRQHandler 293 | .thumb_set FLASH_IRQHandler,Default_Handler 294 | 295 | .weak RCC_IRQHandler 296 | .thumb_set RCC_IRQHandler,Default_Handler 297 | 298 | .weak EXTI0_IRQHandler 299 | .thumb_set EXTI0_IRQHandler,Default_Handler 300 | 301 | .weak EXTI1_IRQHandler 302 | .thumb_set EXTI1_IRQHandler,Default_Handler 303 | 304 | .weak EXTI2_IRQHandler 305 | .thumb_set EXTI2_IRQHandler,Default_Handler 306 | 307 | .weak EXTI3_IRQHandler 308 | .thumb_set EXTI3_IRQHandler,Default_Handler 309 | 310 | .weak EXTI4_IRQHandler 311 | .thumb_set EXTI4_IRQHandler,Default_Handler 312 | 313 | .weak DMA1_Stream0_IRQHandler 314 | .thumb_set DMA1_Stream0_IRQHandler,Default_Handler 315 | 316 | .weak DMA1_Stream1_IRQHandler 317 | .thumb_set DMA1_Stream1_IRQHandler,Default_Handler 318 | 319 | .weak DMA1_Stream2_IRQHandler 320 | .thumb_set DMA1_Stream2_IRQHandler,Default_Handler 321 | 322 | .weak DMA1_Stream3_IRQHandler 323 | .thumb_set DMA1_Stream3_IRQHandler,Default_Handler 324 | 325 | .weak DMA1_Stream4_IRQHandler 326 | .thumb_set DMA1_Stream4_IRQHandler,Default_Handler 327 | 328 | .weak DMA1_Stream5_IRQHandler 329 | .thumb_set DMA1_Stream5_IRQHandler,Default_Handler 330 | 331 | .weak DMA1_Stream6_IRQHandler 332 | .thumb_set DMA1_Stream6_IRQHandler,Default_Handler 333 | 334 | .weak ADC_IRQHandler 335 | .thumb_set ADC_IRQHandler,Default_Handler 336 | 337 | .weak EXTI9_5_IRQHandler 338 | .thumb_set EXTI9_5_IRQHandler,Default_Handler 339 | 340 | .weak TIM1_BRK_TIM9_IRQHandler 341 | .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler 342 | 343 | .weak TIM1_UP_TIM10_IRQHandler 344 | .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler 345 | 346 | .weak TIM1_TRG_COM_TIM11_IRQHandler 347 | .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler 348 | 349 | .weak TIM1_CC_IRQHandler 350 | .thumb_set TIM1_CC_IRQHandler,Default_Handler 351 | 352 | .weak TIM2_IRQHandler 353 | .thumb_set TIM2_IRQHandler,Default_Handler 354 | 355 | .weak TIM3_IRQHandler 356 | .thumb_set TIM3_IRQHandler,Default_Handler 357 | 358 | .weak TIM4_IRQHandler 359 | .thumb_set TIM4_IRQHandler,Default_Handler 360 | 361 | .weak I2C1_EV_IRQHandler 362 | .thumb_set I2C1_EV_IRQHandler,Default_Handler 363 | 364 | .weak I2C1_ER_IRQHandler 365 | .thumb_set I2C1_ER_IRQHandler,Default_Handler 366 | 367 | .weak I2C2_EV_IRQHandler 368 | .thumb_set I2C2_EV_IRQHandler,Default_Handler 369 | 370 | .weak I2C2_ER_IRQHandler 371 | .thumb_set I2C2_ER_IRQHandler,Default_Handler 372 | 373 | .weak SPI1_IRQHandler 374 | .thumb_set SPI1_IRQHandler,Default_Handler 375 | 376 | .weak SPI2_IRQHandler 377 | .thumb_set SPI2_IRQHandler,Default_Handler 378 | 379 | .weak USART1_IRQHandler 380 | .thumb_set USART1_IRQHandler,Default_Handler 381 | 382 | .weak USART2_IRQHandler 383 | .thumb_set USART2_IRQHandler,Default_Handler 384 | 385 | .weak EXTI15_10_IRQHandler 386 | .thumb_set EXTI15_10_IRQHandler,Default_Handler 387 | 388 | .weak RTC_Alarm_IRQHandler 389 | .thumb_set RTC_Alarm_IRQHandler,Default_Handler 390 | 391 | .weak OTG_FS_WKUP_IRQHandler 392 | .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler 393 | 394 | .weak DMA1_Stream7_IRQHandler 395 | .thumb_set DMA1_Stream7_IRQHandler,Default_Handler 396 | 397 | .weak SDIO_IRQHandler 398 | .thumb_set SDIO_IRQHandler,Default_Handler 399 | 400 | .weak TIM5_IRQHandler 401 | .thumb_set TIM5_IRQHandler,Default_Handler 402 | 403 | .weak SPI3_IRQHandler 404 | .thumb_set SPI3_IRQHandler,Default_Handler 405 | 406 | .weak DMA2_Stream0_IRQHandler 407 | .thumb_set DMA2_Stream0_IRQHandler,Default_Handler 408 | 409 | .weak DMA2_Stream1_IRQHandler 410 | .thumb_set DMA2_Stream1_IRQHandler,Default_Handler 411 | 412 | .weak DMA2_Stream2_IRQHandler 413 | .thumb_set DMA2_Stream2_IRQHandler,Default_Handler 414 | 415 | .weak DMA2_Stream3_IRQHandler 416 | .thumb_set DMA2_Stream3_IRQHandler,Default_Handler 417 | 418 | .weak DMA2_Stream4_IRQHandler 419 | .thumb_set DMA2_Stream4_IRQHandler,Default_Handler 420 | 421 | .weak OTG_FS_IRQHandler 422 | .thumb_set OTG_FS_IRQHandler,Default_Handler 423 | 424 | .weak DMA2_Stream5_IRQHandler 425 | .thumb_set DMA2_Stream5_IRQHandler,Default_Handler 426 | 427 | .weak DMA2_Stream6_IRQHandler 428 | .thumb_set DMA2_Stream6_IRQHandler,Default_Handler 429 | 430 | .weak DMA2_Stream7_IRQHandler 431 | .thumb_set DMA2_Stream7_IRQHandler,Default_Handler 432 | 433 | .weak USART6_IRQHandler 434 | .thumb_set USART6_IRQHandler,Default_Handler 435 | 436 | .weak I2C3_EV_IRQHandler 437 | .thumb_set I2C3_EV_IRQHandler,Default_Handler 438 | 439 | .weak I2C3_ER_IRQHandler 440 | .thumb_set I2C3_ER_IRQHandler,Default_Handler 441 | 442 | .weak FPU_IRQHandler 443 | .thumb_set FPU_IRQHandler,Default_Handler 444 | 445 | .weak SPI4_IRQHandler 446 | .thumb_set SPI4_IRQHandler,Default_Handler 447 | 448 | .weak SPI5_IRQHandler 449 | .thumb_set SPI5_IRQHandler,Default_Handler 450 | 451 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 452 | 453 | --------------------------------------------------------------------------------