Prusa MINI Firmware overview
|
Go to the documentation of this file.
7 #define PUTSLAVE_CMD_ID_RST 0x01
8 #define PUTSLAVE_CMD_ID_VER 0x02
9 #define PUTSLAVE_CMD_ID_SER 0x03
10 #define PUTSLAVE_CMD_ID_BREV 0x04
11 #define PUTSLAVE_CMD_ID_BTIM 0x05
12 #define PUTSLAVE_CMD_ID_MAC 0x06
13 #define PUTSLAVE_CMD_ID_UID 0x07
14 #define PUTSLAVE_CMD_ID_IP4 0x08
15 #define PUTSLAVE_CMD_ID_LOCK 0x09
16 #define PUTSLAVE_CMD_ID_TST 0x10
17 #define PUTSLAVE_CMD_ID_TONE 0x11
18 #define PUTSLAVE_CMD_ID_START 0x12
19 #define PUTSLAVE_CMD_ID_STOP 0x13
20 #define PUTSLAVE_CMD_ID_TSTE 0x14
21 #define PUTSLAVE_CMD_ID_EECL 0x20
22 #define PUTSLAVE_CMD_ID_ADC 0xc0
23 #define PUTSLAVE_CMD_ID_GPIO 0xc1
24 #define PUTSLAVE_CMD_ID_GCODE 0xc2
25 #define PUTSLAVE_CMD_ID_PWM 0xc3
26 #define PUTSLAVE_CMD_ID_INVAL 0xc4
27 #define PUTSLAVE_CMD_ID_DIAG 0xc5
28 #define PUTSLAVE_CMD_ID_UART 0xc6
29 #define PUTSLAVE_CMD_ID_I2C 0xc7
30 #define PUTSLAVE_CMD_ID_TEN 0xc8
31 #define PUTSLAVE_CMD_ID_MOVE 0xc9
32 #define PUTSLAVE_CMD_ID_TDG 0xd0
33 #define PUTSLAVE_CMD_ID_GPUP 0xd1
35 #define FLASH_START_ADRESS 0x08020200
#define PUTSLAVE_CMD_ID_MOVE
Definition: putslave.h:31
int putslave_do_cmd_a_brev(uartslave_t *pslave, char *pstr)
Definition: putslave.c:276
int putslave_do_cmd_a_tst(uartslave_t *pslave, char *pstr)
Definition: putslave.c:447
int putslave_do_cmd_q_ver(uartslave_t *pslave)
Definition: putslave.c:98
#define UARTSLAVE_ERR_OOR
Definition: uartslave.h:18
#define OTP_MAC_ADDRESS_ADDR
Definition: otp.h:18
#define PUTSLAVE_CMD_ID_GCODE
Definition: putslave.h:24
int putslave_do_cmd_a_gcode(uartslave_t *pslave, char *pstr)
Definition: putslave.c:411
int putslave_do_cmd_a_rst(uartslave_t *pslave)
Definition: putslave.c:232
int putslave_do_cmd_q_uart(uartslave_t *pslave)
Definition: putslave.c:212
int8_t eeprom_test_PUT(const unsigned int bytes)
Definition: eeprom.c:208
void hwio_beeper_set_pwm(uint32_t per, uint32_t pul)
Definition: hwio_a3ides_2209_02.c:491
#define GPIO_MODE_OUTPUT_PP
Definition: stm32f4xx_hal_gpio.h:136
int putslave_do_cmd_q_mac(uartslave_t *pslave)
Definition: putslave.c:121
#define PUTSLAVE_CMD_ID_STOP
Definition: putslave.h:19
variant8_t variant8_ui8(uint8_t ui8)
Definition: variant8.c:18
int uartslave_printf(uartslave_t *pslave, const char *fmt,...)
Definition: uartslave.c:129
#define UARTSLAVE_ERR_SYN
Definition: uartslave.h:17
#define GPIO_SPEED_FREQ_HIGH
Definition: stm32f4xx_hal_gpio.h:160
static uint8_t uart1rx_data[200]
Definition: main.c:145
TaskHandle_t osThreadId
Definition: cmsis_os.h:283
#define PUTSLAVE_CMD_ID_TSTE
Definition: putslave.h:20
#define PUTSLAVE_CMD_ID_MAC
Definition: putslave.h:12
void sys_reset(void)
Definition: sys.cpp:20
void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi)
SPI MSP Initialization This function configures the hardware resources used in this example.
Definition: stm32f4xx_hal_msp.c:252
int putslave_do_cmd_a_inval(uartslave_t *pslave)
Definition: putslave.c:463
#define PUTSLAVE_CMD_ID_ADC
Definition: putslave.h:22
SPI handle Structure definition.
Definition: stm32f4xx_hal_spi.h:120
#define PC3
Definition: variant.h:94
list gcode
Definition: g29_auto.py:44
#define PUTSLAVE_CMD_ID_INVAL
Definition: putslave.h:26
#define PUTSLAVE_CMD_ID_RST
Definition: putslave.h:7
#define PD3
Definition: variant.h:58
Definition: uartslave.h:32
void hwio_beeper_set_vol(float vol)
Definition: hwio_a3ides_2209_02.c:483
void tmc_set_move(uint8_t tmc, uint32_t step, uint8_t dir, uint8_t speed)
Stepper stepper
Definition: stepper.cpp:82
int marlin_server_enqueue_gcode(const char *gcode)
Definition: marlin_server.cpp:318
uint8_t flags
Definition: uartslave.h:34
void hwio_pwm_set_val(int i_pwm, int val)
Definition: hwio_a3ides_2209_02.c:376
#define PD10
Definition: variant.h:80
osStatus osThreadResume(osThreadId thread_id)
Resume execution of a suspended thread.
Definition: cmsis_os.c:1494
void marlin_server_stop_processing(void)
Definition: marlin_server.cpp:293
int sys_fw_validate(void)
Definition: sys.cpp:281
int _validate_serial(const char *str)
Definition: putslave.c:237
#define EEVAR_RUN_FIRSTLAY
Definition: eeprom.h:16
#define PUTSLAVE_CMD_ID_TST
Definition: putslave.h:16
int hwio_adc_get_val(int i_adc)
Definition: hwio_a3ides_2209_02.c:245
static volatile fsensor_t state
Definition: filament_sensor.c:23
int putslave_do_cmd_q_pwm(uartslave_t *pslave, char *pstr)
Definition: putslave.c:170
const char version_firmware_name[]
Definition: version.c:24
int putslave_do_cmd_q_btim(uartslave_t *pslave)
Definition: putslave.c:115
void eeprom_set_var(uint8_t id, variant8_t var)
Definition: eeprom.c:88
#define PUTSLAVE_CMD_ID_GPIO
Definition: putslave.h:23
void eeprom_clear(void)
Definition: eeprom.c:201
int putslave_do_cmd_a_mac(uartslave_t *pslave, char *pstr)
Definition: putslave.c:304
#define OTP_SERIAL_NUMBER_ADDR
Definition: otp.h:14
int diag_fastboot
Definition: diag.c:11
int putslave_do_cmd_a_start(uartslave_t *pslave)
Definition: putslave.c:345
#define PUTSLAVE_CMD_ID_SER
Definition: putslave.h:9
int putslave_do_cmd_a_pwm(uartslave_t *pslave, char *pstr)
Definition: putslave.c:420
#define OTP_MAC_ADDRESS_SIZE
Definition: otp.h:19
int putslave_do_cmd_a_ten(uartslave_t *pslave, char *pstr)
Definition: putslave.c:493
int putslave_do_cmd_a_eecl(uartslave_t *pslave)
Definition: putslave.c:383
int putslave_do_cmd_q_brev(uartslave_t *pslave)
Definition: putslave.c:109
void app_setup(void)
Definition: appmain.cpp:51
UART_HandleTypeDef * phuart
Definition: uartrxbuff.h:17
int putslave_do_cmd_a_gpio(uartslave_t *pslave, char *pstr)
Definition: putslave.c:388
#define UARTSLAVE_CMD_ID_UNK
Definition: uartslave.h:12
void diag_test(void)
Definition: diag.c:49
#define GPIO_PULLUP
Definition: stm32f4xx_hal_gpio.h:171
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
SPI MSP De-Initialization This function freeze the hardware resources used in this example.
Definition: stm32f4xx_hal_msp.c:337
osThreadId idleTaskHandle
Definition: main.c:99
static int gpio_get(uint8_t pin8)
Definition: gpio.h:94
#define UARTSLAVE_FLG_ECHO
Definition: uartslave.h:7
int putslave_do_cmd_q_ip4(uartslave_t *pslave)
Definition: putslave.c:134
#define _PWM_HEATER_0
Definition: hwio_a3ides.h:41
int sys_flash_write(void *dst, void *src, int size)
Definition: sys.cpp:293
#define UARTSLAVE_ERR_ONP
Definition: uartslave.h:19
int putslave_do_cmd_q_ser(uartslave_t *pslave)
Definition: putslave.c:103
#define PUTSLAVE_CMD_ID_TDG
Definition: putslave.h:32
int putslave_do_cmd_q_lock(uartslave_t *pslave)
Definition: putslave.c:144
#define EEVAR_RUN_XYZCALIB
Definition: eeprom.h:15
void hwio_beeper_tone(float frq, uint32_t del)
Definition: hwio_a3ides_2209_02.c:514
#define UARTSLAVE_ERR_CNF
Definition: uartslave.h:21
#define EEVAR_RUN_SELFTEST
Definition: eeprom.h:14
static void gpio_init(uint8_t pin8, uint32_t mode, uint32_t pull, uint32_t speed)
Definition: gpio.h:102
int putslave_do_cmd_a_i2c(uartslave_t *pslave)
Definition: putslave.c:484
#define PUTSLAVE_CMD_ID_TEN
Definition: putslave.h:30
int sys_fw_is_valid(void)
Definition: sys.cpp:266
#define PUTSLAVE_CMD_ID_START
Definition: putslave.h:18
int putslave_do_cmd_a_stop(uartslave_t *pslave)
Definition: putslave.c:362
#define OTP_BOARD_TIME_STAMP_SIZE
Definition: otp.h:11
int hwio_pwm_get_max(int i_pwm)
Definition: hwio_a3ides_2209_02.c:276
int putslave_do_cmd_q_gpup(uartslave_t *pslave, char *pstr)
Definition: putslave.c:201
int putslave_do_cmd_q_uid(uartslave_t *pslave)
Definition: putslave.c:128
#define PUTSLAVE_CMD_ID_EECL
Definition: putslave.h:21
int putslave_do_cmd_a_btim(uartslave_t *pslave, char *pstr)
Definition: putslave.c:290
#define GPIO_NOPULL
Definition: stm32f4xx_hal_gpio.h:170
osStatus osThreadSuspend(osThreadId thread_id)
Suspend execution of a thread.
Definition: cmsis_os.c:1478
struct netif * netif_default
Definition: netif.c:105
#define GPIO_SPEED_FREQ_VERY_HIGH
Definition: stm32f4xx_hal_gpio.h:161
#define _PWM_HEATER_BED
Definition: hwio_a3ides.h:40
#define PUTSLAVE_CMD_ID_BTIM
Definition: putslave.h:11
uartrxbuff_t uart1rxbuff
Definition: main.c:144
int putslave_do_cmd_q_adc(uartslave_t *pslave, char *pstr)
Definition: putslave.c:150
#define OTP_LOCK_BLOCK_ADDR
Definition: otp.h:22
int sys_flash_is_empty(void *ptr, int size)
Definition: sys.cpp:285
const uint8_t[]
Definition: 404_html.c:3
int sys_fw_invalidate(void)
Definition: sys.cpp:271
int putslave_do_cmd_q_diag(uartslave_t *pslave, char *pstr)
Definition: putslave.c:194
SPI_HandleTypeDef hspi2
Definition: main.c:81
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
int putslave_do_cmd_a_ser(uartslave_t *pslave, char *pstr)
Definition: putslave.c:258
#define PUTSLAVE_CMD_ID_UART
Definition: putslave.h:28
int putslave_do_cmd_a_lock(uartslave_t *pslave)
Definition: putslave.c:437
int putslave_do_cmd_q_gpio(uartslave_t *pslave, char *pstr)
Definition: putslave.c:160
I2C_HandleTypeDef hi2c1
Definition: main.c:77
#define PUTSLAVE_CMD_ID_PWM
Definition: putslave.h:25
void putslave_init(uartslave_t *pslave)
Definition: putslave.c:619
#define OTP_BOARD_REVISION_SIZE
Definition: otp.h:7
#define OTP_STM32_UUID_ADDR
Definition: otp.h:26
: Header for main.c file. This file contains the common defines of the application.
#define PUTSLAVE_CMD_ID_BREV
Definition: putslave.h:10
#define OTP_BOARD_TIME_STAMP_ADDR
Definition: otp.h:10
#define PA0
Definition: variant.h:95
uartslave_do_cmd_t * do_cmd
Definition: uartslave.h:40
#define PB10
Definition: variant.h:116
#define UARTSLAVE_ERR_UNK
Definition: uartslave.h:15
int putslave_do_cmd(uartslave_t *pslave, uint16_t mod_msk, char cmd, uint16_t cmd_id, char *pstr)
Definition: putslave.c:538
void putslave_init(uartslave_t *pslave)
Definition: putslave.c:619
#define UARTSLAVE_OK
Definition: uartslave.h:14
static void gpio_set(uint8_t pin8, int state)
Definition: gpio.h:98
int put_setup_done
Definition: putslave.c:343
#define PUTSLAVE_CMD_ID_GPUP
Definition: putslave.h:33
int putslave_do_cmd_q_tste(uartslave_t *pslave, char *pstr)
Definition: putslave.c:179
#define PD14
Definition: variant.h:76
void marlin_server_start_processing(void)
Definition: marlin_server.cpp:288
const char version_version[]
semantic version (https://semver.org) is Prusa3D standard
Definition: version.c:31
int putslave_do_cmd_a_move(uartslave_t *pslave, char *pstr)
Definition: putslave.c:507
int diag_error
Definition: diag.c:13
#define PC2
Definition: variant.h:93
#define OTP_BOARD_REVISION_ADDR
Definition: otp.h:6
#define HAL_MAX_DELAY
Definition: stm32f4xx_hal_def.h:76
#define PUTSLAVE_CMD_ID_UID
Definition: putslave.h:13
#define GPIO_MODE_INPUT
Definition: stm32f4xx_hal_gpio.h:135
#define PD2
Definition: variant.h:59
#define UARTSLAVE_CMD_ID_0
Definition: uartslave.h:11
#define OTP_SERIAL_NUMBER_SIZE
Definition: otp.h:15
osThreadId webServerTaskHandle
Definition: main.c:100
#define PUTSLAVE_CMD_ID_I2C
Definition: putslave.h:29
#define PUTSLAVE_CMD_ID_LOCK
Definition: putslave.h:15
int putslave_do_cmd_q_tdg(uartslave_t *pslave)
Definition: putslave.c:222
void tmc_set_sgthrs(uint8_t SGT)
osThreadId displayTaskHandle
Definition: main.c:98
osThreadId defaultTaskHandle
Definition: main.c:97
uartslave_parse_cmd_id_t * parse_cmd_id
Definition: uartslave.h:39
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...
#define PUTSLAVE_CMD_ID_VER
Definition: putslave.h:8
int putslave_do_cmd_a_tone(uartslave_t *pslave, char *pstr)
Definition: putslave.c:323
#define PUTSLAVE_CMD_ID_TONE
Definition: putslave.h:17
#define PUTSLAVE_CMD_ID_IP4
Definition: putslave.h:14
int putslave_parse_cmd_id(uartslave_t *pslave, char *pstr, uint16_t *pcmd_id)
Definition: putslave.c:24
#define PUTSLAVE_CMD_ID_DIAG
Definition: putslave.h:27
I2C handle Structure definition.
Definition: stm32f4xx_hal_i2c.h:164
#define PE15
Definition: variant.h:115
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
int marlin_server_processing(void)
Definition: marlin_server.cpp:284