20 Commits
vde24 ... 2024

Author SHA1 Message Date
59262443c9 add env file 2025-01-31 15:06:24 +01:00
25da5cde32 Fix dumb config typo 2024-07-24 09:35:22 +02:00
10aa474124 Fix DRS 2024-07-23 15:13:22 +02:00
5fb5d271b1 Fix display issues and inc logic 2024-07-22 19:35:23 +02:00
a4bea0d78b add commit hash (manual!) 2024-07-22 19:32:24 +02:00
a07d51f223 Add most recent params for FT24 2024-07-22 08:43:42 +02:00
555a114ae5 Fix buttons 2024-07-21 20:57:24 +02:00
6db74c2242 Fix TouchGFX again again (upgrade to 24) 2024-07-21 19:25:19 +02:00
a32d497074 Fix TouchGFX again 2024-07-21 16:30:53 +02:00
0f5cfe56a9 Add VDE 2024-07-21 15:51:22 +02:00
f5027348d7 Add new fonts 2024-07-21 15:20:09 +02:00
7c44186d0a Merge remote-tracking branch 'origin/develop' into develop-gfx, compilation works 2024-07-21 15:19:53 +02:00
3208c8f86f Fix TouchGFX and update UI 2024-07-21 14:34:44 +02:00
51f6fa6014 Add Inter Fonts 2024-06-12 13:27:38 +02:00
b0ef96e390 GFX Develop Branch 2024-06-11 19:38:14 +02:00
e60baabf85 Add DRS paddle switch as PF14 2024-06-05 16:57:13 +02:00
19f51f13c4 Revert changes 2024-06-05 17:49:54 +02:00
6d92da3a10 add mock buttons 2024-05-23 21:33:52 +02:00
9ef44b8ebb Add code for constant CAN message sending 2024-05-23 21:25:35 +02:00
3f67d1571b Update submodule 2024-05-23 17:50:40 +02:00
1107 changed files with 121326 additions and 4356 deletions

5
.gitmodules vendored
View File

@ -1,8 +1,3 @@
[submodule "Core/Lib/FT_CAN_AL"]
path = Core/Lib/can-halal
url = ssh://git@git.fasttube.de:313/FaSTTUBe/FT_CAN_AL.git
[submodule "Core/Lib/can-halal/"]
url = ssh://git@git.fasttube.de:313/FaSTTUBe/can-halal.git
[submodule "Core/Lib/can-halal"]
path = Core/Lib/can-halal
url = ssh://git@git.fasttube.de:313/FaSTTUBe/can-halal.git

7
.stm32env Normal file
View File

@ -0,0 +1,7 @@
# environment variable file used by stm32-for-vscode and the STM32Make.make makefile
# Other environment variables can be added here. If wanting to use the generated makefile in CI/CD context please
# configure the following variables: GCC_PATH, OPENOCD
ARM_GCC_PATH = /Applications/ArmGNUToolchain/13.2.Rel1/arm-none-eabi/bin
OPENOCD = /opt/homebrew/bin/openocd

View File

@ -24,7 +24,7 @@
/* Defines ------------------------------------------------------------------*/
/* STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0 */
#define THREADX_ENABLED
/* STMicroelectronics.X-CUBE-TOUCHGFX.4.22.0 */
/* STMicroelectronics.X-CUBE-TOUCHGFX.4.24.0 */
#define TOUCHGFX_APP
#endif /* __RTE_COMPONENTS_H__ */

View File

