Prusa MINI Firmware overview
diag.h File Reference

Go to the source code of this file.

Macros

#define DIAG_OK   0
 
#define DIAG_ERR_CHECKSUM   1
 
#define DIAG_ERR_I2CEEPROM   2
 
#define DIAG_ERR_SPIFLASH   3
 
#define DIAG_ERR_USBA   4
 
#define DIAG_ERR_TMC_X   5
 
#define DIAG_ERR_TMC_Y   6
 
#define DIAG_ERR_TMC_Z   7
 
#define DIAG_ERR_TMC_E   8
 
#define DIAG_ERR_NOLOCK   10
 
#define DIAG_ERR_MACADDR   11
 
#define DIAG_ERR_BOARDREV   12
 
#define DIAG_ERR_TIMESTAMP   13
 
#define DIAG_ERR_SERIAL   14
 

Functions

void diag_check_fastboot (void)
 
void diag_test (void)
 

Variables

int diag_fastboot
 
int diag_error
 

Macro Definition Documentation

◆ DIAG_OK

#define DIAG_OK   0

◆ DIAG_ERR_CHECKSUM

#define DIAG_ERR_CHECKSUM   1

◆ DIAG_ERR_I2CEEPROM

#define DIAG_ERR_I2CEEPROM   2

◆ DIAG_ERR_SPIFLASH

#define DIAG_ERR_SPIFLASH   3

◆ DIAG_ERR_USBA

#define DIAG_ERR_USBA   4

◆ DIAG_ERR_TMC_X

#define DIAG_ERR_TMC_X   5

◆ DIAG_ERR_TMC_Y

#define DIAG_ERR_TMC_Y   6

◆ DIAG_ERR_TMC_Z

#define DIAG_ERR_TMC_Z   7

◆ DIAG_ERR_TMC_E

#define DIAG_ERR_TMC_E   8

◆ DIAG_ERR_NOLOCK

#define DIAG_ERR_NOLOCK   10

◆ DIAG_ERR_MACADDR

#define DIAG_ERR_MACADDR   11

◆ DIAG_ERR_BOARDREV

#define DIAG_ERR_BOARDREV   12

◆ DIAG_ERR_TIMESTAMP

#define DIAG_ERR_TIMESTAMP   13

◆ DIAG_ERR_SERIAL

#define DIAG_ERR_SERIAL   14

Function Documentation

◆ diag_check_fastboot()

void diag_check_fastboot ( void  )
23  {
24  if (otp_lock_sector0) //not locked
25  {
28  diag_delay(100000);
29  int i;
30  for (i = 0; i < 10; i++) {
31  if (gpio_get(PC7))
32  break;
33  diag_delay(10000);
34  }
35  diag_fastboot = ((i == 10) && !gpio_get(PC7)) ? 1 : 0;
36  }
37 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diag_test()

void diag_test ( void  )
49  {
50  diag_error = 0;
51  //SPI DIAG
52  if (diag_error == 0)
53  if (!w25x_init())
55 
56  //I2C EEPROM
57  if (diag_error == 0)
58  if (!diag_eeprom())
60 
61  //USBA
62  if (diag_error == 0)
65 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ diag_fastboot

int diag_fastboot

◆ diag_error

int diag_error
i
uint8_t i
Definition: screen_test_graph.c:72
DIAG_ERR_SPIFLASH
#define DIAG_ERR_SPIFLASH
Definition: diag.h:9
diag_fastboot
int diag_fastboot
Definition: diag.c:11
diag_delay
void diag_delay(int delay)
Definition: diag.c:17
PC7
#define PC7
Definition: variant.h:73
GPIO_PULLUP
#define GPIO_PULLUP
Definition: stm32f4xx_hal_gpio.h:171
gpio_get
static int gpio_get(uint8_t pin8)
Definition: gpio.h:94
APPLICATION_READY
Definition: usb_host.h:88
gpio_init
static void gpio_init(uint8_t pin8, uint32_t mode, uint32_t pull, uint32_t speed)
Definition: gpio.h:102
otp_lock_sector0
#define otp_lock_sector0
Definition: otp.h:29
GPIO_SPEED_FREQ_VERY_HIGH
#define GPIO_SPEED_FREQ_VERY_HIGH
Definition: stm32f4xx_hal_gpio.h:161
__HAL_RCC_GPIOC_CLK_ENABLE
#define __HAL_RCC_GPIOC_CLK_ENABLE()
Definition: stm32f4xx_hal_rcc.h:416
Appli_state
ApplicationTypeDef Appli_state
Definition: usb_host.c:75
DIAG_ERR_USBA
#define DIAG_ERR_USBA
Definition: diag.h:10
DIAG_ERR_I2CEEPROM
#define DIAG_ERR_I2CEEPROM
Definition: diag.h:8
diag_eeprom
int diag_eeprom()
Definition: diag.c:39
diag_error
int diag_error
Definition: diag.c:13
GPIO_MODE_INPUT
#define GPIO_MODE_INPUT
Definition: stm32f4xx_hal_gpio.h:135
w25x_init
int8_t w25x_init(void)
Definition: w25x.c:57