Compare commits

...

8 Commits

Author SHA1 Message Date
Julian f5027348d7 Add new fonts 2024-07-21 15:20:09 +02:00
Julian 7c44186d0a Merge remote-tracking branch 'origin/develop' into develop-gfx, compilation works 2024-07-21 15:19:53 +02:00
Julian 3208c8f86f Fix TouchGFX and update UI 2024-07-21 14:34:44 +02:00
Julian e60baabf85 Add DRS paddle switch as PF14 2024-06-05 16:57:13 +02:00
Julian Marmier 19f51f13c4 Revert changes 2024-06-05 17:49:54 +02:00
Julian Marmier 6d92da3a10 add mock buttons 2024-05-23 21:33:52 +02:00
Julian Marmier 9ef44b8ebb Add code for constant CAN message sending 2024-05-23 21:25:35 +02:00
Julian Marmier 3f67d1571b Update submodule 2024-05-23 17:50:40 +02:00
11 changed files with 40 additions and 51 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

View File

@ -9,8 +9,8 @@ extern "C" {
#define NUM_BUTTONS 6
#define NUM_ENCS 2
#define BUTTON_MIN_INTERVAL 50 // ms
#define ENC_MAX_PHASE 50 // ms
#define BUTTON_MIN_INTERVAL 50 // ms
#define ENC_MAX_PHASE 50 // ms
typedef enum { UMK_BTN_PRESSED, UMK_ENC_CW, UMK_ENC_CCW } ButtonMessageKind;
@ -25,4 +25,4 @@ void ui_thread_entry(ULONG _);
}
#endif
#endif // __INC_ui_H
#endif // __INC_ui_H

View File

@ -20,6 +20,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */

View File

@ -1,14 +1,14 @@
#include "ui.h"
#include <stdint.h>
#include "hx8357d.h"
#include "main.h"
#include "stm32h7a3xx.h"
#include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_gpio.h"
#include "tx_api.h"
#include "hx8357d.h"
#include "main.h"
#include "vehicle.h"
#include <stdint.h>
void ui_thread_entry(ULONG _) {
GPIO_TypeDef *button_ports[NUM_BUTTONS] = {BTN1_GPIO_Port, BTN2_GPIO_Port,
@ -43,7 +43,9 @@ void ui_thread_entry(ULONG _) {
if (press_event == 1 && button_states[1]) {
tx_event_flags_set(&gui_update_events, GUI_UPDATE_NEXT_SCREEN, TX_OR);
}
vehicle_broadcast_buttons(button_states);
// Release so other threads can get scheduled
tx_thread_sleep(1);
}

View File

@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Tue Jun 11 19:23:32 CEST 2024]
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Sun Jul 21 12:04:39 CEST 2024]
##########################################################################################################################
# ------------------------------------------------

Binary file not shown.

Binary file not shown.

View File

