Compare commits
8 Commits
51f6fa6014
...
f5027348d7
Author | SHA1 | Date |
---|---|---|
Julian | f5027348d7 | |
Julian | 7c44186d0a | |
Julian | 3208c8f86f | |
Julian | e60baabf85 | |
Julian Marmier | 19f51f13c4 | |
Julian Marmier | 6d92da3a10 | |
Julian Marmier | 9ef44b8ebb | |
Julian Marmier | 3f67d1571b |
|
@ -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"]
|
[submodule "Core/Lib/can-halal"]
|
||||||
path = Core/Lib/can-halal
|
path = Core/Lib/can-halal
|
||||||
url = ssh://git@git.fasttube.de:313/FaSTTUBe/can-halal.git
|
url = ssh://git@git.fasttube.de:313/FaSTTUBe/can-halal.git
|
||||||
|
|
|
@ -9,8 +9,8 @@ extern "C" {
|
||||||
|
|
||||||
#define NUM_BUTTONS 6
|
#define NUM_BUTTONS 6
|
||||||
#define NUM_ENCS 2
|
#define NUM_ENCS 2
|
||||||
#define BUTTON_MIN_INTERVAL 50 // ms
|
#define BUTTON_MIN_INTERVAL 50 // ms
|
||||||
#define ENC_MAX_PHASE 50 // ms
|
#define ENC_MAX_PHASE 50 // ms
|
||||||
|
|
||||||
typedef enum { UMK_BTN_PRESSED, UMK_ENC_CW, UMK_ENC_CCW } ButtonMessageKind;
|
typedef enum { UMK_BTN_PRESSED, UMK_ENC_CW, UMK_ENC_CCW } ButtonMessageKind;
|
||||||
|
|
||||||
|
@ -25,4 +25,4 @@ void ui_thread_entry(ULONG _);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __INC_ui_H
|
#endif // __INC_ui_H
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "hx8357d.h"
|
||||||
|
#include "main.h"
|
||||||
#include "stm32h7a3xx.h"
|
#include "stm32h7a3xx.h"
|
||||||
#include "stm32h7xx_hal.h"
|
#include "stm32h7xx_hal.h"
|
||||||
#include "stm32h7xx_hal_gpio.h"
|
#include "stm32h7xx_hal_gpio.h"
|
||||||
#include "tx_api.h"
|
#include "tx_api.h"
|
||||||
|
|
||||||
#include "hx8357d.h"
|
|
||||||
#include "main.h"
|
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
void ui_thread_entry(ULONG _) {
|
void ui_thread_entry(ULONG _) {
|
||||||
GPIO_TypeDef *button_ports[NUM_BUTTONS] = {BTN1_GPIO_Port, BTN2_GPIO_Port,
|
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]) {
|
if (press_event == 1 && button_states[1]) {
|
||||||
tx_event_flags_set(&gui_update_events, GUI_UPDATE_NEXT_SCREEN, TX_OR);
|
tx_event_flags_set(&gui_update_events, GUI_UPDATE_NEXT_SCREEN, TX_OR);
|
||||||
}
|
}
|
||||||
|
|
||||||
vehicle_broadcast_buttons(button_states);
|
vehicle_broadcast_buttons(button_states);
|
||||||
|
|
||||||
// Release so other threads can get scheduled
|
// Release so other threads can get scheduled
|
||||||
tx_thread_sleep(1);
|
tx_thread_sleep(1);
|
||||||
}
|
}
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -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.
|
@ -1005,7 +1005,6 @@
|
||||||
{
|
{
|
||||||
"Type": "CustomContainerInstance",
|
"Type": "CustomContainerInstance",
|
||||||
"Name": "statusTS_R2D",
|
"Name": "statusTS_R2D",
|
||||||
"X": 1,
|
|
||||||
"Width": 65,
|
"Width": 65,
|
||||||
"Height": 33,
|
"Height": 33,
|
||||||
"CustomContainerDefinitionName": "DriverViewStatusItem"
|
"CustomContainerDefinitionName": "DriverViewStatusItem"
|
||||||
|
@ -1053,7 +1052,7 @@
|
||||||
{
|
{
|
||||||
"Type": "CustomContainerInstance",
|
"Type": "CustomContainerInstance",
|
||||||
"Name": "statusLV",
|
"Name": "statusLV",
|
||||||
"X": 389,
|
"X": 390,
|
||||||
"Width": 65,
|
"Width": 65,
|
||||||
"Height": 33,
|
"Height": 33,
|
||||||
"CustomContainerDefinitionName": "DriverViewStatusItem"
|
"CustomContainerDefinitionName": "DriverViewStatusItem"
|
||||||
|
|
|
@ -23,37 +23,47 @@
|
||||||
#include <touchgfx/hal/PaintRGB565Impl.hpp>
|
#include <touchgfx/hal/PaintRGB565Impl.hpp>
|
||||||
|
|
||||||
#include "stm32h7xx.h"
|
#include "stm32h7xx.h"
|
||||||
|
#include "stm32h7xx_hal_ltdc.h"
|
||||||
|
|
||||||
using namespace touchgfx;
|
using namespace touchgfx;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
// Use the section "TouchGFX_Framebuffer" in the linker script to specify the placement of the buffer
|
static uint16_t lcd_int_active_line;
|
||||||
LOCATION_PRAGMA_NOLOAD("TouchGFX_Framebuffer")
|
static uint16_t lcd_int_porch_line;
|
||||||
uint32_t frameBuf[(320 * 480 * 2 + 3) / 4] LOCATION_ATTRIBUTE_NOLOAD("TouchGFX_Framebuffer");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchGFXGeneratedHAL::initialize()
|
void TouchGFXGeneratedHAL::initialize()
|
||||||
{
|
{
|
||||||
HAL::initialize();
|
HAL::initialize();
|
||||||
registerEventListener(*(Application::getInstance()));
|
registerEventListener(*(Application::getInstance()));
|
||||||
setFrameBufferStartAddresses((void*)frameBuf, (void*)0, (void*)0);
|
setFrameBufferStartAddresses((void*)0x24040000, (void*)0x24040000, (void*)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchGFXGeneratedHAL::configureInterrupts()
|
void TouchGFXGeneratedHAL::configureInterrupts()
|
||||||
{
|
{
|
||||||
|
NVIC_SetPriority(LTDC_IRQn, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchGFXGeneratedHAL::enableInterrupts()
|
void TouchGFXGeneratedHAL::enableInterrupts()
|
||||||
{
|
{
|
||||||
|
NVIC_EnableIRQ(LTDC_IRQn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchGFXGeneratedHAL::disableInterrupts()
|
void TouchGFXGeneratedHAL::disableInterrupts()
|
||||||
{
|
{
|
||||||
|
NVIC_DisableIRQ(LTDC_IRQn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchGFXGeneratedHAL::enableLCDControllerInterrupt()
|
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()
|
bool TouchGFXGeneratedHAL::beginFrame()
|
||||||
|
@ -66,21 +76,17 @@ void TouchGFXGeneratedHAL::endFrame()
|
||||||
HAL::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
|
uint16_t* TouchGFXGeneratedHAL::getTFTFrameBuffer() const
|
||||||
{
|
{
|
||||||
return (uint16_t*)frameBuf;
|
return (uint16_t*)LTDC_Layer1->CFBAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TouchGFXGeneratedHAL::setTFTFrameBuffer(uint16_t* adr)
|
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)
|
void TouchGFXGeneratedHAL::flushFrameBuffer(const touchgfx::Rect& rect)
|
||||||
|
|
|
@ -156,24 +156,6 @@ public:
|
||||||
* Called when a rendering pass is completed.
|
* Called when a rendering pass is completed.
|
||||||
*/
|
*/
|
||||||
virtual void endFrame();
|
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:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -153,8 +153,8 @@ Mcu.Pin70=VP_SYS_VS_tim6
|
||||||
Mcu.Pin71=VP_TIM1_VS_ClockSourceINT
|
Mcu.Pin71=VP_TIM1_VS_ClockSourceINT
|
||||||
Mcu.Pin72=VP_TIM2_VS_ClockSourceINT
|
Mcu.Pin72=VP_TIM2_VS_ClockSourceINT
|
||||||
Mcu.Pin73=VP_TIM17_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.Pin74=VP_STMicroelectronics.X-CUBE-TOUCHGFX_VS_GraphicsJjApplication_4.23.2
|
||||||
Mcu.Pin75=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.Pin8=PF3
|
||||||
Mcu.Pin9=PF4
|
Mcu.Pin9=PF4
|
||||||
Mcu.PinsNb=76
|
Mcu.PinsNb=76
|
||||||
|
@ -453,7 +453,7 @@ ProjectManager.ToolChainLocation=
|
||||||
ProjectManager.UAScriptAfterPath=
|
ProjectManager.UAScriptAfterPath=
|
||||||
ProjectManager.UAScriptBeforePath=
|
ProjectManager.UAScriptBeforePath=
|
||||||
ProjectManager.UnderRoot=false
|
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.ADCFreq_Value=2000000
|
||||||
RCC.AHB12Freq_Value=160000000
|
RCC.AHB12Freq_Value=160000000
|
||||||
RCC.AHB4Freq_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-AZRTOS-H7.3.0.0_SwParameter=ThreadXCcRTOSJjThreadXJjCore\:true;
|
||||||
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.ApplicationCcGraphicsJjApplication=TouchGFXOoGenerator
|
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.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_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_IsPackSelfContextualization=true
|
||||||
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2_SwParameter=ApplicationCcGraphicsJjApplication\:TouchGFXOoGenerator;
|
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2_SwParameter=ApplicationCcGraphicsJjApplication\:TouchGFXOoGenerator;
|
||||||
TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||||
|
|
Loading…
Reference in New Issue