@ -10,17 +10,15 @@ extern "C" {
#include "util.h"
CountedEnum(ParamType, size_t, PF_BBAL, PF_SLIPREF, PF_MUMAX, PF_ASRP, PF_ASRON,
PF_ASRI, PF_PLIM);
CountedEnum(ParamType, size_t, PF_PLIM, PF_TLIM, PF_SLIM, PF_TVEC, PF_PG, PF_REKU);
typedef struct {
float bbal;
float slipref;
float mumax;
unsigned asrp;
unsigned asri;
unsigned asron;
unsigned plim;
unsigned plim; //< Power limit
unsigned tlim; //< Torque limit
unsigned slim; //< Speed limit
unsigned tvec; //< Torque vectoring
unsigned pg; //< Power ground
unsigned reku; //< Rekuperation
} Params;
extern Params params;

View File

@ -17,15 +17,12 @@
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "app_threadx.h"
#include "main.h"
#include "app_touchgfx.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdint.h>
#include "ft_logo_orange_rgb565.h"
#include "ft_logo_rainbow_rgb565.h"
#include "hx8357d.h"
@ -33,6 +30,8 @@
#include "params.h"
#include "shorttimer.h"
#include <stdint.h>
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@ -101,18 +100,19 @@ static void MX_DMA2D_Init(void);
/* USER CODE END 0 */
/**
* @brief The application entry point.
* @retval int
*/
int main(void) {
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick.
*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
@ -170,10 +170,11 @@ int main(void) {
}
/**
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void) {
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
@ -181,19 +182,18 @@ void SystemClock_Config(void) {
RCC->CKGAENR = 0xFFFFFFFF;
/** Supply configuration update enable
*/
*/
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
/** Configure the main internal regulator output voltage
*/
*/
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {
}
while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
@ -206,15 +206,16 @@ void SystemClock_Config(void) {
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_3;
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
RCC_OscInitStruct.PLL.PLLFRACN = 0;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** Initializes the CPU, AHB and APB buses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK |
RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2 |
RCC_CLOCKTYPE_D3PCLK1 | RCC_CLOCKTYPE_D1PCLK1;
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
|RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV1;
@ -223,17 +224,20 @@ void SystemClock_Config(void) {
RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) {
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK)
{
Error_Handler();
}
}
/**
* @brief CRC Initialization Function
* @param None
* @retval None
*/
static void MX_CRC_Init(void) {
* @brief CRC Initialization Function
* @param None
* @retval None
*/
static void MX_CRC_Init(void)
{
/* USER CODE BEGIN CRC_Init 0 */
/* USER CODE END CRC_Init 0 */
@ -247,20 +251,24 @@ static void MX_CRC_Init(void) {
hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
if (HAL_CRC_Init(&hcrc) != HAL_OK) {
if (HAL_CRC_Init(&hcrc) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN CRC_Init 2 */
/* USER CODE END CRC_Init 2 */
}
/**
* @brief DMA2D Initialization Function
* @param None
* @retval None
*/
static void MX_DMA2D_Init(void) {
* @brief DMA2D Initialization Function
* @param None
* @retval None
*/
static void MX_DMA2D_Init(void)
{
/* USER CODE BEGIN DMA2D_Init 0 */
/* USER CODE END DMA2D_Init 0 */
@ -279,23 +287,28 @@ static void MX_DMA2D_Init(void) {
hdma2d.LayerCfg[1].AlphaInverted = DMA2D_REGULAR_ALPHA;
hdma2d.LayerCfg[1].RedBlueSwap = DMA2D_RB_REGULAR;
hdma2d.LayerCfg[1].ChromaSubSampling = DMA2D_NO_CSS;
if (HAL_DMA2D_Init(&hdma2d) != HAL_OK) {
if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
{
Error_Handler();
}
if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK) {
if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN DMA2D_Init 2 */
/* USER CODE END DMA2D_Init 2 */
}
/**
* @brief FDCAN1 Initialization Function
* @param None
* @retval None
*/
static void MX_FDCAN1_Init(void) {
* @brief FDCAN1 Initialization Function
* @param None
* @retval None
*/
static void MX_FDCAN1_Init(void)
{
/* USER CODE BEGIN FDCAN1_Init 0 */
/* USER CODE END FDCAN1_Init 0 */
@ -331,20 +344,24 @@ static void MX_FDCAN1_Init(void) {
hfdcan1.Init.TxFifoQueueElmtsNbr = 1;
hfdcan1.Init.TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
hfdcan1.Init.TxElmtSize = FDCAN_DATA_BYTES_8;
if (HAL_FDCAN_Init(&hfdcan1) != HAL_OK) {
if (HAL_FDCAN_Init(&hfdcan1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN FDCAN1_Init 2 */
/* USER CODE END FDCAN1_Init 2 */
}
/**
* @brief JPEG Initialization Function
* @param None
* @retval None
*/
static void MX_JPEG_Init(void) {
* @brief JPEG Initialization Function
* @param None
* @retval None
*/
static void MX_JPEG_Init(void)
{
/* USER CODE BEGIN JPEG_Init 0 */
/* USER CODE END JPEG_Init 0 */
@ -353,20 +370,24 @@ static void MX_JPEG_Init(void) {
/* USER CODE END JPEG_Init 1 */
hjpeg.Instance = JPEG;
if (HAL_JPEG_Init(&hjpeg) != HAL_OK) {
if (HAL_JPEG_Init(&hjpeg) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN JPEG_Init 2 */
/* USER CODE END JPEG_Init 2 */
}
/**
* @brief LTDC Initialization Function
* @param None
* @retval None
*/
static void MX_LTDC_Init(void) {
* @brief LTDC Initialization Function
* @param None
* @retval None
*/
static void MX_LTDC_Init(void)
{
/* USER CODE BEGIN LTDC_Init 0 */
/* USER CODE END LTDC_Init 0 */
@ -392,7 +413,8 @@ static void MX_LTDC_Init(void) {
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK) {
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
@ -410,20 +432,24 @@ static void MX_LTDC_Init(void) {
pLayerCfg.Backcolor.Blue = 0;
pLayerCfg.Backcolor.Green = 0;
pLayerCfg.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK) {
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LTDC_Init 2 */
/* USER CODE END LTDC_Init 2 */
}
/**
* @brief OCTOSPI1 Initialization Function
* @param None
* @retval None
*/
static void MX_OCTOSPI1_Init(void) {
* @brief OCTOSPI1 Initialization Function
* @param None
* @retval None
*/
static void MX_OCTOSPI1_Init(void)
{
/* USER CODE BEGIN OCTOSPI1_Init 0 */
/* USER CODE END OCTOSPI1_Init 0 */
@ -450,27 +476,31 @@ static void MX_OCTOSPI1_Init(void) {
hospi1.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_BYPASSED;
hospi1.Init.MaxTran = 0;
hospi1.Init.Refresh = 0;
if (HAL_OSPI_Init(&hospi1) != HAL_OK) {
if (HAL_OSPI_Init(&hospi1) != HAL_OK)
{
Error_Handler();
}
sOspiManagerCfg.ClkPort = 1;
sOspiManagerCfg.NCSPort = 1;
sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg,
HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) {
if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN OCTOSPI1_Init 2 */
/* USER CODE END OCTOSPI1_Init 2 */
}
/**
* @brief SPI3 Initialization Function
* @param None
* @retval None
*/
static void MX_SPI3_Init(void) {
* @brief SPI3 Initialization Function
* @param None
* @retval None
*/
static void MX_SPI3_Init(void)
{
/* USER CODE BEGIN SPI3_Init 0 */
/* USER CODE END SPI3_Init 0 */
@ -494,29 +524,31 @@ static void MX_SPI3_Init(void) {
hspi3.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
hspi3.Init.NSSPolarity = SPI_NSS_POLARITY_LOW;
hspi3.Init.FifoThreshold = SPI_FIFO_THRESHOLD_01DATA;
hspi3.Init.TxCRCInitializationPattern =
SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;
hspi3.Init.RxCRCInitializationPattern =
SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;
hspi3.Init.TxCRCInitializationPattern = SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;
hspi3.Init.RxCRCInitializationPattern = SPI_CRC_INITIALIZATION_ALL_ZERO_PATTERN;
hspi3.Init.MasterSSIdleness = SPI_MASTER_SS_IDLENESS_00CYCLE;
hspi3.Init.MasterInterDataIdleness = SPI_MASTER_INTERDATA_IDLENESS_00CYCLE;
hspi3.Init.MasterReceiverAutoSusp = SPI_MASTER_RX_AUTOSUSP_DISABLE;
hspi3.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_DISABLE;
hspi3.Init.IOSwap = SPI_IO_SWAP_DISABLE;
if (HAL_SPI_Init(&hspi3) != HAL_OK) {
if (HAL_SPI_Init(&hspi3) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN SPI3_Init 2 */
/* USER CODE END SPI3_Init 2 */
}
/**
* @brief TIM1 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM1_Init(void) {
* @brief TIM1 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM1_Init(void)
{
/* USER CODE BEGIN TIM1_Init 0 */
/* USER CODE END TIM1_Init 0 */
@ -536,20 +568,24 @@ static void MX_TIM1_Init(void) {
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim1.Init.RepetitionCounter = 0;
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim1) != HAL_OK) {
if (HAL_TIM_Base_Init(&htim1) != HAL_OK)
{
Error_Handler();
}
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) {
if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK)
{
Error_Handler();
}
if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) {
if (HAL_TIM_PWM_Init(&htim1) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) {
if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}
sConfigOC.OCMode = TIM_OCMODE_PWM1;
@ -559,13 +595,16 @@ static void MX_TIM1_Init(void) {
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET;
sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET;
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) {
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
{
Error_Handler();
}
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2) != HAL_OK) {
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
{
Error_Handler();
}
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) {
if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK)
{
Error_Handler();
}
sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
@ -579,21 +618,25 @@ static void MX_TIM1_Init(void) {
sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH;
sBreakDeadTimeConfig.Break2Filter = 0;
sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) {
if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN TIM1_Init 2 */
/* USER CODE END TIM1_Init 2 */
HAL_TIM_MspPostInit(&htim1);
}
/**
* @brief TIM2 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM2_Init(void) {
* @brief TIM2 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM2_Init(void)
{
/* USER CODE BEGIN TIM2_Init 0 */
/* USER CODE END TIM2_Init 0 */
@ -611,40 +654,48 @@ static void MX_TIM2_Init(void) {
htim2.Init.Period = 99;
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim2) != HAL_OK) {
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
{
Error_Handler();
}
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) {
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
{
Error_Handler();
}
if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) {
if (HAL_TIM_PWM_Init(&htim2) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) {
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}
sConfigOC.OCMode = TIM_OCMODE_PWM1;
sConfigOC.Pulse = 100;
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_4) != HAL_OK) {
if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_4) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN TIM2_Init 2 */
/* USER CODE END TIM2_Init 2 */
HAL_TIM_MspPostInit(&htim2);
}
/**
* @brief TIM4 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM4_Init(void) {
* @brief TIM4 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM4_Init(void)
{
/* USER CODE BEGIN TIM4_Init 0 */
/* USER CODE END TIM4_Init 0 */
@ -661,36 +712,43 @@ static void MX_TIM4_Init(void) {
htim4.Init.Period = 65535;
htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim4.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_PWM_Init(&htim4) != HAL_OK) {
if (HAL_TIM_PWM_Init(&htim4) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK) {
if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}
sConfigOC.OCMode = TIM_OCMODE_PWM1;
sConfigOC.Pulse = 0;
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
if (HAL_TIM_PWM_ConfigChannel(&htim4, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) {
if (HAL_TIM_PWM_ConfigChannel(&htim4, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
{
Error_Handler();
}
if (HAL_TIM_PWM_ConfigChannel(&htim4, &sConfigOC, TIM_CHANNEL_2) != HAL_OK) {
if (HAL_TIM_PWM_ConfigChannel(&htim4, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN TIM4_Init 2 */
/* USER CODE END TIM4_Init 2 */
HAL_TIM_MspPostInit(&htim4);
}
/**
* @brief TIM17 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM17_Init(void) {
* @brief TIM17 Initialization Function
* @param None
* @retval None
*/
static void MX_TIM17_Init(void)
{
/* USER CODE BEGIN TIM17_Init 0 */
/* USER CODE END TIM17_Init 0 */
@ -699,24 +757,28 @@ static void MX_TIM17_Init(void) {
/* USER CODE END TIM17_Init 1 */
htim17.Instance = TIM17;
htim17.Init.Prescaler = 16 - 1;
htim17.Init.Prescaler = 16-1;
htim17.Init.CounterMode = TIM_COUNTERMODE_UP;
htim17.Init.Period = 1000 - 1;
htim17.Init.Period = 1000-1;
htim17.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim17.Init.RepetitionCounter = 0;
htim17.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_Base_Init(&htim17) != HAL_OK) {
if (HAL_TIM_Base_Init(&htim17) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN TIM17_Init 2 */
/* USER CODE END TIM17_Init 2 */
}
/**
* Enable DMA controller clock
*/
static void MX_DMA_Init(void) {
* Enable DMA controller clock
*/
static void MX_DMA_Init(void)
{
/* DMA controller clock enable */
__HAL_RCC_DMA1_CLK_ENABLE();
@ -724,17 +786,19 @@ static void MX_DMA_Init(void) {
/* DMA1_Stream0_IRQn interrupt configuration */
HAL_NVIC_SetPriority(DMA1_Stream0_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(DMA1_Stream0_IRQn);
}
/**
* @brief GPIO Initialization Function
* @param None
* @retval None
*/
static void MX_GPIO_Init(void) {
* @brief GPIO Initialization Function
* @param None
* @retval None
*/
static void MX_GPIO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
/* USER CODE BEGIN MX_GPIO_Init_1 */
/* USER CODE END MX_GPIO_Init_1 */
/* USER CODE BEGIN MX_GPIO_Init_1 */
/* USER CODE END MX_GPIO_Init_1 */
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOE_CLK_ENABLE();
@ -747,38 +811,33 @@ static void MX_GPIO_Init(void) {
__HAL_RCC_GPIOG_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(
GPIOA, STATUS1_Pin | STATUS2_Pin | DISPSPI_SCL_Pin | DISPSPI_SDA_Pin,
GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOA, STATUS1_Pin|STATUS2_Pin|DISPSPI_SCL_Pin|DISPSPI_SDA_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(LED_LE_GPIO_Port, LED_LE_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOG, DISPSPI_CSX_Pin | DISPSPI_DCX_Pin | DISP_RESET_Pin,
GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOG, DISPSPI_CSX_Pin|DISPSPI_DCX_Pin|DISP_RESET_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(BOOT0_SET_GPIO_Port, BOOT0_SET_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : ENC1A_Pin ENC1B_Pin ENC2A_Pin ENC2B_Pin */
GPIO_InitStruct.Pin = ENC1A_Pin | ENC1B_Pin | ENC2A_Pin | ENC2B_Pin;
GPIO_InitStruct.Pin = ENC1A_Pin|ENC1B_Pin|ENC2A_Pin|ENC2B_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
/*Configure GPIO pins : BTN1_Pin BTN2_Pin BTN3_Pin BTN4_Pin
BTN5_Pin BTN6_Pin SW_DRS_Pin */
GPIO_InitStruct.Pin = BTN1_Pin | BTN2_Pin | BTN3_Pin | BTN4_Pin | BTN5_Pin |
BTN6_Pin | SW_DRS_Pin;
GPIO_InitStruct.Pin = BTN1_Pin|BTN2_Pin|BTN3_Pin|BTN4_Pin
|BTN5_Pin|BTN6_Pin|SW_DRS_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
/*Configure GPIO pins : STATUS1_Pin STATUS2_Pin DISPSPI_SCL_Pin
* DISPSPI_SDA_Pin */
GPIO_InitStruct.Pin =
STATUS1_Pin | STATUS2_Pin | DISPSPI_SCL_Pin | DISPSPI_SDA_Pin;
/*Configure GPIO pins : STATUS1_Pin STATUS2_Pin DISPSPI_SCL_Pin DISPSPI_SDA_Pin */
GPIO_InitStruct.Pin = STATUS1_Pin|STATUS2_Pin|DISPSPI_SCL_Pin|DISPSPI_SDA_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
@ -792,7 +851,7 @@ static void MX_GPIO_Init(void) {
HAL_GPIO_Init(LED_LE_GPIO_Port, &GPIO_InitStruct);
/*Configure GPIO pins : DISPSPI_CSX_Pin DISPSPI_DCX_Pin DISP_RESET_Pin */
GPIO_InitStruct.Pin = DISPSPI_CSX_Pin | DISPSPI_DCX_Pin | DISP_RESET_Pin;
GPIO_InitStruct.Pin = DISPSPI_CSX_Pin|DISPSPI_DCX_Pin|DISP_RESET_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
@ -815,8 +874,8 @@ static void MX_GPIO_Init(void) {
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
/* USER CODE BEGIN MX_GPIO_Init_2 */
/* USER CODE END MX_GPIO_Init_2 */
/* USER CODE BEGIN MX_GPIO_Init_2 */
/* USER CODE END MX_GPIO_Init_2 */
}
/* USER CODE BEGIN 4 */
@ -827,14 +886,15 @@ extern "C" {
/* USER CODE END 4 */
/**
* @brief Period elapsed callback in non blocking mode
* @note This function is called when TIM6 interrupt took place, inside
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
* a global variable "uwTick" used as application time base.
* @param htim : TIM handle
* @retval None
*/
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
* @brief Period elapsed callback in non blocking mode
* @note This function is called when TIM6 interrupt took place, inside
* HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
* a global variable "uwTick" used as application time base.
* @param htim : TIM handle
* @retval None
*/
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
/* USER CODE BEGIN Callback 0 */
/* USER CODE END Callback 0 */
@ -849,10 +909,11 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
}
/**
* @brief This function is executed in case of error occurrence.
* @retval None
*/
void Error_Handler(void) {
* @brief This function is executed in case of error occurrence.
* @retval None
*/
void Error_Handler(void)
{
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq();
@ -868,15 +929,16 @@ void _damnyoucubemx() {
/* USER CODE END Error_Handler_Debug */
}
#ifdef USE_FULL_ASSERT
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line) {
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t *file, uint32_t line)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line
number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file,

View File

@ -2,103 +2,100 @@
#include "can-halal.h"
#include "vehicle.h"
/**
* Decrements the given value if it is above the minimum allowed value
*/
// TODO these functions take into account that the parameters are unsigned, it's definitely better to have them
// signed but would need to be tested with the autobox
#define DEC_IF_ABOVE(param_val, min_val, decr_amt) ((param_val) = (((int)(param_val) - (int)(decr_amt)) > (int)(min_val)) ? ((param_val) - (decr_amt)) : (min_val))
#define INC_IF_BELOW(param_val, max_val, incr_amt) ((param_val) = (((param_val) + (incr_amt)) < (max_val)) ? ((param_val) + (incr_amt)) : (max_val))
Params params = {0};
void params_init() {
params.bbal = 50;
void params_init()
{
// Default values
params.plim = 20;
params.tlim = 1400;
params.slim = 70;
params.tvec = 50;
params.pg = 0;
params.reku = 0;
}
void params_inc(ParamType param) {
switch (param) {
case PF_BBAL:
params.bbal += 0.5f;
if (params.bbal > 100.0f) {
params.bbal = 100.0f;
}
break;
case PF_SLIPREF:
params.slipref += 0.01f;
break;
case PF_MUMAX:
params.mumax += 0.1f;
break;
case PF_ASRP:
params.asrp++;
break;
case PF_ASRI:
params.asri++;
break;
case PF_ASRON:
params.asron = 1;
break;
void params_inc(ParamType param)
{
switch (param)
{
case PF_PLIM:
params.plim = (params.plim < 80) ? params.plim + 1 : 80;
INC_IF_BELOW(params.plim, 80, 1);
break;
case PF_TLIM:
INC_IF_BELOW(params.tlim, 1500, 100);
break;
case PF_SLIM:
INC_IF_BELOW(params.slim, 100, 1);
break;
case PF_TVEC:
INC_IF_BELOW(params.tvec, 100, 1);
break;
case PF_PG:
INC_IF_BELOW(params.pg, 100, 1);
break;
case PF_REKU:
INC_IF_BELOW(params.reku, 100, 1);
break;
}
}
void params_dec(ParamType param) {
switch (param) {
case PF_BBAL:
params.bbal -= 0.5f;
if (params.bbal < 0.0f) {
params.bbal = 0.0f;
}
break;
case PF_SLIPREF:
if (params.slipref > 0) {
params.slipref -= 0.01f;
}
break;
case PF_MUMAX:
if (params.mumax > 0) {
params.mumax -= 0.1f;
}
break;
case PF_ASRP:
if (params.asrp > 0) {
params.asrp--;
}
break;
case PF_ASRI:
if (params.asri > 0) {
params.asri--;
}
break;
case PF_ASRON:
params.asron = 0;
break;
void params_dec(ParamType param)
{
switch (param)
{
case PF_PLIM:
params.plim = (params.plim > 2) ? params.plim - 1 : 2;
DEC_IF_ABOVE(params.plim, 0, 1);
break;
case PF_TLIM:
DEC_IF_ABOVE(params.tlim, 0, 100);
break;
case PF_SLIM:
DEC_IF_ABOVE(params.slim, 0, 1);
break;
case PF_TVEC:
DEC_IF_ABOVE(params.tvec, 0, 1);
break;
case PF_PG:
DEC_IF_ABOVE(params.pg, 0, 1);
break;
case PF_REKU:
DEC_IF_ABOVE(params.reku, 0, 1);
break;
}
}
void params_broadcast(ParamType param) {
void params_broadcast(ParamType param)
{
int32_t value;
switch (param) {
case PF_BBAL:
value = params.bbal * 10;
break;
case PF_SLIPREF:
value = params.slipref * 100;
break;
case PF_MUMAX:
value = params.mumax * 10;
break;
case PF_ASRP:
value = params.asrp;
break;
case PF_ASRI:
value = params.asri;
break;
case PF_ASRON:
value = params.asron;
break;
switch (param)
{
case PF_PLIM:
value = params.plim;
break;
case PF_TLIM:
value = params.tlim;
break;
case PF_SLIM:
value = params.slim;
break;
case PF_TVEC:
value = params.tvec;
break;
case PF_PG:
value = params.pg;
break;
case PF_REKU:
value = params.reku;
break;
default:
return;
}

View File

@ -3,7 +3,6 @@
#include <stdint.h>
#include "hx8357d.h"
#include "leds.h"
#include "main.h"
#include "stm32h7a3xx.h"
#include "stm32h7xx_hal.h"
@ -11,12 +10,18 @@
#include "tx_api.h"
#include "vehicle.h"
#include "leds.h"
#define DRS_BUTTON_IDX (6)
#define DRS_PRESS_WAIT_CYCLES (1000)
static int drs_press_buf_cycles = 0;
void ui_thread_entry(ULONG _) {
GPIO_TypeDef *button_ports[NUM_BUTTONS] = {
BTN1_GPIO_Port, BTN2_GPIO_Port, BTN3_GPIO_Port, BTN4_GPIO_Port,
BTN5_GPIO_Port, BTN6_GPIO_Port, SW_DRS_GPIO_Port};
uint16_t button_pins[NUM_BUTTONS] = {BTN1_Pin, BTN2_Pin, BTN3_Pin, BTN4_Pin,
BTN5_Pin, BTN6_Pin, SW_DRS_Pin};
GPIO_TypeDef *button_ports[NUM_BUTTONS] = {BTN1_GPIO_Port, BTN2_GPIO_Port,
BTN3_GPIO_Port, BTN4_GPIO_Port,
BTN5_GPIO_Port, BTN6_GPIO_Port, SW_DRS_GPIO_Port};
uint16_t button_pins[NUM_BUTTONS] = {BTN1_Pin, BTN2_Pin, BTN3_Pin,
BTN4_Pin, BTN5_Pin, BTN6_Pin, SW_DRS_Pin};
GPIO_PinState button_states[NUM_BUTTONS] = {GPIO_PIN_RESET};
uint32_t button_press_times[NUM_BUTTONS] = {HAL_GetTick()};
@ -45,11 +50,19 @@ void ui_thread_entry(ULONG _) {
tx_event_flags_set(&gui_update_events, GUI_UPDATE_NEXT_SCREEN, TX_OR);
}
if (button_states[6] == GPIO_PIN_SET) {
led_start_animation(ANIM_RAINBOW);
if (button_states[DRS_BUTTON_IDX] == GPIO_PIN_SET) {
// Set leftmost led to blue to indicate DRS activation
drs_press_buf_cycles = DRS_PRESS_WAIT_CYCLES;
led_set(0, 0, 0, 255);
} if (drs_press_buf_cycles < 0) {
// Assume no longer active, turn off
led_set(0, 0, 0, 0);
} else if (drs_press_buf_cycles >= 0) {
drs_press_buf_cycles--;
}
vehicle_broadcast_buttons(button_states);
// Release so other threads can get scheduled
tx_thread_sleep(1);
}

View File

@ -76,12 +76,6 @@ void vehicle_thread_entry(ULONG hfdcan_addr) {
ftcan_add_filter(CAN_ID_SHUNT_VOLTAGE1, 0x7FF);
ftcan_add_filter(CAN_ID_SHUNT_VOLTAGE2, 0x7FF);
// TODO remove once rot encoder works
tx_thread_sleep(10);
vehicle_state.active_mission = MISSION_MANUAL;
tx_event_flags_set(&gui_update_events, GUI_UPDATE_VEHICLE_STATE, TX_OR);
// end TODO
while (1) {
tx_thread_sleep(10);
}

View File

@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Wed Jun 12 20:10:39 CEST 2024]
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Sun Jul 21 18:35:39 CEST 2024]
##########################################################################################################################
# ------------------------------------------------
@ -39,34 +39,6 @@ C_SOURCES = \
Core/Src/main.c \
Core/Src/stm32h7xx_it.c \
Core/Src/stm32h7xx_hal_msp.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma2d.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_fdcan.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_jpeg.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_ltdc.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_ltdc_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_ospi.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c \
Core/Src/system_stm32h7xx.c \
Utilities/JPEG/jpeg_utils.c \
Core/Src/app_threadx.c \
Core/Src/stm32h7xx_hal_timebase_tim.c \
AZURE_RTOS/App/app_azure_rtos.c \
@ -226,9 +198,6 @@ Middlewares/ST/threadx/common/src/txe_timer_create.c \
Middlewares/ST/threadx/common/src/txe_timer_deactivate.c \
Middlewares/ST/threadx/common/src/txe_timer_delete.c \
Middlewares/ST/threadx/common/src/txe_timer_info_get.c \
TouchGFX/App/app_touchgfx.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc_ex.c
TouchGFX/target/TouchGFXHAL.cpp \
TouchGFX/target/STM32TouchController.cpp \
TouchGFX/target/TouchGFXGPIO.cpp \
@ -236,22 +205,53 @@ TouchGFX/target/generated/TouchGFXConfiguration.cpp \
TouchGFX/target/generated/TouchGFXGeneratedHAL.cpp \
TouchGFX/target/generated/STM32DMA.cpp \
TouchGFX/target/generated/OSWrappers.cpp \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_crc_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_exti.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma2d.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_fdcan.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_jpeg.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_ltdc.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_ltdc_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_ospi.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi_ex.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c \
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c \
Core/Src/system_stm32h7xx.c \
Utilities/JPEG/jpeg_utils.c \
Core/Src/sysmem.c \
Core/Src/syscalls.c
Core/Src/syscalls.c \
TouchGFX/App/app_touchgfx.c
# ASM sources
ASM_SOURCES = \
startup_stm32h7a3xx.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_misra.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_context_restore.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_context_save.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_control.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_disable.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_restore.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_schedule.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_stack_build.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_system_return.s \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_timer_interrupt.s
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_misra.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_context_restore.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_context_save.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_control.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_disable.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_interrupt_restore.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_schedule.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_stack_build.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_system_return.S \
Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_timer_interrupt.S
#######################################
@ -346,6 +346,7 @@ LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BU
# default action: build all
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
@echo OBJECTS
#######################################

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -310,6 +310,12 @@ public:
*/
void enableDecompressorL8_LZW9();
/**
* Enables the decompressor for RGB images compressed with the QOI algorithm.
* This allows drawing compressed RGB images.
*/
void enableDecompressorRGB();
protected:
virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha);
@ -876,6 +882,17 @@ private:
virtual void blitCopyRGB888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorRGBBase
{
public:
virtual ~DecompressorRGBBase()
{
}
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorL8_L4 : public DecompressorL8Base
{
public:
@ -918,6 +935,25 @@ private:
DecompressorL8Base* decompressorL8_L4;
DecompressorL8Base* decompressorL8_RLE;
DecompressorL8Base* decompressorL8_LZW9;
class DecompressorRGB_QOI : public DecompressorRGBBase
{
public:
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
private:
static const uint16_t BLOCK_SIZE = 1024U;
static const uint16_t INDEX_TABLE_SIZE = 64U;
union
{
PixelRGB565 indexTable16[INDEX_TABLE_SIZE];
PixelARGB8888 indexTable32[INDEX_TABLE_SIZE];
};
};
DecompressorRGBBase* decompressorRGB_QOI;
};
} // namespace touchgfx

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -315,6 +315,12 @@ public:
*/
void enableDecompressorL8_LZW9();
/**
* Enables the decompressor for RGB images compressed with the QOI algorithm.
* This allows drawing compressed RGB images.
*/
void enableDecompressorRGB();
protected:
virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha);
@ -878,6 +884,17 @@ private:
virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorRGBBase
{
public:
virtual ~DecompressorRGBBase()
{
}
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorL8_L4 : public DecompressorL8Base
{
public:
@ -941,6 +958,33 @@ private:
DecompressorL8Base* decompressorL8_L4;
DecompressorL8Base* decompressorL8_RLE;
DecompressorL8Base* decompressorL8_LZW9;
class DecompressorRGB_QOI : public DecompressorRGBBase
{
public:
DecompressorRGB_QOI(FlashDataReader& _flashReader)
: flashDataProvider(_flashReader)
{
}
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
private:
FlashDataProvider flashDataProvider;
static const uint16_t BLOCK_SIZE = 1024U;
static const uint16_t INDEX_TABLE_SIZE = 64U;
union
{
PixelRGB565 indexTable16[INDEX_TABLE_SIZE];
PixelARGB8888 indexTable32[INDEX_TABLE_SIZE];
};
PixelRGB565 uniqueColorsBuffer[INDEX_TABLE_SIZE];
};
DecompressorRGBBase* decompressorRGB_QOI;
};
} // namespace touchgfx

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -241,6 +241,12 @@ public:
*/
void enableDecompressorL8_LZW9();
/**
* Enables the decompressor for RGB images compressed with the QOI algorithm.
* This allows drawing compressed RGB images.
*/
void enableDecompressorRGB();
protected:
virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha);
@ -620,6 +626,17 @@ private:
virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorRGBBase
{
public:
virtual ~DecompressorRGBBase()
{
}
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
virtual void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorL8_L4 : public DecompressorL8Base
{
public:
@ -665,6 +682,20 @@ private:
DecompressorL8Base* decompressorL8_L4;
DecompressorL8Base* decompressorL8_RLE;
DecompressorL8Base* decompressorL8_LZW9;
class DecompressorRGB_QOI : public DecompressorRGBBase
{
public:
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
virtual void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
private:
static const uint16_t BLOCK_SIZE = 1024U;
static const uint16_t INDEX_TABLE_SIZE = 64U;
PixelARGB8888 indexTable[INDEX_TABLE_SIZE];
};
DecompressorRGBBase* decompressorRGB_QOI;
};
} // namespace touchgfx

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -305,6 +305,12 @@ public:
*/
void enableDecompressorL8_LZW9();
/**
* Enables the decompressor for RGB images compressed with the QOI algorithm.
* This allows drawing compressed RGB images.
*/
void enableDecompressorRGB();
protected:
virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha);
@ -936,6 +942,18 @@ private:
virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorRGBBase
{
public:
virtual ~DecompressorRGBBase()
{
}
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
virtual void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorL8_L4 : public DecompressorL8Base
{
public:
@ -978,6 +996,26 @@ private:
DecompressorL8Base* decompressorL8_L4;
DecompressorL8Base* decompressorL8_RLE;
DecompressorL8Base* decompressorL8_LZW9;
class DecompressorRGB_QOI : public DecompressorRGBBase
{
public:
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
virtual void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
private:
static const uint16_t BLOCK_SIZE = 1024U;
static const uint16_t INDEX_TABLE_SIZE = 64U;
union
{
PixelRGB565 indexTable16[INDEX_TABLE_SIZE];
PixelARGB8888 indexTable32[INDEX_TABLE_SIZE];
};
};
DecompressorRGBBase* decompressorRGB_QOI;
};
} // namespace touchgfx

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -407,6 +407,12 @@ public:
*/
void enableDecompressorL8_LZW9();
/**
* Enables the decompressor for RGB images compressed with the QOI algorithm.
* This allows drawing compressed RGB images.
*/
void enableDecompressorRGB();
protected:
virtual DrawTextureMapScanLineBase* getTextureMapperDrawScanLine(const TextureSurface& texture, RenderingVariant renderVariant, uint8_t alpha);
@ -923,6 +929,18 @@ private:
virtual void blitCopyARGB8888(const uint8_t* sourceData, const uint8_t* clutData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorRGBBase
{
public:
virtual ~DecompressorRGBBase()
{
}
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
virtual void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha) = 0;
};
class DecompressorL8_L4 : public DecompressorL8Base
{
public:
@ -965,6 +983,26 @@ private:
DecompressorL8Base* decompressorL8_L4;
DecompressorL8Base* decompressorL8_RLE;
DecompressorL8Base* decompressorL8_LZW9;
class DecompressorRGB_QOI : public DecompressorRGBBase
{
public:
virtual void blitCopyRGB565(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
virtual void blitCopyARGB8888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
virtual void blitCopyRGB888(const uint8_t* sourceData, const Rect& source, const Rect& blitRect, uint8_t alpha);
private:
static const uint16_t BLOCK_SIZE = 1024U;
static const uint16_t INDEX_TABLE_SIZE = 64U;
union
{
PixelRGB565 indexTable16[INDEX_TABLE_SIZE];
PixelARGB8888 indexTable32[INDEX_TABLE_SIZE];
};
};
DecompressorRGBBase* decompressorRGB_QOI;
};
} // namespace touchgfx

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -36,6 +36,7 @@ typedef uint16_t BitmapId;
const BitmapId BITMAP_ANIMATION_STORAGE = 0xFFFEU; ///< A virtual id representing animation storage.
const BitmapId BITMAP_INVALID = 0xFFFFU; ///< Define the bitmapId of an invalid bitmap
static const uint16_t BLOCK_SIZE = 1024U; ///< Block size used for RGB decompression
/**
* This class provides a proxy object for a bitmap image stored in the application specific
@ -55,20 +56,23 @@ public:
/** Data of a bitmap can be stored in the following formats. */
enum BitmapFormat
{
RGB565, ///< 16-bit, 5 bits for red, 6 bits for green, 5 bits for blue. No alpha channel
RGB888, ///< 24-bit, 8 bits for each of red, green and blue. No alpha channel
ARGB8888, ///< 32-bit, 8 bits for each of red, green, blue and alpha channel
BW, ///< 1-bit, black / white. No alpha channel
BW_RLE, ///< 1-bit, black / white. No alpha channel. Image is compressed with horizontal RLE
GRAY2, ///< 2-bit grayscale
GRAY4, ///< 4-bit grayscale
ARGB2222, ///< 8-bit color
ABGR2222, ///< 8-bit color
RGBA2222, ///< 8-bit color
BGRA2222, ///< 8-bit color
L8, ///< 8-bit indexed color
A4, ///< 4-bit alpha level
CUSTOM ///< Non-standard platform specific format
RGB565, ///< 16-bit, 5 bits for red, 6 bits for green, 5 bits for blue. No alpha channel
RGB888, ///< 24-bit, 8 bits for each of red, green and blue. No alpha channel
ARGB8888, ///< 32-bit, 8 bits for each of red, green, blue and alpha channel
BW, ///< 1-bit, black / white. No alpha channel
BW_RLE, ///< 1-bit, black / white. No alpha channel. Image is compressed with horizontal RLE
GRAY2, ///< 2-bit grayscale
GRAY4, ///< 4-bit grayscale
ARGB2222, ///< 8-bit color
ABGR2222, ///< 8-bit color
RGBA2222, ///< 8-bit color
BGRA2222, ///< 8-bit color
L8, ///< 8-bit indexed color
A4, ///< 4-bit alpha level
CUSTOM, ///< Non-standard platform specific format
COMPRESSED_RGB565, ///< 16-bit, 5 bits for red, 6 bits for green, 5 bits for blue. No alpha channel. Compressed with QOI algorithm.
COMPRESSED_RGB888, ///< 24-bit, 8 bits for each of red, green and blue. No alpha channel. Compressed with QOI algorithm.
COMPRESSED_ARGB8888 ///< 32-bit, 8 bits for each of red, green, blue and alpha channel. Compressed with QOI algorithm.
};
/** Algorithms used for L8 images compression can be stored in the following formats. */
@ -327,8 +331,7 @@ public:
* Decompress a compressed bitmap into the bitmap cache. The
* decompressed bitmap will automatically be used by all Widgets.
*
* Only compressed L8 images can be decompressed. The decompressed
* bitmap will be L8 with an unchanged palette.
* Only compressed L8, RGB565, RGB888 and ARGB8888 bitmaps can be decompressed with this method.
*
* When decompressing L8 bitmaps compressed with LZW an array of
* size 2048 bytes (16 bit aligned) must be supplied. The array is
@ -340,6 +343,34 @@ public:
*/
static bool decompress(BitmapId id, uint16_t* buffer = 0);
/**
* Decompress a compressed bitmap into the bitmap cache. The
* decompressed bitmap will automatically be used by all Widgets.
*
* Only compressed L8 bitmaps can be decompressed with this method. The decompressed
* bitmap will be L8 with an unchanged palette.
*
* When decompressing L8 bitmaps compressed with LZW an array of
* size 2048 bytes (16 bit aligned) must be supplied. The array is
* only used during decompressing.
*
* @param id The id of the Bitmap to decompress.
* @param buffer Pointer to a buffer for LZW decompression.
* @return true if the bitmap was decompressed.
*/
static bool decompressL8(BitmapId id, uint16_t* buffer = 0);
/**
* Decompress a compressed bitmap into the bitmap cache. The
* decompressed bitmap will automatically be used by all Widgets.
*
* Only compressed RGB565, RGB888 and ARGB8888 bitmaps can be decompressed with this method.
*
* @param id The id of the Bitmap to decompress.
* @return true if the bitmap was decompressed.
*/
static bool decompressRGB(BitmapId id);
/**
* Create a dynamic Bitmap. The clutFormat parameter is ignored for bitmaps not in L8 format
* (consider using dynamicBitmapCreateL8 instead). Creation of a new dynamic bitmap may cause
@ -566,6 +597,10 @@ private:
static bool isCustomDynamicBitmap(BitmapId id);
static bool copyBitmapToCache(BitmapId id, uint8_t* const dst);
static uint32_t firstFreeDynamicBitmapId();
static void decompressRGB565(uint16_t* dst, BitmapId id);
static void decompressRGB888(uint8_t* dst, BitmapId id);
static void decompressARGB8888(uint8_t* dst, BitmapId id);
static uint32_t decompressL8_L4(uint8_t* dst, BitmapId id);
static uint32_t decompressL8_RLE(uint8_t* dst, BitmapId id);
static uint32_t decompressL8_LZW9(uint8_t* dst, BitmapId id, uint16_t* buffer = 0);

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -463,6 +463,26 @@ public:
return 0;
}
/**
* Returns true if this Font is vector based. Default is false.
*
* @return True if this Font is vector based.
*/
virtual bool isVectorBasedFont() const
{
return false;
}
/**
* Returns the scale factor
*
* @return The scale factor
*/
virtual float getScaleFactor() const
{
return 0;
}
/**
* Query if 'character' is invisible, zero width.
*

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -471,7 +471,6 @@ private:
static void parseFlagsAndPrecision(const UnicodeChar*& ucFormat, const char*& cFormat, UnicodeChar& numberSign, bool& alignLeft, bool& forceDecimalPoint, bool& zeroPrefix, bool& hasWidth, int& width, bool& hasPrecision, int& precision);
static const UnicodeChar* skip_spaces(const UnicodeChar* str);
static const UnicodeChar* skip_whitespace(const UnicodeChar* str);
FORCE_INLINE_FUNCTION static UnicodeChar peekChar(const UnicodeChar* ucFormat, const char* cFormat);

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -0,0 +1,82 @@
/******************************************************************************
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
*******************************************************************************/
/**
* @file touchgfx/VectorFontRendererImpl.hpp
*
* Defines the touchgfx::VectorFontRendererImpl class, implementing the rendering of vector font glyphs.
*/
#ifndef TOUCHGFX_VECTORFONTRENDERERIMPL_HPP
#define TOUCHGFX_VECTORFONTRENDERERIMPL_HPP
#include <touchgfx/hal/Types.hpp>
#include <touchgfx/hal/VectorFontRenderer.hpp>
namespace touchgfx
{
/**
* Implementation of the VectorFontRenderer interface
*/
class VectorFontRendererImpl : public VectorFontRenderer
{
public:
VectorFontRendererImpl();
/**
* Get buffers for commands and points for the vector font.
*
* @param pointArray Array for the points.
* @param pointArraySize Size of the pointArray.
* @param commandArray Array for the commands.
* @param commandArraySize Size of the commandArray.
*/
static void getVectorFontBuffers(float*& pointArray, int& pointArraySize, uint8_t*& commandArray, int& commandArraySize);
/**
* Draws one glyph from the provided data.
*
* @param canvasAreaAbs The canvas dimensions in absolute coordinates.
* @param invalidatedAreaRel The area which should be updated in relative coordinates to the canvas area.
* @param data Data containing tags and points for all contours of the glyph.
* @param font The font to use.
* @param color The color of the glyph.
* @param alpha The transparency of the glyph.
* @param rotation Rotation to do before drawing the glyph.
* @param x Distance to advance horizontally.
* @param y Distance to move down.
*/
virtual void drawGlyph(const Rect& canvasAreaAbs, const Rect& invalidatedAreaRel, const uint16_t* data, const Font* font, colortype color, uint8_t alpha, TextRotation rotation, int x, int y);
private:
VectorRenderer* renderer;
uint8_t* cmds; // Buffer of commands for VectorRenderer::drawPath
float* points; // Buffer of points for VectorRenderer::drawPath
int commandBufferSize;
int pointBufferSize;
uint16_t cmdIndex;
uint16_t pointsIndex;
/**
* Draws a single contour.
*
* @param tagCount The number of tags for the contour to draw.
* @param tagList List of tags; one tag-bit for each cmd (segment) of the contour.
* @param pointList The points defining the contour, including intermediate control points.
*/
const int16_t* drawContour(uint16_t tagCount, const uint16_t* const tagList, const int16_t* const pointList);
};
} // namespace touchgfx
#endif // TOUCHGFX_VECTORFONTRENDERERIMPL_HPP

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -13,9 +13,9 @@
#ifndef TOUCHGFX_VERSION_HPP
#define TOUCHGFX_VERSION_HPP
#define TOUCHGFX_VERSION 42200
#define TOUCHGFX_VERSION 42400
#define TOUCHGFX_VERSION_MAJOR 4
#define TOUCHGFX_VERSION_MINOR 22
#define TOUCHGFX_VERSION_MINOR 24
#define TOUCHGFX_VERSION_PATCH 0
#endif // TOUCHGFX_VERSION_HPP

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -147,13 +147,19 @@ protected:
virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement);
/**
* A CachedImage is a specialized Image object that exposes the setupDrawChain() method.
* A CachedImage is a specialized Image object that exposes the
* setupDrawChain() and setParent methods.
*
* @see CacheableContainer, Image
*/
class CachedImage : public Image
{
public:
void setParent(Drawable* p)
{
parent = p;
}
virtual void setupDrawChain(const Rect& invalidatedArea, Drawable** nextPreviousElement)
{
Drawable::setupDrawChain(invalidatedArea, nextPreviousElement);

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -246,11 +246,26 @@ public:
*/
void setScrollbarWidth(uint8_t width);
/**
* Gets if the containner is currently scrolled.
*
* @return if the containner is currently scrolled.
*/
bool getIsScrolling() const;
/**
* Gets if the container is currently pressed.
*
* @return if the container is currently pressed.
*/
bool getIsPressed() const;
/**
* Gets the distance scrolled for the x-axis.
*
* @return the distance scrolled for the x-axis.
*/
int16_t getScrolledX() const;
/**

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -169,6 +169,52 @@ public:
*/
uint8_t getSelectedPage() const;
/**
* Go to next page with animation
*
* @param duration duration of the swiping animation when using button.
*
* @note next page selected
*/
void goNextPage(uint8_t duration = 20);
/**
* Go to previous page with animation
*
* @param duration duration of the swiping animation when using button.
*
* @note previous page selected
*/
void goPreviousPage(uint8_t duration = 20);
/**
* Gets the animation duration for swiping with button.
*
* @return the animation's duration
*
* @see setAnimationDuration
*/
uint8_t getAnimationDuration() const;
/**
* Sets the animation duration for swiping with button.
*
* @param newDuration duration of the swiping animation when using button.
*
* @see getAnimationDuration
*/
void setAnimationDuration(uint8_t newDuration);
/**
* Go to the indicated page with animation
*
* @param page the page to go to.
* @param duration duration of the swiping animation when using button.
*
* @note previous page selected
*/
void goToPage(uint8_t page, uint8_t duration = 20);
private:
static const int16_t DRAG_CANCEL_THRESHOLD = 3;
@ -178,6 +224,9 @@ private:
ANIMATE_SWIPE_CANCELLED_RIGHT,
ANIMATE_LEFT,
ANIMATE_RIGHT,
ANIMATE_LEFT_WITH_BUTTON,
ANIMATE_RIGHT_WITH_BUTTON,
ANIMATE_TO_PAGE,
NO_ANIMATION
} currentState;
@ -187,7 +236,8 @@ private:
int16_t animateDistance;
int16_t startX;
uint16_t endElasticWidth;
uint8_t animationDuration;
int8_t pageDelta;
ListLayout pages;
void adjustPages();
@ -196,6 +246,9 @@ private:
void animateSwipeCancelledRight();
void animateLeft();
void animateRight();
void animateLeftWithButton();
void animateRightWithButton();
void animateToPage();
class PageIndicator : public Container
{

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.
@ -61,7 +61,7 @@ public:
*
* @see setPressed
*/
bool getPressed()
bool getPressed() const
{
return pressed;
}

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Copyright (c) 2018(-2023) STMicroelectronics.
* Copyright (c) 2018(-2024) STMicroelectronics.
* All rights reserved.
*
* This file is part of the TouchGFX 4.22.0 distribution.
* This file is part of the TouchGFX 4.24.0 distribution.
*
* This software is licensed under terms that can be found in the LICENSE file in
* the root directory of this software component.

Some files were not shown because too many files have changed in this diff Show More