Prusa MINI Firmware overview
main.c File Reference

: 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"

Functions

void SystemClock_Config (void)
 System Clock Configuration. More...
 
static void MX_GPIO_Init (void)
 GPIO Initialization Function. More...
 
static void MX_DMA_Init (void)
 
static void MX_I2C1_Init (void)
 I2C1 Initialization Function. More...
 
static void MX_IWDG_Init (void)
 IWDG Initialization Function. More...
 
static void MX_ADC1_Init (void)
 ADC1 Initialization Function. More...
 
static void MX_USART1_UART_Init (void)
 USART1 Initialization Function. More...
 
static void MX_TIM1_Init (void)
 TIM1 Initialization Function. More...
 
static void MX_TIM3_Init (void)
 TIM3 Initialization Function. More...
 
static void MX_SPI2_Init (void)
 SPI2 Initialization Function. More...
 
static void MX_USART2_UART_Init (void)
 USART2 Initialization Function. More...
 
static void MX_USART6_UART_Init (void)
 USART6 Initialization Function. More...
 
static void MX_SPI3_Init (void)
 SPI3 Initialization Function. More...
 
static void MX_TIM2_Init (void)
 TIM2 Initialization Function. More...
 
static void MX_TIM14_Init (void)
 TIM14 Initialization Function. More...
 
void StartDefaultTask (void const *argument)
 Function implementing the defaultTask thread. More...
 
void StartDisplayTask (void const *argument)
 Function implementing the displayTask thread. More...
 
void StartIdleTask (void const *argument)
 Function implementing the idleTask thread. More...
 
void StartWebServerTask (void const *argument)
 Function implementing the webServerTask thread. More...
 
void gui_run (void)
 
void Error_Handler (void)
 This function is executed in case of error occurrence. More...
 
int main (void)
 The application entry point. More...
 
void st7789v_spi_tx_complete (void)
 
void HAL_SPI_TxCpltCallback (SPI_HandleTypeDef *hspi)
 
void HAL_UART_RxCpltCallback (UART_HandleTypeDef *huart)
 
void HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin)
 
void HAL_TIM_PeriodElapsedCallback (TIM_HandleTypeDef *htim)
 Period elapsed callback in non blocking mode. More...
 

Variables

ADC_HandleTypeDef hadc1
 
I2C_HandleTypeDef hi2c1
 
IWDG_HandleTypeDef hiwdg
 
SPI_HandleTypeDef hspi2
 
SPI_HandleTypeDef hspi3
 
DMA_HandleTypeDef hdma_spi2_tx
 
TIM_HandleTypeDef htim1
 
TIM_HandleTypeDef htim2
 
TIM_HandleTypeDef htim3
 
TIM_HandleTypeDef htim14
 
static UART_HandleTypeDef huart1
 
UART_HandleTypeDef huart2
 
UART_HandleTypeDef huart6
 
DMA_HandleTypeDef hdma_usart1_rx
 
DMA_HandleTypeDef hdma_usart2_rx
 
DMA_HandleTypeDef hdma_usart6_rx
 
osThreadId defaultTaskHandle
 
osThreadId displayTaskHandle
 
osThreadId idleTaskHandle
 
osThreadId webServerTaskHandle
 
osThreadId measurementTaskHandle
 
int HAL_IWDG_Reset = 0
 
int HAL_GPIO_Initialized = 0
 
int HAL_ADC_Initialized = 0
 
int HAL_PWM_Initialized = 0
 
int HAL_SPI_Initialized = 0
 
uartrxbuff_t uart1rxbuff
 
static uint8_t uart1rx_data [200]
 
uartrxbuff_t uart6rxbuff
 
uint8_t uart6rx_data [32]
 
uartslave_t uart6slave
 
char uart6slave_line [32]
 
uint32_t Tacho_FAN0
 
uint32_t Tacho_FAN1
 

Detailed Description

: 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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. 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.
  3. 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.

Function Documentation

◆ SystemClock_Config()

void SystemClock_Config ( void  )

System Clock Configuration.

Return values
None

Configure the main internal regulator output voltage

Initializes the CPU, AHB and APB busses clocks

Initializes the CPU, AHB and APB busses clocks

295  {
296  RCC_OscInitTypeDef RCC_OscInitStruct = { 0 };
297  RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 };
298 
299  /**Configure the main internal regulator output voltage
300  */
303  /**Initializes the CPU, AHB and APB busses clocks
304  */
306  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
307  RCC_OscInitStruct.LSIState = RCC_LSI_ON;
308  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
309  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
310  RCC_OscInitStruct.PLL.PLLM = 6;
311  RCC_OscInitStruct.PLL.PLLN = 168;
312  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
313  RCC_OscInitStruct.PLL.PLLQ = 7;
314  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
315  Error_Handler();
316  }
317  /**Initializes the CPU, AHB and APB busses clocks
318  */
321  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
322  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
323  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
324  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
325 
326  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
327  Error_Handler();
328  }
329 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_GPIO_Init()

static void MX_GPIO_Init ( void  )
static

GPIO Initialization Function.

Parameters
None
Return values
None
826  {
827  GPIO_InitTypeDef GPIO_InitStruct = { 0 };
828 
829  /* GPIO Ports Clock Enable */
830  __HAL_RCC_GPIOE_CLK_ENABLE();
835  __HAL_RCC_GPIOD_CLK_ENABLE();
836 
837  /*Configure GPIO pin Output Level */
839 
840  /*Configure GPIO pin Output Level */
842 
843  /*Configure GPIO pin Output Level */
845 
846  /*Configure GPIO pins : X_DIAG_Pin Z_DIAG_Pin USB_OVERC_Pin ESP_GPIO0_Pin
847  BED_MON_Pin WP1_Pin Z_DIAGE1_Pin */
848  GPIO_InitStruct.Pin = X_DIAG_Pin | Z_DIAG_Pin | USB_OVERC_Pin | ESP_GPIO0_Pin
850  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
851  GPIO_InitStruct.Pull = GPIO_NOPULL;
852  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
853 
854  /*Configure GPIO pin : USB_EN_Pin */
855  GPIO_InitStruct.Pin = USB_EN_Pin;
856  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
857  GPIO_InitStruct.Pull = GPIO_NOPULL;
858  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
859  HAL_GPIO_Init(USB_EN_GPIO_Port, &GPIO_InitStruct);
860 
861  /*Configure GPIO pins : ESP_RST_Pin LCD_RST_Pin LCD_CS_Pin */
862  GPIO_InitStruct.Pin = ESP_RST_Pin | LCD_RST_Pin | LCD_CS_Pin;
863  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
864  GPIO_InitStruct.Pull = GPIO_NOPULL;
865  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
866  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
867 
868  /*Configure GPIO pins : FAN0_TACH_Pin FAN1_TACH_Pin */
869  GPIO_InitStruct.Pin = FAN0_TACH_Pin | FAN1_TACH_Pin;
870  GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
871  GPIO_InitStruct.Pull = GPIO_NOPULL;
872  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
873 
874  /*Configure GPIO pins : LCD_SW1_Pin LCD_SW3_Pin LCD_SW2_Pin */
875  GPIO_InitStruct.Pin = LCD_SW1_Pin | LCD_SW3_Pin | LCD_SW2_Pin;
876  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
877  GPIO_InitStruct.Pull = GPIO_PULLUP;
878  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
879 
880  /*Configure GPIO pins : E_DIR_Pin E_STEP_Pin E_ENA_Pin LCD_RS_Pin
881  Y_DIR_Pin Y_STEP_Pin Y_ENA_Pin Z_DIR_Pin
882  X_DIR_Pin X_STEP_Pin Z_ENA_Pin X_ENA_Pin
883  Z_STEP_Pin FLASH_CSN_Pin */
884  GPIO_InitStruct.Pin = E_DIR_Pin | E_STEP_Pin | E_ENA_Pin | LCD_RS_Pin
888  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
889  GPIO_InitStruct.Pull = GPIO_NOPULL;
890  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
891  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
892 
893  /*Configure GPIO pin : Z_MIN_Pin */
894  GPIO_InitStruct.Pin = Z_MIN_Pin;
895  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
896  GPIO_InitStruct.Pull = GPIO_PULLUP;
897  HAL_GPIO_Init(Z_MIN_GPIO_Port, &GPIO_InitStruct);
898 
899  /*Configure GPIO pin : E_DIAG_Pin */
900  GPIO_InitStruct.Pin = E_DIAG_Pin;
901  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
902  GPIO_InitStruct.Pull = GPIO_NOPULL;
903  HAL_GPIO_Init(E_DIAG_GPIO_Port, &GPIO_InitStruct);
904 
905  /*Configure GPIO pins : FIL_SENSOR_Pin WP2_Pin */
906  GPIO_InitStruct.Pin = FIL_SENSOR_Pin | WP2_Pin;
907  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
908  GPIO_InitStruct.Pull = GPIO_NOPULL;
909  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
910 
911  /* EXTI interrupt init*/
912  HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0);
913  HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
914 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_DMA_Init()

static void MX_DMA_Init ( void  )
static

Enable DMA controller clock

