Prusa MINI Firmware overview
|
: Main program body
More...
#include "main.h"
#include "cmsis_os.h"
#include "fatfs.h"
#include "lwip.h"
#include "usb_device.h"
#include "usb_host.h"
#include "app.h"
#include "dbg.h"
#include "diag.h"
#include "timer_defaults.h"
#include "lwsapi.h"
#include "thread_measurement.h"
#include "uartslave.h"
#include "putslave.h"
: Main program body
This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners.
COPYRIGHT(c) 2019 STMicroelectronics
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
◆ SystemClock_Config()
System Clock Configuration.
- Return values
-
Configure the main internal regulator output voltage
Initializes the CPU, AHB and APB busses clocks
Initializes the CPU, AHB and APB busses clocks
310 RCC_OscInitStruct.
PLL.
PLLM = 6;
311 RCC_OscInitStruct.
PLL.
PLLN = 168;
313 RCC_OscInitStruct.
PLL.
PLLQ = 7;
◆ MX_GPIO_Init()
GPIO Initialization Function.
- Parameters
-
- Return values
-
830 __HAL_RCC_GPIOE_CLK_ENABLE();
835 __HAL_RCC_GPIOD_CLK_ENABLE();
◆ MX_DMA_Init()
Enable DMA controller clock
◆ MX_I2C1_Init()
I2C1 Initialization Function.
- Parameters
-
- Return values
-
◆ MX_IWDG_Init()
IWDG Initialization Function.
- Parameters
-
- Return values
-
◆ MX_ADC1_Init()
ADC1 Initialization Function.
- Parameters
-
- Return values
-
Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)
Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
◆ MX_USART1_UART_Init()
static void MX_USART1_UART_Init |
( |
void |
| ) |
|
|
static |
USART1 Initialization Function.
- Parameters
-
- Return values
-
◆ MX_TIM1_Init()
TIM1 Initialization Function.
- Parameters
-
- Return values
-
◆ MX_TIM3_Init()
TIM3 Initialization Function.
- Parameters
-
- Return values
-
665 sConfigOC.
Pulse = 21000;
◆ MX_SPI2_Init()
SPI2 Initialization Function.
- Parameters
-
- Return values
-
◆ MX_USART2_UART_Init()
static void MX_USART2_UART_Init |
( |
void |
| ) |
|
|
static |
USART2 Initialization Function.
- Parameters
-
- Return values
-
◆ MX_USART6_UART_Init()
static void MX_USART6_UART_Init |
( |
void |
| ) |
|
|
static |
USART6 Initialization Function.
- Parameters
-
- Return values
-
◆ MX_SPI3_Init()
SPI3 Initialization Function.
- Parameters
-
- Return values
-
◆ MX_TIM2_Init()
TIM2 Initialization Function.
- Parameters
-
- Return values
-
614 sConfigOC.
Pulse = 21000;
◆ MX_TIM14_Init()
TIM14 Initialization Function.
- Parameters
-
- Return values
-
◆ StartDefaultTask()
Function implementing the defaultTask thread.
- Parameters
-
- Return values
-
◆ StartDisplayTask()
Function implementing the displayTask thread.
- Parameters
-
- Return values
-
◆ StartIdleTask()
Function implementing the idleTask thread.
- Parameters
-
- Return values
-
◆ StartWebServerTask()
Function implementing the webServerTask thread.
- Parameters
-
- Return values
-
◆ gui_run()
176 #ifdef PIDCALIBRATION
178 #endif //PIDCALIBRATION
196 int8_t gui_timeout_id;
222 #ifdef PIDCALIBRATION
223 if (curr != pscreen_PID) {
224 #endif //PIDCALIBRATION
229 #ifdef PIDCALIBRATION
231 #endif //PIDCALIBRATION
◆ Error_Handler()
This function is executed in case of error occurrence.
- Return values
-
◆ main()
The application entry point.
- Return values
-
◆ st7789v_spi_tx_complete()
928 #ifdef ST7789V_USE_RTOS
930 #endif //ST7789V_USE_RTOS
◆ hadc1
◆ hi2c1
◆ hiwdg
Marlin 3D Printer Firmware Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
Based on Sprinter and grbl. Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
◆ hspi2
◆ hspi3
◆ hdma_spi2_tx
File Name : stm32f4xx_hal_msp.c Description : This file provides code for the MSP Initialization and de-Initialization codes.
This notice applies to any and all portions of this file that are not between comment pairs USER CODE BEGIN and USER CODE END. Other portions of this file, whether inserted by the user or by software development tools are owned by their respective copyright owners.
COPYRIGHT(c) 2019 STMicroelectronics
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
◆ htim1
◆ htim2
◆ htim3
◆ htim14
◆ huart1
◆ huart2
◆ huart6
◆ hdma_usart1_rx
◆ hdma_usart2_rx
◆ hdma_usart6_rx
◆ defaultTaskHandle
◆ displayTaskHandle
◆ idleTaskHandle
◆ webServerTaskHandle
◆ measurementTaskHandle
◆ HAL_IWDG_Reset
◆ HAL_GPIO_Initialized
int HAL_GPIO_Initialized = 0 |
◆ HAL_ADC_Initialized
int HAL_ADC_Initialized = 0 |
◆ HAL_PWM_Initialized
int HAL_PWM_Initialized = 0 |
◆ HAL_SPI_Initialized
int HAL_SPI_Initialized = 0 |
◆ uart1rxbuff
◆ uart1rx_data
◆ uart6rxbuff
◆ uart6rx_data
◆ uart6slave
◆ uart6slave_line
◆ Tacho_FAN0
◆ Tacho_FAN1
uint32_t OwnAddress2
Definition: stm32f4xx_hal_i2c.h:80
#define RCC_PLLP_DIV2
Definition: stm32f4xx_hal_rcc.h:186
screen_t * pscreen_test_msgbox
Definition: screen_test_msgbox.c:147
screen_t * pscreen_test_term
Definition: screen_test_term.c:78
#define UART_OVERSAMPLING_16
Definition: stm32f4xx_hal_uart.h:276
int16_t window_register_class(window_class_t *cls)
Definition: window.c:90
osThreadId idleTaskHandle
Definition: main.c:99
#define LCD_RS_Pin
Definition: main.h:141
jogwheel_config_t jogwheel_config
Definition: jogwheel.c:95
int16_t WINDOW_CLS_DLG_LOADUNLOAD
Definition: window_dlg_statemachine.c:37
#define E_DIR_Pin
Definition: main.h:135
uint16_t window_msgbox_id_icon[5]
Definition: window_msgbox.c:62
IWDG_HandleTypeDef hiwdg
Definition: main.c:79
uint32_t BreakState
Definition: stm32f4xx_hal_tim_ex.h:104
#define SPI_FIRSTBIT_MSB
Definition: stm32f4xx_hal_spi.h:251
#define SPI_BAUDRATEPRESCALER_2
Definition: stm32f4xx_hal_spi.h:236
screen_t *const pscreen_lan_settings
Definition: screen_lan_settings.c:294
uint32_t Period
Definition: stm32f4xx_hal_tim.h:71
gui_loop_cb_t * gui_loop_cb
Definition: gui.c:32
#define FAN0_TACH_Pin
Definition: main.h:117
#define UART_HWCONTROL_NONE
Definition: stm32f4xx_hal_uart.h:246
void StartWebServerTask(void const *argument)
Function implementing the webServerTask thread.
Definition: main.c:1013
uint32_t ContinuousConvMode
Definition: stm32f4xx_hal_adc.h:97
#define MARLIN_EVT_SafetyTimerExpired
Definition: marlin_events.h:35
ADC_TypeDef * Instance
Definition: stm32f4xx_hal_adc.h:210
#define TIM_OCNPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:395
#define GPIO_MODE_OUTPUT_PP
Definition: stm32f4xx_hal_gpio.h:136
#define Z_DIAG_Pin
Definition: main.h:87
HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim)
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim)
Definition: stm32f4xx_hal_msp.c:430
#define LCD_SW2_Pin
Definition: main.h:129
static void MX_USART2_UART_Init(void)
USART2 Initialization Function.
Definition: main.c:743
#define osThreadDef(name, thread, priority, instances, stacksz)
Definition: cmsis_os.h:468
Definition: stm32f4xx_hal_def.h:57
err_t lwsapi_init(void)
Init (start) the LwIP WSAPI server.
Definition: lwsapi.cpp:413
static void MX_USART1_UART_Init(void)
USART1 Initialization Function.
Definition: main.c:713
void uartrxbuff_init(uartrxbuff_t *prxbuff, UART_HandleTypeDef *phuart, DMA_HandleTypeDef *phdma, uint8_t size, uint8_t *pdata)
Definition: uartrxbuff.c:15
#define RCC_HCLK_DIV2
Definition: stm32f4xx_hal_rcc.h:260
uint32_t PLLP
Definition: stm32f4xx_hal_rcc_ex.h:78
#define TIM_OCFAST_DISABLE
Definition: stm32f4xx_hal_tim.h:377
char uart6slave_line[32]
Definition: main.c:150
HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfig, uint32_t Channel)
RCC System, AHB and APB busses clock configuration structure definition.
Definition: stm32f4xx_hal_rcc.h:93
int16_t WINDOW_CLS_LCDSIM
Definition: window_lcdsim.c:6
static uint8_t uart1rx_data[200]
Definition: main.c:145
TIM_HandleTypeDef htim2
Definition: main.c:86
uint8_t jogwheel_changed
Definition: jogwheel.c:14
static void MX_ADC1_Init(void)
ADC1 Initialization Function.
Definition: main.c:336
UART_HandleTypeDef huart2
Definition: main.c:91
int HAL_PWM_Initialized
Definition: main.c:106
uint8_t uart6rx_data[32]
Definition: main.c:148
#define SPI_DIRECTION_2LINES
Definition: stm32f4xx_hal_spi.h:189
void update_firmware_screen(void)
Definition: guimain.c:247
SPI_TypeDef * Instance
Definition: stm32f4xx_hal_spi.h:122
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
static void MX_TIM3_Init(void)
TIM3 Initialization Function.
Definition: main.c:631
uint32_t Mode
Definition: stm32f4xx_hal_gpio.h:68
uint32_t SYSCLKSource
Definition: stm32f4xx_hal_rcc.h:98
int HAL_IWDG_Reset
Definition: main.c:103
#define ADC_EOC_SINGLE_CONV
Definition: stm32f4xx_hal_adc.h:386
#define __HAL_RCC_GPIOB_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:409
void app_error(void)
Definition: appmain.cpp:145
void gui_init(void)
Definition: gui.c:43
TIM Break and Dead time configuration Structure definition.
Definition: stm32f4xx_hal_tim_ex.h:94
#define X_ENA_Pin
Definition: main.h:183
uint32_t CLKPhase
Definition: stm32f4xx_hal_spi.h:77
#define ADC_SAMPLETIME_3CYCLES
Definition: stm32f4xx_hal_adc.h:370
#define ADC_RESOLUTION_12B
Definition: stm32f4xx_hal_adc.h:284
#define USB_OVERC_Pin
Definition: main.h:89
uint32_t OCIdleState
Definition: stm32f4xx_hal_tim.h:112
uint8_t marlin_message_received(void)
Definition: marlin_client.c:507
static void MX_TIM1_Init(void)
TIM1 Initialization Function.
Definition: main.c:510
void MX_USB_HOST_Init(void)
USB Host initialization function.
Definition: usb_host.c:100
HAL_StatusTypeDef HAL_TIM_Base_Start_IT(TIM_HandleTypeDef *htim)
void uartrxbuff_open(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:24
const window_class_dlg_preheat_t window_class_dlg_preheat
Definition: window_dlg_preheat.c:114
uint32_t ClockDivision
Definition: stm32f4xx_hal_tim.h:75
#define ADC_DATAALIGN_RIGHT
Definition: stm32f4xx_hal_adc.h:332
screen_t * pscreen_menu_calibration
Definition: screen_menu_calibration.c:101
#define IWDG_PRESCALER_4
Definition: stm32f4xx_hal_iwdg.h:96
#define LCD_SW3_Pin
Definition: main.h:124
int HAL_ADC_Initialized
Definition: main.c:105
#define WP2_Pin
Definition: main.h:191
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef *sMasterConfig)
uint32_t OCNPolarity
Definition: stm32f4xx_hal_tim.h:103
int16_t screen_register(screen_t *pscreen)
Definition: screen.c:24
#define SPI_TIMODE_DISABLE
Definition: stm32f4xx_hal_spi.h:260
static void MX_SPI2_Init(void)
SPI2 Initialization Function.
Definition: main.c:440
I2C_HandleTypeDef hi2c1
Definition: main.c:77
#define Z_MIN_Pin
Definition: main.h:159
uartrxbuff_t uart1rxbuff
Definition: main.c:144
#define USB_EN_GPIO_Port
Definition: main.h:92
uint32_t OCPolarity
Definition: stm32f4xx_hal_tim.h:100
uint32_t DMAContinuousRequests
Definition: stm32f4xx_hal_adc.h:117
font_t * font
Definition: guitypes.h:110
TIM Master configuration Structure definition.
Definition: stm32f4xx_hal_tim_ex.h:83
static void MX_GPIO_Init(void)
GPIO Initialization Function.
Definition: main.c:826
const jogwheel_config_t jogwheel_cfg
Definition: guimain.c:95
#define UART_PARITY_NONE
Definition: stm32f4xx_hal_uart.h:236
#define RCC_HSE_ON
Definition: stm32f4xx_hal_rcc.h:137
uint32_t CLKPolarity
Definition: stm32f4xx_hal_spi.h:74
#define X_DIR_Pin
Definition: main.h:177
uint32_t DutyCycle
Definition: stm32f4xx_hal_i2c.h:68
#define TIM_OCIDLESTATE_RESET
Definition: stm32f4xx_hal_tim.h:405
HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg)
#define ADC_CHANNEL_4
Definition: stm32f4xx_hal_adc.h:345
#define IDR_FNT_NORMAL
Definition: resource.h:10
TIM_HandleTypeDef htim14
Definition: main.c:88
#define RCC_CLOCKTYPE_PCLK2
Definition: stm32f4xx_hal_rcc.h:209
uint32_t OCFastMode
Definition: stm32f4xx_hal_tim.h:107
#define Z_STEP_Pin
Definition: main.h:185
int16_t WINDOW_CLS_DLG_PREHEAT
Definition: window_dlg_preheat.c:22
#define MSGBOX_ICO_WARNING
Definition: window_msgbox.h:35
uint32_t Pull
Definition: stm32f4xx_hal_gpio.h:71
#define RCC_CLOCKTYPE_PCLK1
Definition: stm32f4xx_hal_rcc.h:208
priority: idle (lowest)
Definition: cmsis_os.h:218
int32_t osSignalSet(osThreadId thread_id, int32_t signal)
Set the specified Signal Flags of an active thread.
Definition: cmsis_os.c:545
screen_t * pscreen_menu_service
Definition: screen_menu_service.c:147
screen_t * pscreen_filebrowser
Definition: screen_filebrowser.cpp:177
#define TIM_TRGO_RESET
Definition: stm32f4xx_hal_tim.h:688
#define MARLIN_CMD_M600
Definition: marlin_events.h:57
int HAL_SPI_Initialized
Definition: main.c:107
uint32_t CRCPolynomial
Definition: stm32f4xx_hal_spi.h:99
uint32_t PLLQ
Definition: stm32f4xx_hal_rcc_ex.h:81
osStatus osKernelStart(void)
Start the RTOS Kernel with executing the specified thread.
Definition: cmsis_os.c:193
uint32_t CounterMode
Definition: stm32f4xx_hal_tim.h:68
#define Z_DIR_Pin
Definition: main.h:149
#define UART_MODE_TX_RX
Definition: stm32f4xx_hal_uart.h:259
int diag_fastboot
Definition: diag.c:11
#define RCC_LSI_ON
Definition: stm32f4xx_hal_rcc.h:168
#define SPI_CRCCALCULATION_DISABLE
Definition: stm32f4xx_hal_spi.h:269
void screen_open(int16_t screen_id)
Definition: screen.c:62
uint32_t PLLSource
Definition: stm32f4xx_hal_rcc_ex.h:68
#define RCC_OSCILLATORTYPE_LSI
Definition: stm32f4xx_hal_rcc.h:128
#define ADC_SOFTWARE_START
Definition: stm32f4xx_hal_adc.h:324
#define TIM_OCMODE_PWM1
Definition: stm32f4xx_hal_tim.h:365
screen_t * pscreen_menu_preheat
Definition: screen_menu_preheat.cpp:93
UART_HandleTypeDef huart6
Definition: main.c:92
void marlin_client_loop(void)
Definition: marlin_client.c:118
#define I2C_GENERALCALL_DISABLE
Definition: stm32f4xx_hal_i2c.h:257
TIM Output Compare Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:92
void uartslave_init(uartslave_t *pslave, uartrxbuff_t *prxbuff, int size, char *pline)
Definition: uartslave.c:57
uint32_t Channel
Definition: stm32f4xx_hal_adc.h:133
uint32_t Reload
Definition: stm32f4xx_hal_iwdg.h:68
uint32_t OscillatorType
Definition: stm32f4xx_hal_rcc.h:69
uint32_t PLLM
Definition: stm32f4xx_hal_rcc_ex.h:71
#define NULL
Definition: usbd_def.h:53
#define F(str)
Definition: UHS_macros.h:164
uint32_t HSEState
Definition: stm32f4xx_hal_rcc.h:72
uint32_t AutomaticOutput
Definition: stm32f4xx_hal_tim_ex.h:108
#define ADC_CLOCK_SYNC_PCLK_DIV4
Definition: stm32f4xx_hal_adc.h:251
#define TIM_CHANNEL_3
Definition: stm32f4xx_hal_tim.h:424
int16_t WINDOW_CLS_LOGO
Definition: window_logo.c:11
const screen_t * pscreen_marlin
Definition: screen_marlin.c:33
screen_t * pscreen_menu_filament
Definition: screen_menu_filament.c:124
screen_t * screen_get_curr(void)
Definition: screen.c:114
const window_class_dlg_wait_t window_class_dlg_wait
Definition: window_dlg_wait.c:128
#define MSGBOX_BTN_OK
Definition: window_msgbox.h:20
const window_class_file_list_t window_class_file_list
Definition: window_file_list.c:250
#define GPIO_PULLUP
Definition: stm32f4xx_hal_gpio.h:171
int16_t WINDOW_CLS_DLG_WAIT
Definition: window_dlg_wait.c:25
osStatus osDelay(uint32_t millisec)
Wait for Timeout (Time Delay)
Definition: cmsis_os.c:365
uint32_t Rank
Definition: stm32f4xx_hal_adc.h:135
dlg_result_t gui_dlg_change(void)
Definition: window_dlg_change.c:35
#define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__)
macros configure the main internal regulator output voltage.
Definition: stm32f4xx_hal_pwr_ex.h:153
uint32_t LockLevel
Definition: stm32f4xx_hal_tim_ex.h:100
void screen_close(void)
Definition: screen.c:80
static void MX_DMA_Init(void)
Definition: main.c:801
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig)
#define RCC_PLLSOURCE_HSE
Definition: stm32f4xx_hal_rcc.h:198
#define __HAL_RCC_GPIOH_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:423
#define TIM_BREAKPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:671
uint32_t OffStateIDLEMode
Definition: stm32f4xx_hal_tim_ex.h:98
#define IDR_PNG_header_icon_question
Definition: resource.h:69
static UART_HandleTypeDef huart1
Definition: main.c:90
screen_t * pscreen_wizard
Definition: screen_wizard.c:559
void StartDefaultTask(void const *argument)
Function implementing the defaultTask thread.
Definition: main.c:951
#define TIM_CLOCKDIVISION_DIV1
Definition: stm32f4xx_hal_tim.h:351
int HAL_GPIO_Initialized
Definition: main.c:104
screen_t * pscreen_splash
Definition: screen_splash.c:144
HAL_StatusTypeDef HAL_Init(void)
This function is used to initialize the HAL Library; it must be the first instruction to be executed ...
Definition: stm32f4xx_hal.c:173
uint32_t Prescaler
Definition: stm32f4xx_hal_iwdg.h:65
#define RCC_PLL_ON
Definition: stm32f4xx_hal_rcc.h:178
#define E_STEP_Pin
Definition: main.h:137
#define E_DIAG_Pin
Definition: main.h:169
const window_class_temp_graph_t window_class_temp_graph
Definition: window_temp_graph.c:132
#define X_DIAG_Pin
Definition: main.h:85
SPI_HandleTypeDef hspi3
Definition: main.c:82
#define RCC_HCLK_DIV4
Definition: stm32f4xx_hal_rcc.h:261
void MX_USB_DEVICE_Init(void)
Definition: usb_device.c:93
#define FAN1_TACH_Pin
Definition: main.h:126
const st7789v_config_t st7789v_cfg
Definition: guimain.c:85
uint32_t AddressingMode
Definition: stm32f4xx_hal_i2c.h:74
Definition: stm32f4xx_hal_gpio.h:86
screen_t * pscreen_mesh_bed_lv
Definition: screen_mesh_bed_lv.cpp:228
uint32_t RepetitionCounter
Definition: stm32f4xx_hal_tim.h:78
uint32_t DeadTime
Definition: stm32f4xx_hal_tim_ex.h:102
marlin_vars_t * marlin_client_init(void)
Definition: marlin_client.c:84
#define SPI_NSS_SOFT
Definition: stm32f4xx_hal_spi.h:226
screen_t * pscreen_printing
Definition: screen_printing.cpp:161
screen_t * pscreen_menu_info
Definition: screen_menu_info.c:66
#define TIM_CLOCKSOURCE_INTERNAL
Definition: stm32f4xx_hal_tim.h:565
#define __HAL_RCC_CLEAR_RESET_FLAGS()
Set RMVF bit to clear the reset flags: RCC_FLAG_PINRST, RCC_FLAG_PORRST, RCC_FLAG_SFTRST,...
Definition: stm32f4xx_hal_rcc.h:1225
#define ESP_RST_Pin
Definition: main.h:95
#define GPIO_MODE_IT_RISING
Definition: stm32f4xx_hal_gpio.h:143
RCC_PLLInitTypeDef PLL
Definition: stm32f4xx_hal_rcc.h:87
screen_t * pscreen_menu_move
Definition: screen_menu_move.c:85
Structure definition of ADC channel for regular group.
Definition: stm32f4xx_hal_adc.h:131
HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef *hadc)
uint32_t Mode
Definition: stm32f4xx_hal_uart.h:84
int sys_fw_is_valid(void)
Definition: sys.cpp:266
uint32_t DataAlign
Definition: stm32f4xx_hal_adc.h:80
#define TIM_COUNTERMODE_UP
Definition: stm32f4xx_hal_tim.h:339
uint32_t BaudRate
Definition: stm32f4xx_hal_uart.h:65
screen_t * pscreen_test_temperature
Definition: screen_test_temperature.cpp:109
uint32_t TIMode
Definition: stm32f4xx_hal_spi.h:93
static void MX_I2C1_Init(void)
I2C1 Initialization Function.
Definition: main.c:382
#define MARLIN_EVT_CommandBegin
Definition: marlin_events.h:33
#define SPI_PHASE_1EDGE
Definition: stm32f4xx_hal_spi.h:217
#define RCC_CLOCKTYPE_SYSCLK
Definition: stm32f4xx_hal_rcc.h:206
IWDG_TypeDef * Instance
Definition: stm32f4xx_hal_iwdg.h:78
uint32_t GeneralCallMode
Definition: stm32f4xx_hal_i2c.h:83
uint32_t Resolution
Definition: stm32f4xx_hal_adc.h:78
#define TIM_CHANNEL_2
Definition: stm32f4xx_hal_tim.h:423
osThreadId webServerTaskHandle
Definition: main.c:100
#define E_ENA_Pin
Definition: main.h:139
#define TIM_OSSR_DISABLE
Definition: stm32f4xx_hal_tim.h:634
#define TIM_CHANNEL_4
Definition: stm32f4xx_hal_tim.h:425
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
#define IDR_PNG_header_icon_error
Definition: resource.h:67
uint32_t PLLState
Definition: stm32f4xx_hal_rcc_ex.h:65
uint32_t APB1CLKDivider
Definition: stm32f4xx_hal_rcc.h:104
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
#define TIM_OCNIDLESTATE_RESET
Definition: stm32f4xx_hal_tim.h:414
#define GPIO_NOPULL
Definition: stm32f4xx_hal_gpio.h:170
void screen_stack_push(int16_t screen_id)
Definition: screen.c:48
uint32_t ClockPrescaler
Definition: stm32f4xx_hal_adc.h:75
uint8_t flg
Definition: jogwheel.h:24
void gui_run(void)
Definition: guimain.c:107
uint16_t jogwheel_button_down
Definition: jogwheel.c:13
USART_TypeDef * Instance
Definition: stm32f4xx_hal_uart.h:160
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
TIM_TypeDef * Instance
Definition: stm32f4xx_hal_tim.h:289
uint32_t SamplingTime
Definition: stm32f4xx_hal_adc.h:137
uartslave_t uart6slave
Definition: main.c:149
#define TIM_COUNTERMODE_DOWN
Definition: stm32f4xx_hal_tim.h:340
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)
uint32_t OwnAddress1
Definition: stm32f4xx_hal_i2c.h:71
#define TIM_CHANNEL_1
Definition: stm32f4xx_hal_tim.h:422
#define TIM_AUTOMATICOUTPUT_DISABLE
Definition: stm32f4xx_hal_tim.h:680
int HAL_IWDG_Reset
Definition: main.c:103
#define SPI_POLARITY_LOW
Definition: stm32f4xx_hal_spi.h:208
const window_class_logo_t window_class_logo
Definition: window_logo.c:51
#define JOGWHEEL_FLG_INV_DIR
Definition: jogwheel.h:8
I2C_InitTypeDef Init
Definition: stm32f4xx_hal_i2c.h:168
void StartIdleTask(void const *argument)
Function implementing the idleTask thread.
Definition: main.c:997
marlin_vars_t * gui_marlin_vars
Definition: guimain.c:102
#define TIM3_default_Period
Definition: timer_defaults.h:13
#define __HAL_RCC_DMA2_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:437
osThreadId defaultTaskHandle
Definition: main.c:97
#define E_DIAG_GPIO_Port
Definition: main.h:170
#define I2C_DUALADDRESS_DISABLE
Definition: stm32f4xx_hal_i2c.h:248
ADC_InitTypeDef Init
Definition: stm32f4xx_hal_adc.h:212
#define IDR_PNG_header_icon_info
Definition: resource.h:66
screen_t * pscreen_test_gui
Definition: screen_test_gui.c:131
DMA_HandleTypeDef hdma_usart1_rx
Definition: main.c:93
#define IDR_FNT_BIG
Definition: resource.h:11
#define ADC_EXTERNALTRIGCONVEDGE_NONE
Definition: stm32f4xx_hal_adc.h:295
#define _dbg(...)
Definition: dbg.h:50
void SystemClock_Config(void)
System Clock Configuration.
Definition: main.c:295
void app_run(void)
Definition: appmain.cpp:62
#define RCC_CLOCKTYPE_HCLK
Definition: stm32f4xx_hal_rcc.h:207
#define Y_STEP_Pin
Definition: main.h:145
HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim)
#define IDR_PNG_header_icon_warning
Definition: resource.h:68
uint32_t Prescaler
Definition: stm32f4xx_hal_tim.h:65
void MX_LWIP_Init(void)
Definition: lwip.c:95
uint32_t FirstBit
Definition: stm32f4xx_hal_spi.h:90
#define TIM1_default_Period
Definition: timer_defaults.h:11
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
screen_t * pscreen_menu_settings
Definition: screen_menu_settings.c:133
#define LCD_RST_Pin
Definition: main.h:155
uint32_t Pulse
Definition: stm32f4xx_hal_tim.h:97
uint32_t DataSize
Definition: stm32f4xx_hal_spi.h:71
#define TIM3_default_Prescaler
Definition: timer_defaults.h:12
uint32_t AHBCLKDivider
Definition: stm32f4xx_hal_rcc.h:101
uint32_t OCNIdleState
Definition: stm32f4xx_hal_tim.h:116
#define SPI_MODE_MASTER
Definition: stm32f4xx_hal_spi.h:181
SPI_InitTypeDef Init
Definition: stm32f4xx_hal_spi.h:124
static void MX_SPI3_Init(void)
SPI3 Initialization Function.
Definition: main.c:475
uint32_t HwFlowCtl
Definition: stm32f4xx_hal_uart.h:87
uint32_t OCMode
Definition: stm32f4xx_hal_tim.h:94
screen_t * pscreen_test_graph
Definition: screen_test_graph.c:111
#define RCC_OSCILLATORTYPE_HSE
Definition: stm32f4xx_hal_rcc.h:125
uint32_t StopBits
Definition: stm32f4xx_hal_uart.h:74
uint32_t marlin_command(void)
Definition: marlin_client.c:159
#define RCC_SYSCLK_DIV1
Definition: stm32f4xx_hal_rcc.h:243
DMA_HandleTypeDef hdma_usart6_rx
Definition: main.c:95
screen_t * pscreen_home
Definition: screen_home.cpp:278
#define __HAL_RCC_GPIOC_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:416
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
uint32_t NbrOfConversion
Definition: stm32f4xx_hal_adc.h:100
I2C_TypeDef * Instance
Definition: stm32f4xx_hal_i2c.h:166
uint32_t EOCSelection
Definition: stm32f4xx_hal_adc.h:90
int16_t WINDOW_CLS_FILE_LIST
Definition: window_file_list.c:24
uint32_t DiscontinuousConvMode
Definition: stm32f4xx_hal_adc.h:103
int8_t gui_get_menu_timeout_id(void)
Definition: gui_timer.c:147
TIM_HandleTypeDef htim3
Definition: main.c:87
#define Y_DIR_Pin
Definition: main.h:143
uint32_t ExternalTrigConvEdge
Definition: stm32f4xx_hal_adc.h:114
#define TIM_MASTERSLAVEMODE_DISABLE
Definition: stm32f4xx_hal_tim.h:716
HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *sConfig)
static void MX_TIM2_Init(void)
TIM2 Initialization Function.
Definition: main.c:580
#define TIM_OCPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:386
void putslave_init(uartslave_t *pslave)
Definition: putslave.c:619
uint32_t Parity
Definition: stm32f4xx_hal_uart.h:77
uint32_t LSIState
Definition: stm32f4xx_hal_rcc.h:84
uint32_t WordLength
Definition: stm32f4xx_hal_uart.h:71
#define __HAL_RCC_DMA1_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:430
uint32_t Pin
Definition: stm32f4xx_hal_gpio.h:65
uint32_t MasterOutputTrigger
Definition: stm32f4xx_hal_tim_ex.h:84
uint32_t ClockType
Definition: stm32f4xx_hal_rcc.h:95
#define __HAL_RCC_PWR_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:528
uint32_t Speed
Definition: stm32f4xx_hal_gpio.h:74
#define I2C_NOSTRETCH_DISABLE
Definition: stm32f4xx_hal_i2c.h:266
IWDG_InitTypeDef Init
Definition: stm32f4xx_hal_iwdg.h:80
int16_t id
Definition: screen.h:19
#define RCC_FLAG_IWDGRST
Definition: stm32f4xx_hal_rcc.h:379
void MX_FATFS_Init(void)
Definition: fatfs.c:60
#define ST7789V_SIG_SPI_TX
Definition: guiconfig.h:18
const window_class_dlg_statemachine_t window_class_dlg_statemachine
Definition: window_dlg_statemachine.c:246
uint32_t ScanConvMode
Definition: stm32f4xx_hal_adc.h:83
#define RCC_SYSCLKSOURCE_PLLCLK
Definition: stm32f4xx_hal_rcc.h:221
osThreadId measurementTaskHandle
Definition: main.c:102
uint32_t ClockSpeed
Definition: stm32f4xx_hal_i2c.h:65
#define UART_STOPBITS_1
Definition: stm32f4xx_hal_uart.h:227
uint32_t BaudRatePrescaler
Definition: stm32f4xx_hal_spi.h:84
void StartMeasurementTask(void const *argument)
Definition: thread_measurement.c:7
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
#define WINDOW_EVENT_MESSAGE
Definition: window.h:51
HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, TIM_ClockConfigTypeDef *sClockSourceConfig)
static void MX_USART6_UART_Init(void)
USART6 Initialization Function.
Definition: main.c:773
uint32_t DualAddressMode
Definition: stm32f4xx_hal_i2c.h:77
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
Clock Configuration Handle Structure definition.
Definition: stm32f4xx_hal_tim.h:214
screen_t * pscreen_test
Definition: screen_test.c:157
uint32_t CRCCalculation
Definition: stm32f4xx_hal_spi.h:96
#define LCD_CS_Pin
Definition: main.h:157
TIM_Base_InitTypeDef Init
Definition: stm32f4xx_hal_tim.h:290
uint32_t BreakPolarity
Definition: stm32f4xx_hal_tim_ex.h:106
uint32_t Direction
Definition: stm32f4xx_hal_spi.h:68
#define UART_WORDLENGTH_8B
Definition: stm32f4xx_hal_uart.h:218
font_t * font_big
Definition: guitypes.h:111
uint32_t APB2CLKDivider
Definition: stm32f4xx_hal_rcc.h:107
RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition.
Definition: stm32f4xx_hal_rcc.h:67
#define TIM_LOCKLEVEL_OFF
Definition: stm32f4xx_hal_tim.h:651
#define TIM_OSSI_DISABLE
Definition: stm32f4xx_hal_tim.h:643
gui_defaults_t gui_defaults
Definition: gui.c:20
#define X_STEP_Pin
Definition: main.h:179
#define GPIO_MODE_INPUT
Definition: stm32f4xx_hal_gpio.h:135
#define Z_DIAGE1_Pin
Definition: main.h:199
SPI_HandleTypeDef hspi2
Definition: main.c:81
uint16_t st7789v_reset_delay
Definition: st7789v.c:920
#define I2C_ADDRESSINGMODE_7BIT
Definition: stm32f4xx_hal_i2c.h:239
void hwio_beeper_tone2(float frq, uint32_t del, float vol)
Definition: hwio_a3ides_2209_02.c:530
#define Z_MIN_GPIO_Port
Definition: main.h:160
uint32_t NSS
Definition: stm32f4xx_hal_spi.h:80
screen_t * pscreen_sysinfo
Definition: screen_sysinf.c:123
uint32_t OffStateRunMode
Definition: stm32f4xx_hal_tim_ex.h:96
void diag_check_fastboot(void)
Definition: diag.c:23
uint32_t OverSampling
Definition: stm32f4xx_hal_uart.h:91
#define PWR_REGULATOR_VOLTAGE_SCALE1
Definition: stm32f4xx_hal_pwr_ex.h:90
TIM_HandleTypeDef htim1
Definition: main.c:85
#define Y_ENA_Pin
Definition: main.h:147
uartrxbuff_t uart6rxbuff
Definition: main.c:147
#define FLASH_CSN_Pin
Definition: main.h:187
#define LCD_SW1_Pin
Definition: main.h:122
#define ESP_GPIO0_Pin
Definition: main.h:93
uint32_t PLLN
Definition: stm32f4xx_hal_rcc_ex.h:74
static void MX_IWDG_Init(void)
IWDG Initialization Function.
Definition: main.c:413
#define TIM1_default_Prescaler
Definition: timer_defaults.h:10
#define SPI_DATASIZE_8BIT
Definition: stm32f4xx_hal_spi.h:199
uint32_t MasterSlaveMode
Definition: stm32f4xx_hal_tim_ex.h:87
uint32_t Mode
Definition: stm32f4xx_hal_spi.h:65
priority: normal (default)
Definition: cmsis_os.h:221
void screen_dispatch_event(window_t *window, uint8_t event, void *param)
Definition: screen.c:103
#define WP1_Pin
Definition: main.h:197
int8_t gui_timer_expired(int8_t id)
Definition: gui_timer.c:139
uint32_t ClockSource
Definition: stm32f4xx_hal_tim.h:216
uint32_t NoStretchMode
Definition: stm32f4xx_hal_i2c.h:86
int8_t menu_timeout_enabled
Definition: guimain.c:103
screen_t * pscreen_menu_tune
Definition: screen_menu_tune.cpp:203
screen_t *const pscreen_print_preview
Definition: screen_print_preview.c:77
#define Z_ENA_Pin
Definition: main.h:181
#define BED_MON_Pin
Definition: main.h:113
#define __HAL_RCC_GET_FLAG(__FLAG__)
Definition: stm32f4xx_hal_rcc.h:1246
screen_t * pscreen_watchdog
Definition: screen_watchdog.c:78
void StartDisplayTask(void const *argument)
Function implementing the displayTask thread.
Definition: main.c:980
#define __HAL_RCC_GPIOA_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:402
uint32_t ExternalTrigConv
Definition: stm32f4xx_hal_adc.h:110
void gui_timer_delete(int8_t id)
Definition: gui_timer.c:79
osThreadId osThreadCreate(const osThreadDef_t *thread_def, void *argument)
Create a thread and add it to Active Threads and set it to state READY.
Definition: cmsis_os.c:245
int16_t WINDOW_CLS_TEMP_GRAPH
Definition: window_temp_graph.c:8
UART_InitTypeDef Init
Definition: stm32f4xx_hal_uart.h:162
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1057
#define FIL_SENSOR_Pin
Definition: main.h:189
screen_t * pscreen_menu_temperature
Definition: screen_menu_temperature.c:76
screen_t * pscreen_messages
Definition: screen_messages.c:122
GPIO Init structure definition.
Definition: stm32f4xx_hal_gpio.h:63
static void MX_TIM14_Init(void)
TIM14 Initialization Function.
Definition: main.c:686
ADC_HandleTypeDef hadc1
Definition: main.c:75
screen_t * pscreen_version_info
Definition: screen_version_info.cpp:109
const window_class_lcdsim_t window_class_lcdsim
Definition: window_lcdsim.c:58
#define GPIO_SPEED_FREQ_LOW
Definition: stm32f4xx_hal_gpio.h:158
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
osThreadId displayTaskHandle
Definition: main.c:98
#define osThread(name)
Definition: cmsis_os.h:478
st7789v_config_t st7789v_config
Definition: st7789v.c:905
#define I2C_DUTYCYCLE_2
Definition: stm32f4xx_hal_i2c.h:230
#define USB_EN_Pin
Definition: main.h:91
screen_t * pscreen_test_disp_mem
Definition: screen_test_disp_mem.c:629