@ -1005,7 +1005,6 @@
{
"Type": "CustomContainerInstance",
"Name": "statusTS_R2D",
"X": 1,
"Width": 65,
"Height": 33,
"CustomContainerDefinitionName": "DriverViewStatusItem"
@ -1053,7 +1052,7 @@
{
"Type": "CustomContainerInstance",
"Name": "statusLV",
"X": 389,
"X": 390,
"Width": 65,
"Height": 33,
"CustomContainerDefinitionName": "DriverViewStatusItem"

View File

@ -23,37 +23,47 @@
#include <touchgfx/hal/PaintRGB565Impl.hpp>
#include "stm32h7xx.h"
#include "stm32h7xx_hal_ltdc.h"
using namespace touchgfx;
namespace
{
// Use the section "TouchGFX_Framebuffer" in the linker script to specify the placement of the buffer
LOCATION_PRAGMA_NOLOAD("TouchGFX_Framebuffer")
uint32_t frameBuf[(320 * 480 * 2 + 3) / 4] LOCATION_ATTRIBUTE_NOLOAD("TouchGFX_Framebuffer");
static uint16_t lcd_int_active_line;
static uint16_t lcd_int_porch_line;
}
void TouchGFXGeneratedHAL::initialize()
{
HAL::initialize();
registerEventListener(*(Application::getInstance()));
setFrameBufferStartAddresses((void*)frameBuf, (void*)0, (void*)0);
setFrameBufferStartAddresses((void*)0x24040000, (void*)0x24040000, (void*)0);
}
void TouchGFXGeneratedHAL::configureInterrupts()
{
NVIC_SetPriority(LTDC_IRQn, 9);
}
void TouchGFXGeneratedHAL::enableInterrupts()
{
NVIC_EnableIRQ(LTDC_IRQn);
}
void TouchGFXGeneratedHAL::disableInterrupts()
{
NVIC_DisableIRQ(LTDC_IRQn);
}
void TouchGFXGeneratedHAL::enableLCDControllerInterrupt()
{
lcd_int_active_line = (LTDC->BPCR & 0x7FF) - 1;
lcd_int_porch_line = (LTDC->AWCR & 0x7FF) - 1;
/* Sets the Line Interrupt position */
LTDC->LIPCR = lcd_int_active_line;
/* Line Interrupt Enable */
LTDC->IER |= LTDC_IER_LIE;
}
bool TouchGFXGeneratedHAL::beginFrame()
@ -66,21 +76,17 @@ void TouchGFXGeneratedHAL::endFrame()
HAL::endFrame();
}
inline uint8_t* TouchGFXGeneratedHAL::advanceFrameBufferToRect(uint8_t* fbPtr, const touchgfx::Rect& rect) const
{
// Advance vertically Advance horizontally
fbPtr += rect.y * lcd().framebufferStride() + rect.x * 2;
return fbPtr;
}
uint16_t* TouchGFXGeneratedHAL::getTFTFrameBuffer() const
{
return (uint16_t*)frameBuf;
return (uint16_t*)LTDC_Layer1->CFBAR;
}
void TouchGFXGeneratedHAL::setTFTFrameBuffer(uint16_t* adr)
{
//setTFTFrameBuffer() not used for selected display interface
LTDC_Layer1->CFBAR = (uint32_t)adr;
/* Reload immediate */
LTDC->SRCR = (uint32_t)LTDC_SRCR_IMR;
}
void TouchGFXGeneratedHAL::flushFrameBuffer(const touchgfx::Rect& rect)

View File

@ -156,24 +156,6 @@ public:
* Called when a rendering pass is completed.
*/
virtual void endFrame();
/**
*
* @fn inline uint8_t* TouchGFXGeneratedHAL::advanceFrameBufferToRect(uint8_t* fbPtr, const touchgfx::Rect& rect) const;
*
* @brief This function calculates the offset in the framebuffer address according to "rect" coordinates.
*
* This function is typically for users who need to transfer framebuffer data to
* a display from within flushFrameBuffer(Rect& rect). While HAL::lockFrameBuffer()
* returns a pointer to the current drawing framebuffer, users must manually calculate
* the offset from that pointer to the Rect to transfer. This function will advance the offset
* in the framebuffer equal to the rect's upper left corner (x, y).
*
*
* @param fbPtr Pointer to the start of the framebuffer, coordinates (0, 0)
* @param rect The area of the screen expressed in absolute coordinates, which has to be transformed to address.
*
*/
inline uint8_t* advanceFrameBufferToRect(uint8_t* fbPtr, const touchgfx::Rect& rect) const;
protected:
/**

View File

@ -153,8 +153,8 @@ Mcu.Pin70=VP_SYS_VS_tim6
Mcu.Pin71=VP_TIM1_VS_ClockSourceINT
Mcu.Pin72=VP_TIM2_VS_ClockSourceINT
Mcu.Pin73=VP_TIM17_VS_ClockSourceINT
Mcu.Pin74=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.1.12_3.0.0
Mcu.Pin75=VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.23.2
Mcu.Pin74=VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.23.2
Mcu.Pin75=VP_STMicroelectronics.X-CUBE-AZRTOS-H7_VS_RTOSJjThreadX_6.1.12_3.0.0
Mcu.Pin8=PF3
Mcu.Pin9=PF4
Mcu.PinsNb=76
@ -453,7 +453,7 @@ ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_FDCAN1_Init-FDCAN1-false-HAL-true,5-MX_LTDC_Init-LTDC-false-HAL-true,6-MX_JPEG_Init-JPEG-false-HAL-true,7-MX_OCTOSPI1_Init-OCTOSPI1-false-HAL-true,8-MX_SPI3_Init-SPI3-false-HAL-true,9-MX_TIM1_Init-TIM1-false-HAL-true,10-MX_TIM2_Init-TIM2-false-HAL-true,11-MX_TIM4_Init-TIM4-false-HAL-true,12-MX_CRC_Init-CRC-false-HAL-true,13-MX_TIM17_Init-TIM17-false-HAL-true,14-MX_DMA2D_Init-DMA2D-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_FDCAN1_Init-FDCAN1-false-HAL-true,5-MX_LTDC_Init-LTDC-false-HAL-true,6-MX_JPEG_Init-JPEG-false-HAL-true,7-MX_OCTOSPI1_Init-OCTOSPI1-false-HAL-true,8-MX_SPI3_Init-SPI3-false-HAL-true,9-MX_TIM1_Init-TIM1-false-HAL-true,10-MX_TIM2_Init-TIM2-false-HAL-true,11-MX_TIM4_Init-TIM4-false-HAL-true,12-MX_CRC_Init-CRC-false-HAL-true,13-MX_TIM17_Init-TIM17-false-HAL-true,14-MX_DMA2D_Init-DMA2D-false-HAL-true,16-MX_TouchGFX_Init-STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2-false-HAL-false,17-MX_TouchGFX_Process-STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2-false-HAL-false,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
RCC.ADCFreq_Value=2000000
RCC.AHB12Freq_Value=160000000
RCC.AHB4Freq_Value=160000000
@ -577,9 +577,13 @@ STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0_IsAnAzureRtosMw=true
STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0_SwParameter=ThreadXCcRTOSJjThreadXJjCore\:true;
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.ApplicationCcGraphicsJjApplication=TouchGFXOoGenerator
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.GraphicsJjApplication_Checked=true
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.IPParameters=ApplicationCcGraphicsJjApplication,tgfx_custom_width,tgfx_custom_height
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.IPParameters=tgfx_custom_height,ApplicationCcGraphicsJjApplication,tgfx_location,tgfx_address1,tgfx_display_interface,tgfx_buffering_strategy,tgfx_address2
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_address1=0x24040000
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_address2=0x24040000
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_buffering_strategy=Double
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_custom_height=480
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_custom_width=320
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_display_interface=disp_ltdc
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_location=By Address
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2_IsPackSelfContextualization=true
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2_SwParameter=ApplicationCcGraphicsJjApplication\:TouchGFXOoGenerator;
TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1