801  {
802  /* DMA controller clock enable */
805 
806  /* DMA interrupt init */
807  /* DMA1_Stream4_IRQn interrupt configuration */
808  HAL_NVIC_SetPriority(DMA1_Stream4_IRQn, 5, 0);
809  HAL_NVIC_EnableIRQ(DMA1_Stream4_IRQn);
810  /* DMA1_Stream5_IRQn interrupt configuration */
811  HAL_NVIC_SetPriority(DMA1_Stream5_IRQn, 5, 0);
812  HAL_NVIC_EnableIRQ(DMA1_Stream5_IRQn);
813  /* DMA2_Stream1_IRQn interrupt configuration */
814  HAL_NVIC_SetPriority(DMA2_Stream1_IRQn, 5, 0);
815  HAL_NVIC_EnableIRQ(DMA2_Stream1_IRQn);
816  /* DMA2_Stream2_IRQn interrupt configuration */
817  HAL_NVIC_SetPriority(DMA2_Stream2_IRQn, 5, 0);
818  HAL_NVIC_EnableIRQ(DMA2_Stream2_IRQn);
819 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_I2C1_Init()

static void MX_I2C1_Init ( void  )
static

I2C1 Initialization Function.

Parameters
None
Return values
None
382  {
383 
384  /* USER CODE BEGIN I2C1_Init 0 */
385 
386  /* USER CODE END I2C1_Init 0 */
387 
388  /* USER CODE BEGIN I2C1_Init 1 */
389 
390  /* USER CODE END I2C1_Init 1 */
391  hi2c1.Instance = I2C1;
392  hi2c1.Init.ClockSpeed = 100000;
394  hi2c1.Init.OwnAddress1 = 0;
397  hi2c1.Init.OwnAddress2 = 0;
400  if (HAL_I2C_Init(&hi2c1) != HAL_OK) {
401  Error_Handler();
402  }
403  /* USER CODE BEGIN I2C1_Init 2 */
404 
405  /* USER CODE END I2C1_Init 2 */
406 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_IWDG_Init()

static void MX_IWDG_Init ( void  )
static

IWDG Initialization Function.

Parameters
None
Return values
None
413  {
414 
415  /* USER CODE BEGIN IWDG_Init 0 */
416 
417  /* USER CODE END IWDG_Init 0 */
418 
419  /* USER CODE BEGIN IWDG_Init 1 */
420  //Watchdog is enable in marlin init
421 #if 0
422  /* USER CODE END IWDG_Init 1 */
423  hiwdg.Instance = IWDG;
425  hiwdg.Init.Reload = 4095;
426  if (HAL_IWDG_Init(&hiwdg) != HAL_OK)
427  {
428  Error_Handler();
429  }
430  /* USER CODE BEGIN IWDG_Init 2 */
431 #endif
432  /* USER CODE END IWDG_Init 2 */
433 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_ADC1_Init()

static void MX_ADC1_Init ( void  )
static

ADC1 Initialization Function.

Parameters
None
Return values
None

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.

336  {
337 
338  /* USER CODE BEGIN ADC1_Init 0 */
339 
340  /* USER CODE END ADC1_Init 0 */
341 
342  ADC_ChannelConfTypeDef sConfig = { 0 };
343 
344  /* USER CODE BEGIN ADC1_Init 1 */
345 
346  /* USER CODE END ADC1_Init 1 */
347  /**Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)
348  */
349  hadc1.Instance = ADC1;
352  hadc1.Init.ScanConvMode = DISABLE;
353  hadc1.Init.ContinuousConvMode = DISABLE;
354  hadc1.Init.DiscontinuousConvMode = DISABLE;
359  hadc1.Init.DMAContinuousRequests = DISABLE;
361  if (HAL_ADC_Init(&hadc1) != HAL_OK) {
362  Error_Handler();
363  }
364  /**Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
365  */
366  sConfig.Channel = ADC_CHANNEL_4;
367  sConfig.Rank = 1;
369  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) {
370  Error_Handler();
371  }
372  /* USER CODE BEGIN ADC1_Init 2 */
373 
374  /* USER CODE END ADC1_Init 2 */
375 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_USART1_UART_Init()

static void MX_USART1_UART_Init ( void  )
static

USART1 Initialization Function.

Parameters
None
Return values
None
713  {
714 
715  /* USER CODE BEGIN USART1_Init 0 */
716 
717  /* USER CODE END USART1_Init 0 */
718 
719  /* USER CODE BEGIN USART1_Init 1 */
720 
721  /* USER CODE END USART1_Init 1 */
722  huart1.Instance = USART1;
723  huart1.Init.BaudRate = 115200;
730  if (HAL_UART_Init(&huart1) != HAL_OK) {
731  Error_Handler();
732  }
733  /* USER CODE BEGIN USART1_Init 2 */
734 
735  /* USER CODE END USART1_Init 2 */
736 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_TIM1_Init()

static void MX_TIM1_Init ( void  )
static

TIM1 Initialization Function.

Parameters
None
Return values
None
510  {
511 
512  /* USER CODE BEGIN TIM1_Init 0 */
513 
514  /* USER CODE END TIM1_Init 0 */
515 
516  TIM_ClockConfigTypeDef sClockSourceConfig = { 0 };
517  TIM_MasterConfigTypeDef sMasterConfig = { 0 };
518  TIM_OC_InitTypeDef sConfigOC = { 0 };
519  TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = { 0 };
520 
521  /* USER CODE BEGIN TIM1_Init 1 */
522 
523  /* USER CODE END TIM1_Init 1 */
524  htim1.Instance = TIM1;
525  htim1.Init.Prescaler = TIM1_default_Prescaler; //0x3fff was 100;
527  htim1.Init.Period = TIM1_default_Period; //0xff was 42000;
530  if (HAL_TIM_Base_Init(&htim1) != HAL_OK) {
531  Error_Handler();
532  }
533  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
534  if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) {
535  Error_Handler();
536  }
537  if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) {
538  Error_Handler();
539  }
540  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
542  if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) {
543  Error_Handler();
544  }
545  sConfigOC.OCMode = TIM_OCMODE_PWM1;
546  sConfigOC.Pulse = 0;
547  sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
548  sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH;
549  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
552  if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) {
553  Error_Handler();
554  }
555  if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_2) != HAL_OK) {
556  Error_Handler();
557  }
558  sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
559  sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
560  sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;
561  sBreakDeadTimeConfig.DeadTime = 0;
562  sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE;
563  sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH;
564  sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE;
565  if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) {
566  Error_Handler();
567  }
568  /* USER CODE BEGIN TIM1_Init 2 */
569  //HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_1);
570  //HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_2);
571  /* USER CODE END TIM1_Init 2 */
573 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_TIM3_Init()

static void MX_TIM3_Init ( void  )
static

TIM3 Initialization Function.

