Mercurial > public > ostc4
annotate Discovery/Inc/ostc.h @ 1040:74be24428049 GasConsumption
Bugfix Fontpack update for large blocks:
The update of a font pack with a size > 768000 byte was interrupted and a manuel switch to bootloader had to be performed to get the font pack flashed. Rootcause was a missing address adjustment during the block read back function which caused a false error detection. Blocks > 768000 are read in two step while only one buffer is used for comparation. To fill the correct data into this buffer a dummy read of the flash data was added to get the data pointers to the correct offset. Another bug was regardings the read back itself where only the first byte was checked. After array indexing the complete buffer is noch verified.
| author | Ideenmodellierer |
|---|---|
| date | Mon, 13 Oct 2025 20:54:25 +0200 |
| parents | 5865f0aeb438 |
| children |
| rev | line source |
|---|---|
| 38 | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 /// -*- coding: UTF-8 -*- | |
| 3 /// | |
| 4 /// \file Discovery/Inc/ostc.h | |
| 5 /// \brief Hardware specific configuration | |
| 6 /// \author heinrichs weikamp gmbh | |
| 7 /// \date 05-Dec-2014 | |
| 8 /// | |
| 9 /// $Id$ | |
| 10 /////////////////////////////////////////////////////////////////////////////// | |
| 11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh | |
| 12 /// | |
| 13 /// This program is free software: you can redistribute it and/or modify | |
| 14 /// it under the terms of the GNU General Public License as published by | |
| 15 /// the Free Software Foundation, either version 3 of the License, or | |
| 16 /// (at your option) any later version. | |
| 17 /// | |
| 18 /// This program is distributed in the hope that it will be useful, | |
| 19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 21 /// GNU General Public License for more details. | |
| 22 /// | |
| 23 /// You should have received a copy of the GNU General Public License | |
| 24 /// along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 25 ////////////////////////////////////////////////////////////////////////////// | |
| 26 | |
| 27 /* Define to prevent recursive inclusion -------------------------------------*/ | |
| 28 #ifndef OSTC_H | |
| 29 #define OSTC_H | |
| 30 | |
| 31 //#define OSTC_ON_DISCOVERY_HARDWARE | |
| 32 | |
| 33 /* Includes ------------------------------------------------------------------*/ | |
| 34 //#include "stm32f4xx_hal_conf.h" | |
| 35 #include "stm32f4xx_hal.h" | |
| 36 #include "stm32f4xx_hal_spi.h" | |
| 37 | |
| 38 #ifdef OSTC_ON_DISCOVERY_HARDWARE | |
| 39 #include "ostc_discovery.h" | |
| 40 #else | |
| 41 #include "ostc_hw2.h" | |
| 42 // #include "ostc_hw1.h" | |
| 43 #endif | |
| 44 | |
| 45 #define SDRAM_TIMEOUT ((uint32_t)0xFFFF) | |
| 46 #define SDRAM_MEMORY_WIDTH FMC_SDRAM_MEM_BUS_WIDTH_16 | |
| 47 #define SDCLOCK_PERIOD FMC_SDRAM_CLOCK_PERIOD_3 | |
| 48 #define SDRAM_MODEREG_BURST_LENGTH_1 ((uint16_t)0x0000) | |
| 49 #define SDRAM_MODEREG_BURST_LENGTH_2 ((uint16_t)0x0001) | |
| 50 #define SDRAM_MODEREG_BURST_LENGTH_4 ((uint16_t)0x0002) | |
| 51 #define SDRAM_MODEREG_BURST_LENGTH_8 ((uint16_t)0x0004) | |
| 52 #define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL ((uint16_t)0x0000) | |
| 53 #define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED ((uint16_t)0x0008) | |
| 54 #define SDRAM_MODEREG_CAS_LATENCY_2 ((uint16_t)0x0020) | |
| 55 #define SDRAM_MODEREG_CAS_LATENCY_3 ((uint16_t)0x0030) | |
| 56 #define SDRAM_MODEREG_OPERATING_MODE_STANDARD ((uint16_t)0x0000) | |
| 57 #define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000) | |
| 58 #define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE ((uint16_t)0x0200) | |
| 59 | |
|
885
8d3f3a635397
Replaced global hardwareDisplay with unit access:
Ideenmodellierer
parents:
871
diff
changeset
|
60 #define DISPLAY_VERSION_LCD (0u) |
|
8d3f3a635397
Replaced global hardwareDisplay with unit access:
Ideenmodellierer
parents:
871
diff
changeset
|
61 #define DISPLAY_VERSION_NEW (1u) |
|
8d3f3a635397
Replaced global hardwareDisplay with unit access:
Ideenmodellierer
parents:
871
diff
changeset
|
62 |
|
1033
5f66e44d69f0
Added functionality needed for subscription of standard Bluetooth pulse service notifications
Ideenmodellierer
parents:
1032
diff
changeset
|
63 #define CHUNK_SIZE (160u) /* the DMA will handle chunk size transfers */ |
| 1032 | 64 #define CHUNKS_PER_BUFFER (3u) |
| 65 | |
| 66 | |
| 38 | 67 /* Exported variables --------------------------------------------------------*/ |
| 68 | |
| 69 extern SPI_HandleTypeDef hspiDisplay; | |
| 70 extern SPI_HandleTypeDef cpu2DmaSpi; | |
| 71 | |
| 72 extern UART_HandleTypeDef UartHandle; | |
| 73 extern __IO ITStatus UartReady; | |
| 74 | |
| 75 | |
| 76 #ifdef USART_IR_HUD | |
| 77 extern UART_HandleTypeDef UartIR_HUD_Handle; | |
| 78 #endif | |
| 79 | |
| 80 #ifdef USART_PIEZO | |
| 81 extern UART_HandleTypeDef UartPiezoTxHandle; | |
| 82 #endif | |
| 83 | |
| 84 /* Exported functions --------------------------------------------------------*/ | |
| 85 | |
| 86 void MX_SPI_Init(void); | |
| 87 void MX_GPIO_Init(void); | |
| 88 void MX_UART_Init(void); | |
| 1032 | 89 void MX_UART_BT_Init_DMA(); |
| 38 | 90 uint8_t MX_UART_ButtonAdjust(uint8_t *array); |
| 91 | |
| 92 void MX_SmallCPU_Reset_To_Boot(void); | |
| 93 void MX_SmallCPU_Reset_To_Standard(void); | |
| 94 void MX_SmallCPU_NO_Reset_Helper(void); | |
| 95 | |
| 96 void MX_tell_reset_logik_alles_ok(void); | |
| 97 | |
| 98 void MX_Bluetooth_PowerOn(void); | |
| 99 void MX_Bluetooth_PowerOff(void); | |
| 100 | |
| 101 void MX_GPIO_Backlight_max_static_only_Init(void); | |
| 102 | |
| 103 void MX_GPIO_One_Button_only_Init(void); | |
| 104 GPIO_PinState MX_GPIO_Read_The_One_Button(void); | |
| 105 | |
| 106 void MX_TestPin_High(void); | |
| 107 void MX_TestPin_Low(void); | |
| 108 | |
|
885
8d3f3a635397
Replaced global hardwareDisplay with unit access:
Ideenmodellierer
parents:
871
diff
changeset
|
109 void SetDisplayVersion(uint8_t version); |
|
8d3f3a635397
Replaced global hardwareDisplay with unit access:
Ideenmodellierer
parents:
871
diff
changeset
|
110 uint8_t isNewDisplay(void); |
|
8d3f3a635397
Replaced global hardwareDisplay with unit access:
Ideenmodellierer
parents:
871
diff
changeset
|
111 |
| 1032 | 112 uint8_t UART_getChar(); |
| 1036 | 113 |
| 114 #ifdef ENABLE_PULSE_SENSOR_BT | |
| 1032 | 115 void UART_StartDMARx(); |
| 1036 | 116 #endif |
| 117 #ifdef ENABLE_USART_RADIO | |
| 118 void MX_UART_RADIO_Init_DMA(); | |
| 119 void UART_StartDMARxRadio(); | |
| 120 #endif | |
| 1032 | 121 |
| 38 | 122 |
| 123 #endif // OSTC_H |