Parameters
None
Return values
None
631  {
632 
633  /* USER CODE BEGIN TIM3_Init 0 */
634 
635  /* USER CODE END TIM3_Init 0 */
636 
637  TIM_ClockConfigTypeDef sClockSourceConfig = { 0 };
638  TIM_MasterConfigTypeDef sMasterConfig = { 0 };
639  TIM_OC_InitTypeDef sConfigOC = { 0 };
640 
641  /* USER CODE BEGIN TIM3_Init 1 */
642 
643  /* USER CODE END TIM3_Init 1 */
644  htim3.Instance = TIM3;
645  htim3.Init.Prescaler = TIM3_default_Prescaler; //0x3fff was 100
647  htim3.Init.Period = TIM3_default_Period; //0xff was 42000
649  if (HAL_TIM_Base_Init(&htim3) != HAL_OK) {
650  Error_Handler();
651  }
652  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
653  if (HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig) != HAL_OK) {
654  Error_Handler();
655  }
656  if (HAL_TIM_PWM_Init(&htim3) != HAL_OK) {
657  Error_Handler();
658  }
659  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
661  if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK) {
662  Error_Handler();
663  }
664  sConfigOC.OCMode = TIM_OCMODE_PWM1;
665  sConfigOC.Pulse = 21000;
666  sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
667  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
668  if (HAL_TIM_PWM_ConfigChannel(&htim3, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) {
669  Error_Handler();
670  }
671  if (HAL_TIM_PWM_ConfigChannel(&htim3, &sConfigOC, TIM_CHANNEL_4) != HAL_OK) {
672  Error_Handler();
673  }
674  /* USER CODE BEGIN TIM3_Init 2 */
675  //HAL_TIM_PWM_Start(&htim3,TIM_CHANNEL_3);
676  //HAL_TIM_PWM_Start(&htim3,TIM_CHANNEL_4);
677  /* USER CODE END TIM3_Init 2 */
679 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_SPI2_Init()

static void MX_SPI2_Init ( void  )
static

SPI2 Initialization Function.

Parameters
None
Return values
None
440  {
441 
442  /* USER CODE BEGIN SPI2_Init 0 */
443 
444  /* USER CODE END SPI2_Init 0 */
445 
446  /* USER CODE BEGIN SPI2_Init 1 */
447 
448  /* USER CODE END SPI2_Init 1 */
449  /* SPI2 parameter configuration*/
450  hspi2.Instance = SPI2;
461  hspi2.Init.CRCPolynomial = 10;
462  if (HAL_SPI_Init(&hspi2) != HAL_OK) {
463  Error_Handler();
464  }
465  /* USER CODE BEGIN SPI2_Init 2 */
466 
467  /* USER CODE END SPI2_Init 2 */
468 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_USART2_UART_Init()

static void MX_USART2_UART_Init ( void  )
static

USART2 Initialization Function.

Parameters
None
Return values
None
743  {
744 
745  /* USER CODE BEGIN USART2_Init 0 */
746 
747  /* USER CODE END USART2_Init 0 */
748 
749  /* USER CODE BEGIN USART2_Init 1 */
750 
751  /* USER CODE END USART2_Init 1 */
752  huart2.Instance = USART2;
753  huart2.Init.BaudRate = 115200;
760  if (HAL_UART_Init(&huart2) != HAL_OK) {
761  Error_Handler();
762  }
763  /* USER CODE BEGIN USART2_Init 2 */
764 
765  /* USER CODE END USART2_Init 2 */
766 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_USART6_UART_Init()

static void MX_USART6_UART_Init ( void  )
static

USART6 Initialization Function.

Parameters
None
Return values
None
773  {
774 
775  /* USER CODE BEGIN USART6_Init 0 */
776 
777  /* USER CODE END USART6_Init 0 */
778 
779  /* USER CODE BEGIN USART6_Init 1 */
780 
781  /* USER CODE END USART6_Init 1 */
782  huart6.Instance = USART6;
783  huart6.Init.BaudRate = 115200;
790  if (HAL_UART_Init(&huart6) != HAL_OK) {
791  Error_Handler();
792  }
793  /* USER CODE BEGIN USART6_Init 2 */
794 
795  /* USER CODE END USART6_Init 2 */
796 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_SPI3_Init()

static void MX_SPI3_Init ( void  )
static

SPI3 Initialization Function.

Parameters
None
Return values
None
475  {
476 
477  /* USER CODE BEGIN SPI3_Init 0 */
478 
479  /* USER CODE END SPI3_Init 0 */
480 
481  /* USER CODE BEGIN SPI3_Init 1 */
482 
483  /* USER CODE END SPI3_Init 1 */
484  /* SPI3 parameter configuration*/
485  hspi3.Instance = SPI3;
496  hspi3.Init.CRCPolynomial = 10;
497  if (HAL_SPI_Init(&hspi3) != HAL_OK) {
498  Error_Handler();
499  }
500  /* USER CODE BEGIN SPI3_Init 2 */
501 
502  /* USER CODE END SPI3_Init 2 */
503 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_TIM2_Init()

static void MX_TIM2_Init ( void  )
static

TIM2 Initialization Function.

Parameters
None
Return values
None
580  {
581 
582  /* USER CODE BEGIN TIM2_Init 0 */
583 
584  /* USER CODE END TIM2_Init 0 */
585 
586  TIM_ClockConfigTypeDef sClockSourceConfig = { 0 };
587  TIM_MasterConfigTypeDef sMasterConfig = { 0 };
588  TIM_OC_InitTypeDef sConfigOC = { 0 };
589 
590  /* USER CODE BEGIN TIM2_Init 1 */
591 
592  /* USER CODE END TIM2_Init 1 */
593  htim2.Instance = TIM2;
594  htim2.Init.Prescaler = 100;
596  htim2.Init.Period = 42000;
598  if (HAL_TIM_Base_Init(&htim2) != HAL_OK) {
599  Error_Handler();
600  }
601  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
602  if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) {
603  Error_Handler();
604  }
605  if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) {
606  Error_Handler();
607  }
608  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
610  if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) {
611  Error_Handler();
612  }
613  sConfigOC.OCMode = TIM_OCMODE_PWM1;
614  sConfigOC.Pulse = 21000;
615  sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
616  sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
617  if (HAL_TIM_PWM_ConfigChannel(&htim2, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) {
618  Error_Handler();
619  }
620  /* USER CODE BEGIN TIM2_Init 2 */
621 
622  /* USER CODE END TIM2_Init 2 */
624 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MX_TIM14_Init()

static void MX_TIM14_Init ( void  )
static

TIM14 Initialization Function.

Parameters
None
Return values
None
686  {
687 
688  /* USER CODE BEGIN TIM14_Init 0 */
689 
690  /* USER CODE END TIM14_Init 0 */
691 
692  /* USER CODE BEGIN TIM14_Init 1 */
693 
694  /* USER CODE END TIM14_Init 1 */
695  htim14.Instance = TIM14;
696  htim14.Init.Prescaler = 84;
698  htim14.Init.Period = 1000;
700  if (HAL_TIM_Base_Init(&htim14) != HAL_OK) {
701  Error_Handler();
702  }
703  /* USER CODE BEGIN TIM14_Init 2 */
705  /* USER CODE END TIM14_Init 2 */
706 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartDefaultTask()

void StartDefaultTask ( void const argument)

Function implementing the defaultTask thread.

Parameters
argumentNot used
Return values
None
951  {
952  /* init code for USB_DEVICE */
954 
955  /* init code for USB_HOST */
957 
958  /* init code for FATFS */
959  MX_FATFS_Init();
960 
961  /* init code for LWIP */
962  //MX_LWIP_Init();
963 
964  /* USER CODE BEGIN 5 */
965  app_run();
966  /* Infinite loop */
967  for (;;) {
968  osDelay(1);
969  }
970  /* USER CODE END 5 */
971 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartDisplayTask()

void StartDisplayTask ( void const argument)

Function implementing the displayTask thread.

Parameters
argumentNot used
Return values
None
980  {
981  /* USER CODE BEGIN StartDisplayTask */
982  gui_run();
983  /* Infinite loop */
984  for (;;) {
985  osDelay(1);
986  }
987  /* USER CODE END StartDisplayTask */
988 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartIdleTask()

void StartIdleTask ( void const argument)

Function implementing the idleTask thread.

Parameters
argumentNot used
Return values
None
997  {
998  /* USER CODE BEGIN StartIdleTask */
999  /* Infinite loop */
1000  for (;;) {
1001  osDelay(1);
1002  }
1003  /* USER CODE END StartIdleTask */
1004 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartWebServerTask()

void StartWebServerTask ( void const argument)

Function implementing the webServerTask thread.

Parameters
argumentNot used
Return values
None
1013  {
1014  /* USER CODE BEGIN StartWebServerTask */
1015  // osThreadSuspend(0);
1016  MX_LWIP_Init();
1017  lwsapi_init();
1018  /* Infinite loop */
1019  for (;;) {
1020  osDelay(1);
1021  }
1022  /* USER CODE END StartWebServerTask */
1023 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gui_run()

void gui_run ( void  )
107  {
108  if (diag_fastboot)
109  return;
110 
113  gui_init();
114 
115  // select jogwheel type by meassured 'reset delay'
116  // original displays with 15 position encoder returns values 1-2 (short delay - no capacitor)
117  // new displays with MK3 encoder returns values around 16000 (long delay - 100nF capacitor)
118  if (st7789v_reset_delay > 1000) // threshold value is 1000
120  //_dbg("delay=%u", st7789v_reset_delay);
121 
124  window_msgbox_id_icon[0] = 0; //IDR_PNG_icon_pepa;
129 
130  if (!sys_fw_is_valid())
132 
134 
135  hwio_beeper_tone2(440.0, 100, 0.0125); //start beep
136 
139 
141 #ifdef LCDSIM
144 #else //LCDSIM
150  #ifdef _DEBUG
152  #endif //_DEBUG
176  #ifdef PIDCALIBRATION
177  screen_register(pscreen_PID);
178  #endif //PIDCALIBRATION
184 #endif // LCDSIM
185 
186 #ifndef _DEBUG
187  if (HAL_IWDG_Reset) {
190  } else
191 #endif // _DEBUG
193 
194  //set loop callback (will be called every time inside gui_loop)
196  int8_t gui_timeout_id;
197  while (1) {
198  float vol = 0.01F;
199  //simple jogwheel acoustic feedback
200  if ((jogwheel_changed & 1) && jogwheel_button_down) //button changed and pressed
201  hwio_beeper_tone2(200.0, 50, (double)(vol * 0.125F)); //beep
202  else if (jogwheel_changed & 2) // encoder changed
203  hwio_beeper_tone2(50.0, 25, (double)(vol * 0.125F)); //short click
204  // show warning dialog on safety timer expiration
206  gui_msgbox("Heating disabled due to 30 minutes of inactivity.", MSGBOX_BTN_OK | MSGBOX_ICO_WARNING);
207  }
208  gui_loop();
209 #ifndef LCDSIM
210  if (marlin_message_received()) {
211  screen_t *curr = screen_get_curr();
212  if (curr == pscreen_printing) {
214  }
215  }
216  if (menu_timeout_enabled) {
217  gui_timeout_id = gui_get_menu_timeout_id();
218  if (gui_timer_expired(gui_timeout_id) == 1) {
219  screen_t *curr = screen_get_curr();
220  if (
221  curr != pscreen_menu_tune && curr != pscreen_wizard && curr != pscreen_print_preview) { //timeout screen black list
222  #ifdef PIDCALIBRATION
223  if (curr != pscreen_PID) {
224  #endif //PIDCALIBRATION
225  while (curr != pscreen_printing && curr != pscreen_home && curr != pscreen_menu_tune) {
226  screen_close();
227  curr = screen_get_curr();
228  }
229  #ifdef PIDCALIBRATION
230  }
231  #endif //PIDCALIBRATION
232  }
233  gui_timer_delete(gui_timeout_id);
234  }
235  }
237  if (marlin_command() == MARLIN_CMD_M600) {
238  _dbg("M600 start");
239  gui_dlg_change();
240  _dbg("M600 end");
241  }
242  }
243 #endif //LCDSIM
244  }
245 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Error_Handler()

void Error_Handler ( void  )

This function is executed in case of error occurrence.

Return values
None
1057  {
1058  /* USER CODE BEGIN Error_Handler_Debug */
1059  /* User can add his own implementation to report the HAL error return state */
1060  app_error();
1061  /* USER CODE END Error_Handler_Debug */
1062 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( void  )

The application entry point.

Return values
int
161  {
162  /* USER CODE BEGIN 1 */
163 
164  /*
165 #define RCC_FLAG_LSIRDY ((uint8_t)0x61)
166 #define RCC_FLAG_BORRST ((uint8_t)0x79)
167 #define RCC_FLAG_PINRST ((uint8_t)0x7A)
168 #define RCC_FLAG_PORRST ((uint8_t)0x7B)
169 #define RCC_FLAG_SFTRST ((uint8_t)0x7C)
170 #define RCC_FLAG_IWDGRST ((uint8_t)0x7D)
171 #define RCC_FLAG_WWDGRST ((uint8_t)0x7E)
172 #define RCC_FLAG_LPWRRST ((uint8_t)0x7F)
173 */
174 
175  //__HAL_RCC_GET_FLAG(RCC_FLAG_LPWRRST);
176  //__HAL_RCC_GET_FLAG(RCC_FLAG_WWDGRST);
178  HAL_IWDG_Reset = 1;
179  //__HAL_RCC_GET_FLAG(RCC_FLAG_SFTRST);
180  //__HAL_RCC_GET_FLAG(RCC_FLAG_PORRST);
181  //__HAL_RCC_GET_FLAG(RCC_FLAG_PINRST);
182  //__HAL_RCC_GET_FLAG(RCC_FLAG_BORRST);
184 
185  /* USER CODE END 1 */
186 
187  /* MCU Configuration--------------------------------------------------------*/
188 
189  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
190  HAL_Init();
191 
192  /* USER CODE BEGIN Init */
193 
194  /* USER CODE END Init */
195 
196  /* Configure the system clock */
198 
199  /* USER CODE BEGIN SysInit */
200 
202 
203  /* USER CODE END SysInit */
204 
205  /* Initialize all configured peripherals */
206  MX_GPIO_Init();
207  MX_DMA_Init();
208  MX_I2C1_Init();
209  MX_IWDG_Init();
210  MX_ADC1_Init();
212  MX_TIM1_Init();
213  MX_TIM3_Init();
214  MX_SPI2_Init();
217  MX_SPI3_Init();
218  MX_TIM2_Init();
219  MX_TIM14_Init();
220  /* USER CODE BEGIN 2 */
225 
228 
233 
234  /* USER CODE END 2 */
235 
236  /* USER CODE BEGIN RTOS_MUTEX */
237  /* add mutexes, ... */
238  /* USER CODE END RTOS_MUTEX */
239 
240  /* USER CODE BEGIN RTOS_SEMAPHORES */
241  /* add semaphores, ... */
242  /* USER CODE END RTOS_SEMAPHORES */
243 
244  /* USER CODE BEGIN RTOS_TIMERS */
245  /* start timers, add new ones, ... */
246  /* USER CODE END RTOS_TIMERS */
247 
248  /* Create the thread(s) */
249  /* definition and creation of defaultTask */
250  osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 1024);
252 
253  /* definition and creation of displayTask */
254  osThreadDef(displayTask, StartDisplayTask, osPriorityNormal, 0, 2048);
256 
257  /* definition and creation of idleTask */
258  osThreadDef(idleTask, StartIdleTask, osPriorityIdle, 0, 128);
260 
261  /* definition and creation of webServerTask */
262  osThreadDef(webServerTask, StartWebServerTask, osPriorityNormal, 0, 4096);
263  webServerTaskHandle = osThreadCreate(osThread(webServerTask), NULL);
264 
265  /* USER CODE BEGIN RTOS_THREADS */
266  /* add threads, ... */
267  /* definition and creation of measurementTask */
268  osThreadDef(measurementTask, StartMeasurementTask, osPriorityNormal, 0, 512);
269  measurementTaskHandle = osThreadCreate(osThread(measurementTask), NULL);
270  /* USER CODE END RTOS_THREADS */
271 
272  /* USER CODE BEGIN RTOS_QUEUES */
273  /* add queues, ... */
274  /* USER CODE END RTOS_QUEUES */
275 
276  /* Start scheduler */
277  osKernelStart();
278 
279  /* We should never get here as control is now taken by the scheduler */
280 
281  /* Infinite loop */
282  /* USER CODE BEGIN WHILE */
283  while (1) {
284  /* USER CODE END WHILE */
285 
286  /* USER CODE BEGIN 3 */
287  }
288  /* USER CODE END 3 */
289 }
Here is the call graph for this function:

◆ st7789v_spi_tx_complete()

void st7789v_spi_tx_complete ( void  )
927  {
928 #ifdef ST7789V_USE_RTOS
929  osSignalSet(st7789v_task_handle, ST7789V_SIG_SPI_TX);
930 #endif //ST7789V_USE_RTOS
931 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ 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

DMA_HandleTypeDef 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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. 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.
  3. 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

UART_HandleTypeDef huart1
static

◆ huart2

◆ huart6

◆ hdma_usart1_rx

DMA_HandleTypeDef hdma_usart1_rx

◆ hdma_usart2_rx

DMA_HandleTypeDef hdma_usart2_rx

◆ hdma_usart6_rx

DMA_HandleTypeDef hdma_usart6_rx

◆ defaultTaskHandle

osThreadId defaultTaskHandle

◆ displayTaskHandle

osThreadId displayTaskHandle

◆ idleTaskHandle

osThreadId idleTaskHandle

◆ webServerTaskHandle

osThreadId webServerTaskHandle

◆ measurementTaskHandle

osThreadId measurementTaskHandle

◆ HAL_IWDG_Reset

int HAL_IWDG_Reset = 0

◆ 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

uartrxbuff_t uart1rxbuff

◆ uart1rx_data

uint8_t uart1rx_data[200]
static

◆ uart6rxbuff

uartrxbuff_t uart6rxbuff

◆ uart6rx_data

uint8_t uart6rx_data[32]

◆ uart6slave

uartslave_t uart6slave

◆ uart6slave_line

char uart6slave_line[32]

◆ Tacho_FAN0

uint32_t Tacho_FAN0

◆ Tacho_FAN1

uint32_t Tacho_FAN1
I2C_InitTypeDef::OwnAddress2
uint32_t OwnAddress2
Definition: stm32f4xx_hal_i2c.h:80
RCC_PLLP_DIV2
#define RCC_PLLP_DIV2
Definition: stm32f4xx_hal_rcc.h:186
pscreen_test_msgbox
screen_t * pscreen_test_msgbox
Definition: screen_test_msgbox.c:147
pscreen_test_term
screen_t * pscreen_test_term
Definition: screen_test_term.c:78
UART_OVERSAMPLING_16
#define UART_OVERSAMPLING_16
Definition: stm32f4xx_hal_uart.h:276
window_register_class
int16_t window_register_class(window_class_t *cls)
Definition: window.c:90
idleTaskHandle
osThreadId idleTaskHandle
Definition: main.c:99
LCD_RS_Pin
#define LCD_RS_Pin
Definition: main.h:141
jogwheel_config
jogwheel_config_t jogwheel_config
Definition: jogwheel.c:95
WINDOW_CLS_DLG_LOADUNLOAD
int16_t WINDOW_CLS_DLG_LOADUNLOAD
Definition: window_dlg_statemachine.c:37
E_DIR_Pin
#define E_DIR_Pin
Definition: main.h:135
window_msgbox_id_icon
uint16_t window_msgbox_id_icon[5]
Definition: window_msgbox.c:62
hiwdg
IWDG_HandleTypeDef hiwdg
Definition: main.c:79
TIM_BreakDeadTimeConfigTypeDef::BreakState
uint32_t BreakState
Definition: stm32f4xx_hal_tim_ex.h:104
SPI_FIRSTBIT_MSB
#define SPI_FIRSTBIT_MSB
Definition: stm32f4xx_hal_spi.h:251
SPI_BAUDRATEPRESCALER_2
#define SPI_BAUDRATEPRESCALER_2
Definition: stm32f4xx_hal_spi.h:236
pscreen_lan_settings
screen_t *const pscreen_lan_settings
Definition: screen_lan_settings.c:294
TIM_Base_InitTypeDef::Period
uint32_t Period
Definition: stm32f4xx_hal_tim.h:71
gui_loop_cb
gui_loop_cb_t * gui_loop_cb
Definition: gui.c:32
FAN0_TACH_Pin
#define FAN0_TACH_Pin
Definition: main.h:117
UART_HWCONTROL_NONE
#define UART_HWCONTROL_NONE
Definition: stm32f4xx_hal_uart.h:246
StartWebServerTask
void StartWebServerTask(void const *argument)
Function implementing the webServerTask thread.
Definition: main.c:1013
ADC_InitTypeDef::ContinuousConvMode
uint32_t ContinuousConvMode
Definition: stm32f4xx_hal_adc.h:97
MARLIN_EVT_SafetyTimerExpired
#define MARLIN_EVT_SafetyTimerExpired
Definition: marlin_events.h:35
ADC_HandleTypeDef::Instance
ADC_TypeDef * Instance
Definition: stm32f4xx_hal_adc.h:210
TIM_OCNPOLARITY_HIGH
#define TIM_OCNPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:395
GPIO_MODE_OUTPUT_PP
#define GPIO_MODE_OUTPUT_PP
Definition: stm32f4xx_hal_gpio.h:136
Z_DIAG_Pin
#define Z_DIAG_Pin
Definition: main.h:87
HAL_TIM_Base_Init
HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim)
HAL_TIM_MspPostInit
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim)
Definition: stm32f4xx_hal_msp.c:430
LCD_SW2_Pin
#define LCD_SW2_Pin
Definition: main.h:129
MX_USART2_UART_Init
static void MX_USART2_UART_Init(void)
USART2 Initialization Function.
Definition: main.c:743
osThreadDef
#define osThreadDef(name, thread, priority, instances, stacksz)
Definition: cmsis_os.h:468
HAL_OK
Definition: stm32f4xx_hal_def.h:57
lwsapi_init
err_t lwsapi_init(void)
Init (start) the LwIP WSAPI server.
Definition: lwsapi.cpp:413
MX_USART1_UART_Init
static void MX_USART1_UART_Init(void)
USART1 Initialization Function.
Definition: main.c:713
uartrxbuff_init
void uartrxbuff_init(uartrxbuff_t *prxbuff, UART_HandleTypeDef *phuart, DMA_HandleTypeDef *phdma, uint8_t size, uint8_t *pdata)
Definition: uartrxbuff.c:15
RCC_HCLK_DIV2
#define RCC_HCLK_DIV2
Definition: stm32f4xx_hal_rcc.h:260
RCC_PLLInitTypeDef::PLLP
uint32_t PLLP
Definition: stm32f4xx_hal_rcc_ex.h:78
TIM_OCFAST_DISABLE
#define TIM_OCFAST_DISABLE
Definition: stm32f4xx_hal_tim.h:377
uart6slave_line
char uart6slave_line[32]
Definition: main.c:150
HAL_TIM_PWM_ConfigChannel
HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfig, uint32_t Channel)
RCC_ClkInitTypeDef
RCC System, AHB and APB busses clock configuration structure definition.
Definition: stm32f4xx_hal_rcc.h:93
WINDOW_CLS_LCDSIM
int16_t WINDOW_CLS_LCDSIM
Definition: window_lcdsim.c:6
uart1rx_data
static uint8_t uart1rx_data[200]
Definition: main.c:145
htim2
TIM_HandleTypeDef htim2
Definition: main.c:86
TIM_BREAK_DISABLE
#define TIM_BREAK_DISABLE
Definition: stm32f4xx_hal_tim.h:662
jogwheel_changed
uint8_t jogwheel_changed
Definition: jogwheel.c:14
MX_ADC1_Init
static void MX_ADC1_Init(void)
ADC1 Initialization Function.
Definition: main.c:336
huart2
UART_HandleTypeDef huart2
Definition: main.c:91
HAL_PWM_Initialized
int HAL_PWM_Initialized
Definition: main.c:106
uart6rx_data
uint8_t uart6rx_data[32]
Definition: main.c:148
SPI_DIRECTION_2LINES
#define SPI_DIRECTION_2LINES
Definition: stm32f4xx_hal_spi.h:189
update_firmware_screen
void update_firmware_screen(void)
Definition: guimain.c:247
__SPI_HandleTypeDef::Instance
SPI_TypeDef * Instance
Definition: stm32f4xx_hal_spi.h:122
HAL_RCC_OscConfig
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
MX_TIM3_Init
static void MX_TIM3_Init(void)
TIM3 Initialization Function.
Definition: main.c:631
GPIO_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f4xx_hal_gpio.h:68
RCC_ClkInitTypeDef::SYSCLKSource
uint32_t SYSCLKSource
Definition: stm32f4xx_hal_rcc.h:98
HAL_IWDG_Reset
int HAL_IWDG_Reset
Definition: main.c:103
ADC_EOC_SINGLE_CONV
#define ADC_EOC_SINGLE_CONV
Definition: stm32f4xx_hal_adc.h:386
__HAL_RCC_GPIOB_CLK_ENABLE
#define __HAL_RCC_GPIOB_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:409
app_error
void app_error(void)
Definition: appmain.cpp:145
gui_init
void gui_init(void)
Definition: gui.c:43
TIM_BreakDeadTimeConfigTypeDef
TIM Break and Dead time configuration Structure definition.
Definition: stm32f4xx_hal_tim_ex.h:94
X_ENA_Pin
#define X_ENA_Pin
Definition: main.h:183
SPI_InitTypeDef::CLKPhase
uint32_t CLKPhase
Definition: stm32f4xx_hal_spi.h:77
ADC_SAMPLETIME_3CYCLES
#define ADC_SAMPLETIME_3CYCLES
Definition: stm32f4xx_hal_adc.h:370
ADC_RESOLUTION_12B
#define ADC_RESOLUTION_12B
Definition: stm32f4xx_hal_adc.h:284
USB_OVERC_Pin
#define USB_OVERC_Pin
Definition: main.h:89
TIM_OC_InitTypeDef::OCIdleState
uint32_t OCIdleState
Definition: stm32f4xx_hal_tim.h:112
marlin_message_received
uint8_t marlin_message_received(void)
Definition: marlin_client.c:507
MX_TIM1_Init
static void MX_TIM1_Init(void)
TIM1 Initialization Function.
Definition: main.c:510
MX_USB_HOST_Init
void MX_USB_HOST_Init(void)
USB Host initialization function.
Definition: usb_host.c:100
HAL_TIM_Base_Start_IT
HAL_StatusTypeDef HAL_TIM_Base_Start_IT(TIM_HandleTypeDef *htim)
uartrxbuff_open
void uartrxbuff_open(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:24
window_class_dlg_preheat
const window_class_dlg_preheat_t window_class_dlg_preheat
Definition: window_dlg_preheat.c:114
TIM_Base_InitTypeDef::ClockDivision
uint32_t ClockDivision
Definition: stm32f4xx_hal_tim.h:75
ADC_DATAALIGN_RIGHT
#define ADC_DATAALIGN_RIGHT
Definition: stm32f4xx_hal_adc.h:332
pscreen_menu_calibration
screen_t * pscreen_menu_calibration
Definition: screen_menu_calibration.c:101
IWDG_PRESCALER_4
#define IWDG_PRESCALER_4
Definition: stm32f4xx_hal_iwdg.h:96
LCD_SW3_Pin
#define LCD_SW3_Pin
Definition: main.h:124
HAL_ADC_Initialized
int HAL_ADC_Initialized
Definition: main.c:105
WP2_Pin
#define WP2_Pin
Definition: main.h:191
HAL_TIMEx_MasterConfigSynchronization
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef *sMasterConfig)
TIM_OC_InitTypeDef::OCNPolarity
uint32_t OCNPolarity
Definition: stm32f4xx_hal_tim.h:103
screen_register
int16_t screen_register(screen_t *pscreen)
Definition: screen.c:24
SPI_TIMODE_DISABLE
#define SPI_TIMODE_DISABLE
Definition: stm32f4xx_hal_spi.h:260
MX_SPI2_Init
static void MX_SPI2_Init(void)
SPI2 Initialization Function.
Definition: main.c:440
hi2c1
I2C_HandleTypeDef hi2c1
Definition: main.c:77
Z_MIN_Pin
#define Z_MIN_Pin
Definition: main.h:159
uart1rxbuff
uartrxbuff_t uart1rxbuff
Definition: main.c:144
USB_EN_GPIO_Port
#define USB_EN_GPIO_Port
Definition: main.h:92
window_class_dlg_popup
const window_class_dlg_popup_t window_class_dlg_popup
Definition: window_dlg_popup.c:51
TIM_OC_InitTypeDef::OCPolarity
uint32_t OCPolarity
Definition: stm32f4xx_hal_tim.h:100
ADC_InitTypeDef::DMAContinuousRequests
uint32_t DMAContinuousRequests
Definition: stm32f4xx_hal_adc.h:117
_gui_defaults_t::font
font_t * font
Definition: guitypes.h:110
TIM_MasterConfigTypeDef
TIM Master configuration Structure definition.
Definition: stm32f4xx_hal_tim_ex.h:83
MX_GPIO_Init
static void MX_GPIO_Init(void)
GPIO Initialization Function.
Definition: main.c:826
jogwheel_cfg
const jogwheel_config_t jogwheel_cfg
Definition: guimain.c:95
UART_PARITY_NONE
#define UART_PARITY_NONE
Definition: stm32f4xx_hal_uart.h:236
RCC_HSE_ON
#define RCC_HSE_ON
Definition: stm32f4xx_hal_rcc.h:137
SPI_InitTypeDef::CLKPolarity
uint32_t CLKPolarity
Definition: stm32f4xx_hal_spi.h:74
X_DIR_Pin
#define X_DIR_Pin
Definition: main.h:177
I2C_InitTypeDef::DutyCycle
uint32_t DutyCycle
Definition: stm32f4xx_hal_i2c.h:68
TIM_OCIDLESTATE_RESET
#define TIM_OCIDLESTATE_RESET
Definition: stm32f4xx_hal_tim.h:405
HAL_IWDG_Init
HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg)
ADC_CHANNEL_4
#define ADC_CHANNEL_4
Definition: stm32f4xx_hal_adc.h:345
IDR_FNT_NORMAL
#define IDR_FNT_NORMAL
Definition: resource.h:10
htim14
TIM_HandleTypeDef htim14
Definition: main.c:88
RCC_CLOCKTYPE_PCLK2
#define RCC_CLOCKTYPE_PCLK2
Definition: stm32f4xx_hal_rcc.h:209
TIM_OC_InitTypeDef::OCFastMode
uint32_t OCFastMode
Definition: stm32f4xx_hal_tim.h:107
Z_STEP_Pin
#define Z_STEP_Pin
Definition: main.h:185
WINDOW_CLS_DLG_PREHEAT
int16_t WINDOW_CLS_DLG_PREHEAT
Definition: window_dlg_preheat.c:22
MSGBOX_ICO_WARNING
#define MSGBOX_ICO_WARNING
Definition: window_msgbox.h:35
GPIO_InitTypeDef::Pull
uint32_t Pull
Definition: stm32f4xx_hal_gpio.h:71
RCC_CLOCKTYPE_PCLK1
#define RCC_CLOCKTYPE_PCLK1
Definition: stm32f4xx_hal_rcc.h:208
osPriorityIdle
priority: idle (lowest)
Definition: cmsis_os.h:218
osSignalSet
int32_t osSignalSet(osThreadId thread_id, int32_t signal)
Set the specified Signal Flags of an active thread.
Definition: cmsis_os.c:545
pscreen_menu_service
screen_t * pscreen_menu_service
Definition: screen_menu_service.c:147
pscreen_filebrowser
screen_t * pscreen_filebrowser
Definition: screen_filebrowser.cpp:177
TIM_TRGO_RESET
#define TIM_TRGO_RESET
Definition: stm32f4xx_hal_tim.h:688
MARLIN_CMD_M600
#define MARLIN_CMD_M600
Definition: marlin_events.h:57
HAL_SPI_Initialized
int HAL_SPI_Initialized
Definition: main.c:107
SPI_InitTypeDef::CRCPolynomial
uint32_t CRCPolynomial
Definition: stm32f4xx_hal_spi.h:99
RCC_PLLInitTypeDef::PLLQ
uint32_t PLLQ
Definition: stm32f4xx_hal_rcc_ex.h:81
osKernelStart
osStatus osKernelStart(void)
Start the RTOS Kernel with executing the specified thread.
Definition: cmsis_os.c:193
TIM_Base_InitTypeDef::CounterMode
uint32_t CounterMode
Definition: stm32f4xx_hal_tim.h:68
Z_DIR_Pin
#define Z_DIR_Pin
Definition: main.h:149
UART_MODE_TX_RX
#define UART_MODE_TX_RX
Definition: stm32f4xx_hal_uart.h:259
diag_fastboot
int diag_fastboot
Definition: diag.c:11
RCC_LSI_ON
#define RCC_LSI_ON
Definition: stm32f4xx_hal_rcc.h:168
SPI_CRCCALCULATION_DISABLE
#define SPI_CRCCALCULATION_DISABLE
Definition: stm32f4xx_hal_spi.h:269
screen_open
void screen_open(int16_t screen_id)
Definition: screen.c:62
RCC_PLLInitTypeDef::PLLSource
uint32_t PLLSource
Definition: stm32f4xx_hal_rcc_ex.h:68
RCC_OSCILLATORTYPE_LSI
#define RCC_OSCILLATORTYPE_LSI
Definition: stm32f4xx_hal_rcc.h:128
ADC_SOFTWARE_START
#define ADC_SOFTWARE_START
Definition: stm32f4xx_hal_adc.h:324
TIM_OCMODE_PWM1
#define TIM_OCMODE_PWM1
Definition: stm32f4xx_hal_tim.h:365
pscreen_menu_preheat
screen_t * pscreen_menu_preheat
Definition: screen_menu_preheat.cpp:93
huart6
UART_HandleTypeDef huart6
Definition: main.c:92
marlin_client_loop
void marlin_client_loop(void)
Definition: marlin_client.c:118
I2C_GENERALCALL_DISABLE
#define I2C_GENERALCALL_DISABLE
Definition: stm32f4xx_hal_i2c.h:257
TIM_OC_InitTypeDef
TIM Output Compare Configuration Structure definition.
Definition: stm32f4xx_hal_tim.h:92
uartslave_init
void uartslave_init(uartslave_t *pslave, uartrxbuff_t *prxbuff, int size, char *pline)
Definition: uartslave.c:57
ADC_ChannelConfTypeDef::Channel
uint32_t Channel
Definition: stm32f4xx_hal_adc.h:133
IWDG_InitTypeDef::Reload
uint32_t Reload
Definition: stm32f4xx_hal_iwdg.h:68
RCC_OscInitTypeDef::OscillatorType
uint32_t OscillatorType
Definition: stm32f4xx_hal_rcc.h:69
RCC_PLLInitTypeDef::PLLM
uint32_t PLLM
Definition: stm32f4xx_hal_rcc_ex.h:71
NULL
#define NULL
Definition: usbd_def.h:53
F
#define F(str)
Definition: UHS_macros.h:164
RCC_OscInitTypeDef::HSEState
uint32_t HSEState
Definition: stm32f4xx_hal_rcc.h:72
TIM_BreakDeadTimeConfigTypeDef::AutomaticOutput
uint32_t AutomaticOutput
Definition: stm32f4xx_hal_tim_ex.h:108
ADC_CLOCK_SYNC_PCLK_DIV4
#define ADC_CLOCK_SYNC_PCLK_DIV4
Definition: stm32f4xx_hal_adc.h:251
TIM_CHANNEL_3
#define TIM_CHANNEL_3
Definition: stm32f4xx_hal_tim.h:424
WINDOW_CLS_LOGO
int16_t WINDOW_CLS_LOGO
Definition: window_logo.c:11
pscreen_marlin
const screen_t * pscreen_marlin
Definition: screen_marlin.c:33
pscreen_menu_filament
screen_t * pscreen_menu_filament
Definition: screen_menu_filament.c:124
screen_get_curr
screen_t * screen_get_curr(void)
Definition: screen.c:114
window_class_dlg_wait
const window_class_dlg_wait_t window_class_dlg_wait
Definition: window_dlg_wait.c:128
MSGBOX_BTN_OK
#define MSGBOX_BTN_OK
Definition: window_msgbox.h:20
window_class_file_list
const window_class_file_list_t window_class_file_list
Definition: window_file_list.c:250
GPIO_PULLUP
#define GPIO_PULLUP
Definition: stm32f4xx_hal_gpio.h:171
WINDOW_CLS_DLG_WAIT
int16_t WINDOW_CLS_DLG_WAIT
Definition: window_dlg_wait.c:25
osDelay
osStatus osDelay(uint32_t millisec)
Wait for Timeout (Time Delay)
Definition: cmsis_os.c:365
ADC_ChannelConfTypeDef::Rank
uint32_t Rank
Definition: stm32f4xx_hal_adc.h:135
gui_dlg_change
dlg_result_t gui_dlg_change(void)
Definition: window_dlg_change.c:35
__HAL_PWR_VOLTAGESCALING_CONFIG
#define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__)
macros configure the main internal regulator output voltage.
Definition: stm32f4xx_hal_pwr_ex.h:153
TIM_BreakDeadTimeConfigTypeDef::LockLevel
uint32_t LockLevel
Definition: stm32f4xx_hal_tim_ex.h:100
screen_close
void screen_close(void)
Definition: screen.c:80
MX_DMA_Init
static void MX_DMA_Init(void)
Definition: main.c:801
HAL_TIMEx_ConfigBreakDeadTime
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig)
RCC_PLLSOURCE_HSE
#define RCC_PLLSOURCE_HSE
Definition: stm32f4xx_hal_rcc.h:198
__HAL_RCC_GPIOH_CLK_ENABLE
#define __HAL_RCC_GPIOH_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:423
TIM_BREAKPOLARITY_HIGH
#define TIM_BREAKPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:671
TIM_BreakDeadTimeConfigTypeDef::OffStateIDLEMode
uint32_t OffStateIDLEMode
Definition: stm32f4xx_hal_tim_ex.h:98
IDR_PNG_header_icon_question
#define IDR_PNG_header_icon_question
Definition: resource.h:69
huart1
static UART_HandleTypeDef huart1
Definition: main.c:90
pscreen_wizard
screen_t * pscreen_wizard
Definition: screen_wizard.c:559
StartDefaultTask
void StartDefaultTask(void const *argument)
Function implementing the defaultTask thread.
Definition: main.c:951
TIM_CLOCKDIVISION_DIV1
#define TIM_CLOCKDIVISION_DIV1
Definition: stm32f4xx_hal_tim.h:351
HAL_GPIO_Initialized
int HAL_GPIO_Initialized
Definition: main.c:104
pscreen_splash
screen_t * pscreen_splash
Definition: screen_splash.c:144
HAL_Init
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
IWDG_InitTypeDef::Prescaler
uint32_t Prescaler
Definition: stm32f4xx_hal_iwdg.h:65
RCC_PLL_ON
#define RCC_PLL_ON
Definition: stm32f4xx_hal_rcc.h:178
E_STEP_Pin
#define E_STEP_Pin
Definition: main.h:137
E_DIAG_Pin
#define E_DIAG_Pin
Definition: main.h:169
window_class_temp_graph
const window_class_temp_graph_t window_class_temp_graph
Definition: window_temp_graph.c:132
X_DIAG_Pin
#define X_DIAG_Pin
Definition: main.h:85
hspi3
SPI_HandleTypeDef hspi3
Definition: main.c:82
RCC_HCLK_DIV4
#define RCC_HCLK_DIV4
Definition: stm32f4xx_hal_rcc.h:261
MX_USB_DEVICE_Init
void MX_USB_DEVICE_Init(void)
Definition: usb_device.c:93
FAN1_TACH_Pin
#define FAN1_TACH_Pin
Definition: main.h:126
st7789v_cfg
const st7789v_config_t st7789v_cfg
Definition: guimain.c:85
I2C_InitTypeDef::AddressingMode
uint32_t AddressingMode
Definition: stm32f4xx_hal_i2c.h:74
GPIO_PIN_RESET
Definition: stm32f4xx_hal_gpio.h:86
pscreen_mesh_bed_lv
screen_t * pscreen_mesh_bed_lv
Definition: screen_mesh_bed_lv.cpp:228
TIM_Base_InitTypeDef::RepetitionCounter
uint32_t RepetitionCounter
Definition: stm32f4xx_hal_tim.h:78
TIM_BreakDeadTimeConfigTypeDef::DeadTime
uint32_t DeadTime
Definition: stm32f4xx_hal_tim_ex.h:102
marlin_client_init
marlin_vars_t * marlin_client_init(void)
Definition: marlin_client.c:84
SPI_NSS_SOFT
#define SPI_NSS_SOFT
Definition: stm32f4xx_hal_spi.h:226
pscreen_printing
screen_t * pscreen_printing
Definition: screen_printing.cpp:161
pscreen_menu_info
screen_t * pscreen_menu_info
Definition: screen_menu_info.c:66
TIM_CLOCKSOURCE_INTERNAL
#define TIM_CLOCKSOURCE_INTERNAL
Definition: stm32f4xx_hal_tim.h:565
__HAL_RCC_CLEAR_RESET_FLAGS
#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
ESP_RST_Pin
#define ESP_RST_Pin
Definition: main.h:95
GPIO_MODE_IT_RISING
#define GPIO_MODE_IT_RISING
Definition: stm32f4xx_hal_gpio.h:143
RCC_OscInitTypeDef::PLL
RCC_PLLInitTypeDef PLL
Definition: stm32f4xx_hal_rcc.h:87
pscreen_menu_move
screen_t * pscreen_menu_move
Definition: screen_menu_move.c:85
ADC_ChannelConfTypeDef
Structure definition of ADC channel for regular group.
Definition: stm32f4xx_hal_adc.h:131
HAL_ADC_Init
HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef *hadc)
UART_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f4xx_hal_uart.h:84
sys_fw_is_valid
int sys_fw_is_valid(void)
Definition: sys.cpp:266
ADC_InitTypeDef::DataAlign
uint32_t DataAlign
Definition: stm32f4xx_hal_adc.h:80
TIM_COUNTERMODE_UP
#define TIM_COUNTERMODE_UP
Definition: stm32f4xx_hal_tim.h:339
UART_InitTypeDef::BaudRate
uint32_t BaudRate
Definition: stm32f4xx_hal_uart.h:65
pscreen_test_temperature
screen_t * pscreen_test_temperature
Definition: screen_test_temperature.cpp:109
SPI_InitTypeDef::TIMode
uint32_t TIMode
Definition: stm32f4xx_hal_spi.h:93
MX_I2C1_Init
static void MX_I2C1_Init(void)
I2C1 Initialization Function.
Definition: main.c:382
MARLIN_EVT_CommandBegin
#define MARLIN_EVT_CommandBegin
Definition: marlin_events.h:33
SPI_PHASE_1EDGE
#define SPI_PHASE_1EDGE
Definition: stm32f4xx_hal_spi.h:217
RCC_CLOCKTYPE_SYSCLK
#define RCC_CLOCKTYPE_SYSCLK
Definition: stm32f4xx_hal_rcc.h:206
IWDG_HandleTypeDef::Instance
IWDG_TypeDef * Instance
Definition: stm32f4xx_hal_iwdg.h:78
I2C_InitTypeDef::GeneralCallMode
uint32_t GeneralCallMode
Definition: stm32f4xx_hal_i2c.h:83
ADC_InitTypeDef::Resolution
uint32_t Resolution
Definition: stm32f4xx_hal_adc.h:78
TIM_CHANNEL_2
#define TIM_CHANNEL_2
Definition: stm32f4xx_hal_tim.h:423
webServerTaskHandle
osThreadId webServerTaskHandle
Definition: main.c:100
E_ENA_Pin
#define E_ENA_Pin
Definition: main.h:139
TIM_OSSR_DISABLE
#define TIM_OSSR_DISABLE
Definition: stm32f4xx_hal_tim.h:634
TIM_CHANNEL_4
#define TIM_CHANNEL_4
Definition: stm32f4xx_hal_tim.h:425
HAL_GPIO_Init
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
IDR_PNG_header_icon_error
#define IDR_PNG_header_icon_error
Definition: resource.h:67
RCC_PLLInitTypeDef::PLLState
uint32_t PLLState
Definition: stm32f4xx_hal_rcc_ex.h:65
RCC_ClkInitTypeDef::APB1CLKDivider
uint32_t APB1CLKDivider
Definition: stm32f4xx_hal_rcc.h:104
HAL_NVIC_SetPriority
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
TIM_OCNIDLESTATE_RESET
#define TIM_OCNIDLESTATE_RESET
Definition: stm32f4xx_hal_tim.h:414
GPIO_NOPULL
#define GPIO_NOPULL
Definition: stm32f4xx_hal_gpio.h:170
screen_stack_push
void screen_stack_push(int16_t screen_id)
Definition: screen.c:48
ADC_InitTypeDef::ClockPrescaler
uint32_t ClockPrescaler
Definition: stm32f4xx_hal_adc.h:75
_jogwheel_config_t::flg
uint8_t flg
Definition: jogwheel.h:24
gui_run
void gui_run(void)
Definition: guimain.c:107
jogwheel_button_down
uint16_t jogwheel_button_down
Definition: jogwheel.c:13
UART_HandleTypeDef::Instance
USART_TypeDef * Instance
Definition: stm32f4xx_hal_uart.h:160
HAL_GPIO_WritePin
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
HAL_UART_Init
HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
TIM_HandleTypeDef::Instance
TIM_TypeDef * Instance
Definition: stm32f4xx_hal_tim.h:289
ADC_ChannelConfTypeDef::SamplingTime
uint32_t SamplingTime
Definition: stm32f4xx_hal_adc.h:137
uart6slave
uartslave_t uart6slave
Definition: main.c:149
TIM_COUNTERMODE_DOWN
#define TIM_COUNTERMODE_DOWN
Definition: stm32f4xx_hal_tim.h:340
pscreen_menu_fw_update
screen_t *const pscreen_menu_fw_update
Definition: screen_menu_fw_update.c:75
HAL_SPI_Init
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)
I2C_InitTypeDef::OwnAddress1
uint32_t OwnAddress1
Definition: stm32f4xx_hal_i2c.h:71
TIM_CHANNEL_1
#define TIM_CHANNEL_1
Definition: stm32f4xx_hal_tim.h:422
TIM_AUTOMATICOUTPUT_DISABLE
#define TIM_AUTOMATICOUTPUT_DISABLE
Definition: stm32f4xx_hal_tim.h:680
HAL_IWDG_Reset
int HAL_IWDG_Reset
Definition: main.c:103
SPI_POLARITY_LOW
#define SPI_POLARITY_LOW
Definition: stm32f4xx_hal_spi.h:208
window_class_logo
const window_class_logo_t window_class_logo
Definition: window_logo.c:51
JOGWHEEL_FLG_INV_DIR
#define JOGWHEEL_FLG_INV_DIR
Definition: jogwheel.h:8
WINDOW_CLS_DLG_POPUP
int16_t WINDOW_CLS_DLG_POPUP
Definition: window_dlg_popup.c:16
I2C_HandleTypeDef::Init
I2C_InitTypeDef Init
Definition: stm32f4xx_hal_i2c.h:168
StartIdleTask
void StartIdleTask(void const *argument)
Function implementing the idleTask thread.
Definition: main.c:997
gui_marlin_vars
marlin_vars_t * gui_marlin_vars
Definition: guimain.c:102
TIM3_default_Period
#define TIM3_default_Period
Definition: timer_defaults.h:13
__HAL_RCC_DMA2_CLK_ENABLE
#define __HAL_RCC_DMA2_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:437
defaultTaskHandle
osThreadId defaultTaskHandle
Definition: main.c:97
E_DIAG_GPIO_Port
#define E_DIAG_GPIO_Port
Definition: main.h:170
I2C_DUALADDRESS_DISABLE
#define I2C_DUALADDRESS_DISABLE
Definition: stm32f4xx_hal_i2c.h:248
ADC_HandleTypeDef::Init
ADC_InitTypeDef Init
Definition: stm32f4xx_hal_adc.h:212
IDR_PNG_header_icon_info
#define IDR_PNG_header_icon_info
Definition: resource.h:66
pscreen_test_gui
screen_t * pscreen_test_gui
Definition: screen_test_gui.c:131
_window_class_t
Definition: window.h:67
hdma_usart1_rx
DMA_HandleTypeDef hdma_usart1_rx
Definition: main.c:93
IDR_FNT_BIG
#define IDR_FNT_BIG
Definition: resource.h:11
ADC_EXTERNALTRIGCONVEDGE_NONE
#define ADC_EXTERNALTRIGCONVEDGE_NONE
Definition: stm32f4xx_hal_adc.h:295
_dbg
#define _dbg(...)
Definition: dbg.h:50
SystemClock_Config
void SystemClock_Config(void)
System Clock Configuration.
Definition: main.c:295
app_run
void app_run(void)
Definition: appmain.cpp:62
RCC_CLOCKTYPE_HCLK
#define RCC_CLOCKTYPE_HCLK
Definition: stm32f4xx_hal_rcc.h:207
Y_STEP_Pin
#define Y_STEP_Pin
Definition: main.h:145
HAL_TIM_PWM_Init
HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim)
IDR_PNG_header_icon_warning
#define IDR_PNG_header_icon_warning
Definition: resource.h:68
_screen_t
Definition: screen.h:18
TIM_Base_InitTypeDef::Prescaler
uint32_t Prescaler
Definition: stm32f4xx_hal_tim.h:65
MX_LWIP_Init
void MX_LWIP_Init(void)
Definition: lwip.c:95
SPI_InitTypeDef::FirstBit
uint32_t FirstBit
Definition: stm32f4xx_hal_spi.h:90
TIM1_default_Period
#define TIM1_default_Period
Definition: timer_defaults.h:11
HAL_NVIC_EnableIRQ
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
pscreen_menu_settings
screen_t * pscreen_menu_settings
Definition: screen_menu_settings.c:133
LCD_RST_Pin
#define LCD_RST_Pin
Definition: main.h:155
TIM_OC_InitTypeDef::Pulse
uint32_t Pulse
Definition: stm32f4xx_hal_tim.h:97
SPI_InitTypeDef::DataSize
uint32_t DataSize
Definition: stm32f4xx_hal_spi.h:71
TIM3_default_Prescaler
#define TIM3_default_Prescaler
Definition: timer_defaults.h:12
RCC_ClkInitTypeDef::AHBCLKDivider
uint32_t AHBCLKDivider
Definition: stm32f4xx_hal_rcc.h:101
TIM_OC_InitTypeDef::OCNIdleState
uint32_t OCNIdleState
Definition: stm32f4xx_hal_tim.h:116
SPI_MODE_MASTER
#define SPI_MODE_MASTER
Definition: stm32f4xx_hal_spi.h:181
__SPI_HandleTypeDef::Init
SPI_InitTypeDef Init
Definition: stm32f4xx_hal_spi.h:124
MX_SPI3_Init
static void MX_SPI3_Init(void)
SPI3 Initialization Function.
Definition: main.c:475
UART_InitTypeDef::HwFlowCtl
uint32_t HwFlowCtl
Definition: stm32f4xx_hal_uart.h:87
TIM_OC_InitTypeDef::OCMode
uint32_t OCMode
Definition: stm32f4xx_hal_tim.h:94
pscreen_test_graph
screen_t * pscreen_test_graph
Definition: screen_test_graph.c:111
RCC_OSCILLATORTYPE_HSE
#define RCC_OSCILLATORTYPE_HSE
Definition: stm32f4xx_hal_rcc.h:125
UART_InitTypeDef::StopBits
uint32_t StopBits
Definition: stm32f4xx_hal_uart.h:74
marlin_command
uint32_t marlin_command(void)
Definition: marlin_client.c:159
RCC_SYSCLK_DIV1
#define RCC_SYSCLK_DIV1
Definition: stm32f4xx_hal_rcc.h:243
hdma_usart6_rx
DMA_HandleTypeDef hdma_usart6_rx
Definition: main.c:95
pscreen_home
screen_t * pscreen_home
Definition: screen_home.cpp:278
__HAL_RCC_GPIOC_CLK_ENABLE
#define __HAL_RCC_GPIOC_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:416
window_class_header
const window_class_header_t window_class_header
Definition: window_header.c:183
resource_font
font_t * resource_font(uint16_t id)
Definition: guitypes.c:186
ADC_InitTypeDef::NbrOfConversion
uint32_t NbrOfConversion
Definition: stm32f4xx_hal_adc.h:100
I2C_HandleTypeDef::Instance
I2C_TypeDef * Instance
Definition: stm32f4xx_hal_i2c.h:166
ADC_InitTypeDef::EOCSelection
uint32_t EOCSelection
Definition: stm32f4xx_hal_adc.h:90
WINDOW_CLS_FILE_LIST
int16_t WINDOW_CLS_FILE_LIST
Definition: window_file_list.c:24
ADC_InitTypeDef::DiscontinuousConvMode
uint32_t DiscontinuousConvMode
Definition: stm32f4xx_hal_adc.h:103
gui_get_menu_timeout_id
int8_t gui_get_menu_timeout_id(void)
Definition: gui_timer.c:147
htim3
TIM_HandleTypeDef htim3
Definition: main.c:87
Y_DIR_Pin
#define Y_DIR_Pin
Definition: main.h:143
ADC_InitTypeDef::ExternalTrigConvEdge
uint32_t ExternalTrigConvEdge
Definition: stm32f4xx_hal_adc.h:114
TIM_MASTERSLAVEMODE_DISABLE
#define TIM_MASTERSLAVEMODE_DISABLE
Definition: stm32f4xx_hal_tim.h:716
HAL_ADC_ConfigChannel
HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *sConfig)
MX_TIM2_Init
static void MX_TIM2_Init(void)
TIM2 Initialization Function.
Definition: main.c:580
TIM_OCPOLARITY_HIGH
#define TIM_OCPOLARITY_HIGH
Definition: stm32f4xx_hal_tim.h:386
putslave_init
void putslave_init(uartslave_t *pslave)
Definition: putslave.c:619
UART_InitTypeDef::Parity
uint32_t Parity
Definition: stm32f4xx_hal_uart.h:77
RCC_OscInitTypeDef::LSIState
uint32_t LSIState
Definition: stm32f4xx_hal_rcc.h:84
UART_InitTypeDef::WordLength
uint32_t WordLength
Definition: stm32f4xx_hal_uart.h:71
__HAL_RCC_DMA1_CLK_ENABLE
#define __HAL_RCC_DMA1_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:430
GPIO_InitTypeDef::Pin
uint32_t Pin
Definition: stm32f4xx_hal_gpio.h:65
TIM_MasterConfigTypeDef::MasterOutputTrigger
uint32_t MasterOutputTrigger
Definition: stm32f4xx_hal_tim_ex.h:84
RCC_ClkInitTypeDef::ClockType
uint32_t ClockType
Definition: stm32f4xx_hal_rcc.h:95
__HAL_RCC_PWR_CLK_ENABLE
#define __HAL_RCC_PWR_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:528
GPIO_InitTypeDef::Speed
uint32_t Speed
Definition: stm32f4xx_hal_gpio.h:74
I2C_NOSTRETCH_DISABLE
#define I2C_NOSTRETCH_DISABLE
Definition: stm32f4xx_hal_i2c.h:266
IWDG_HandleTypeDef::Init
IWDG_InitTypeDef Init
Definition: stm32f4xx_hal_iwdg.h:80
_screen_t::id
int16_t id
Definition: screen.h:19
RCC_FLAG_IWDGRST
#define RCC_FLAG_IWDGRST
Definition: stm32f4xx_hal_rcc.h:379
MX_FATFS_Init
void MX_FATFS_Init(void)
Definition: fatfs.c:60
ST7789V_SIG_SPI_TX
#define ST7789V_SIG_SPI_TX
Definition: guiconfig.h:18
window_class_dlg_statemachine
const window_class_dlg_statemachine_t window_class_dlg_statemachine
Definition: window_dlg_statemachine.c:246
ADC_InitTypeDef::ScanConvMode
uint32_t ScanConvMode
Definition: stm32f4xx_hal_adc.h:83
RCC_SYSCLKSOURCE_PLLCLK
#define RCC_SYSCLKSOURCE_PLLCLK
Definition: stm32f4xx_hal_rcc.h:221
measurementTaskHandle
osThreadId measurementTaskHandle
Definition: main.c:102
I2C_InitTypeDef::ClockSpeed
uint32_t ClockSpeed
Definition: stm32f4xx_hal_i2c.h:65
UART_STOPBITS_1
#define UART_STOPBITS_1
Definition: stm32f4xx_hal_uart.h:227
SPI_InitTypeDef::BaudRatePrescaler
uint32_t BaudRatePrescaler
Definition: stm32f4xx_hal_spi.h:84
StartMeasurementTask
void StartMeasurementTask(void const *argument)
Definition: thread_measurement.c:7
HAL_RCC_ClockConfig
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
WINDOW_EVENT_MESSAGE
#define WINDOW_EVENT_MESSAGE
Definition: window.h:51
HAL_TIM_ConfigClockSource
HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, TIM_ClockConfigTypeDef *sClockSourceConfig)
MX_USART6_UART_Init
static void MX_USART6_UART_Init(void)
USART6 Initialization Function.
Definition: main.c:773
I2C_InitTypeDef::DualAddressMode
uint32_t DualAddressMode
Definition: stm32f4xx_hal_i2c.h:77
HAL_I2C_Init
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
TIM_ClockConfigTypeDef
Clock Configuration Handle Structure definition.
Definition: stm32f4xx_hal_tim.h:214
pscreen_test
screen_t * pscreen_test
Definition: screen_test.c:157
SPI_InitTypeDef::CRCCalculation
uint32_t CRCCalculation
Definition: stm32f4xx_hal_spi.h:96
LCD_CS_Pin
#define LCD_CS_Pin
Definition: main.h:157
TIM_HandleTypeDef::Init
TIM_Base_InitTypeDef Init
Definition: stm32f4xx_hal_tim.h:290
TIM_BreakDeadTimeConfigTypeDef::BreakPolarity
uint32_t BreakPolarity
Definition: stm32f4xx_hal_tim_ex.h:106
SPI_InitTypeDef::Direction
uint32_t Direction
Definition: stm32f4xx_hal_spi.h:68
UART_WORDLENGTH_8B
#define UART_WORDLENGTH_8B
Definition: stm32f4xx_hal_uart.h:218
WINDOW_CLS_HEADER
int16_t WINDOW_CLS_HEADER
Definition: window_header.c:24
_gui_defaults_t::font_big
font_t * font_big
Definition: guitypes.h:111
RCC_ClkInitTypeDef::APB2CLKDivider
uint32_t APB2CLKDivider
Definition: stm32f4xx_hal_rcc.h:107
RCC_OscInitTypeDef
RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition.
Definition: stm32f4xx_hal_rcc.h:67
TIM_LOCKLEVEL_OFF
#define TIM_LOCKLEVEL_OFF
Definition: stm32f4xx_hal_tim.h:651
TIM_OSSI_DISABLE
#define TIM_OSSI_DISABLE
Definition: stm32f4xx_hal_tim.h:643
gui_defaults
gui_defaults_t gui_defaults
Definition: gui.c:20
X_STEP_Pin
#define X_STEP_Pin
Definition: main.h:179
GPIO_MODE_INPUT
#define GPIO_MODE_INPUT
Definition: stm32f4xx_hal_gpio.h:135
Z_DIAGE1_Pin
#define Z_DIAGE1_Pin
Definition: main.h:199
hspi2
SPI_HandleTypeDef hspi2
Definition: main.c:81
st7789v_reset_delay
uint16_t st7789v_reset_delay
Definition: st7789v.c:920
I2C_ADDRESSINGMODE_7BIT
#define I2C_ADDRESSINGMODE_7BIT
Definition: stm32f4xx_hal_i2c.h:239
hwio_beeper_tone2
void hwio_beeper_tone2(float frq, uint32_t del, float vol)
Definition: hwio_a3ides_2209_02.c:530
Z_MIN_GPIO_Port
#define Z_MIN_GPIO_Port
Definition: main.h:160
SPI_InitTypeDef::NSS
uint32_t NSS
Definition: stm32f4xx_hal_spi.h:80
pscreen_sysinfo
screen_t * pscreen_sysinfo
Definition: screen_sysinf.c:123
TIM_BreakDeadTimeConfigTypeDef::OffStateRunMode
uint32_t OffStateRunMode
Definition: stm32f4xx_hal_tim_ex.h:96
diag_check_fastboot
void diag_check_fastboot(void)
Definition: diag.c:23
UART_InitTypeDef::OverSampling
uint32_t OverSampling
Definition: stm32f4xx_hal_uart.h:91
PWR_REGULATOR_VOLTAGE_SCALE1
#define PWR_REGULATOR_VOLTAGE_SCALE1
Definition: stm32f4xx_hal_pwr_ex.h:90
htim1
TIM_HandleTypeDef htim1
Definition: main.c:85
Y_ENA_Pin
#define Y_ENA_Pin
Definition: main.h:147
uart6rxbuff
uartrxbuff_t uart6rxbuff
Definition: main.c:147
FLASH_CSN_Pin
#define FLASH_CSN_Pin
Definition: main.h:187
LCD_SW1_Pin
#define LCD_SW1_Pin
Definition: main.h:122
ESP_GPIO0_Pin
#define ESP_GPIO0_Pin
Definition: main.h:93
RCC_PLLInitTypeDef::PLLN
uint32_t PLLN
Definition: stm32f4xx_hal_rcc_ex.h:74
MX_IWDG_Init
static void MX_IWDG_Init(void)
IWDG Initialization Function.
Definition: main.c:413
TIM1_default_Prescaler
#define TIM1_default_Prescaler
Definition: timer_defaults.h:10
SPI_DATASIZE_8BIT
#define SPI_DATASIZE_8BIT
Definition: stm32f4xx_hal_spi.h:199
TIM_MasterConfigTypeDef::MasterSlaveMode
uint32_t MasterSlaveMode
Definition: stm32f4xx_hal_tim_ex.h:87
SPI_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f4xx_hal_spi.h:65
osPriorityNormal
priority: normal (default)
Definition: cmsis_os.h:221
screen_dispatch_event
void screen_dispatch_event(window_t *window, uint8_t event, void *param)
Definition: screen.c:103
WP1_Pin
#define WP1_Pin
Definition: main.h:197
gui_timer_expired
int8_t gui_timer_expired(int8_t id)
Definition: gui_timer.c:139
TIM_ClockConfigTypeDef::ClockSource
uint32_t ClockSource
Definition: stm32f4xx_hal_tim.h:216
I2C_InitTypeDef::NoStretchMode
uint32_t NoStretchMode
Definition: stm32f4xx_hal_i2c.h:86
menu_timeout_enabled
int8_t menu_timeout_enabled
Definition: guimain.c:103
pscreen_menu_tune
screen_t * pscreen_menu_tune
Definition: screen_menu_tune.cpp:203
pscreen_print_preview
screen_t *const pscreen_print_preview
Definition: screen_print_preview.c:77
Z_ENA_Pin
#define Z_ENA_Pin
Definition: main.h:181
BED_MON_Pin
#define BED_MON_Pin
Definition: main.h:113
__HAL_RCC_GET_FLAG
#define __HAL_RCC_GET_FLAG(__FLAG__)
Definition: stm32f4xx_hal_rcc.h:1246
pscreen_watchdog
screen_t * pscreen_watchdog
Definition: screen_watchdog.c:78
StartDisplayTask
void StartDisplayTask(void const *argument)
Function implementing the displayTask thread.
Definition: main.c:980
__HAL_RCC_GPIOA_CLK_ENABLE
#define __HAL_RCC_GPIOA_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:402
ADC_InitTypeDef::ExternalTrigConv
uint32_t ExternalTrigConv
Definition: stm32f4xx_hal_adc.h:110
gui_timer_delete
void gui_timer_delete(int8_t id)
Definition: gui_timer.c:79
osThreadCreate
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
WINDOW_CLS_TEMP_GRAPH
int16_t WINDOW_CLS_TEMP_GRAPH
Definition: window_temp_graph.c:8
UART_HandleTypeDef::Init
UART_InitTypeDef Init
Definition: stm32f4xx_hal_uart.h:162
Error_Handler
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1057
FIL_SENSOR_Pin
#define FIL_SENSOR_Pin
Definition: main.h:189
pscreen_menu_temperature
screen_t * pscreen_menu_temperature
Definition: screen_menu_temperature.c:76
pscreen_messages
screen_t * pscreen_messages
Definition: screen_messages.c:122
GPIO_InitTypeDef
GPIO Init structure definition.
Definition: stm32f4xx_hal_gpio.h:63
MX_TIM14_Init
static void MX_TIM14_Init(void)
TIM14 Initialization Function.
Definition: main.c:686
hadc1
ADC_HandleTypeDef hadc1
Definition: main.c:75
pscreen_version_info
screen_t * pscreen_version_info
Definition: screen_version_info.cpp:109
window_class_lcdsim
const window_class_lcdsim_t window_class_lcdsim
Definition: window_lcdsim.c:58
GPIO_SPEED_FREQ_LOW
#define GPIO_SPEED_FREQ_LOW
Definition: stm32f4xx_hal_gpio.h:158
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
displayTaskHandle
osThreadId displayTaskHandle
Definition: main.c:98
osThread
#define osThread(name)
Definition: cmsis_os.h:478
st7789v_config
st7789v_config_t st7789v_config
Definition: st7789v.c:905
I2C_DUTYCYCLE_2
#define I2C_DUTYCYCLE_2
Definition: stm32f4xx_hal_i2c.h:230
USB_EN_Pin
#define USB_EN_Pin
Definition: main.h:91
pscreen_test_disp_mem
screen_t * pscreen_test_disp_mem
Definition: screen_test_disp_mem.c:629