Prusa MINI Firmware overview
putslave.h File Reference
#include "uartslave.h"

Go to the source code of this file.

Macros

#define PUTSLAVE_CMD_ID_RST   0x01
 
#define PUTSLAVE_CMD_ID_VER   0x02
 
#define PUTSLAVE_CMD_ID_SER   0x03
 
#define PUTSLAVE_CMD_ID_BREV   0x04
 
#define PUTSLAVE_CMD_ID_BTIM   0x05
 
#define PUTSLAVE_CMD_ID_MAC   0x06
 
#define PUTSLAVE_CMD_ID_UID   0x07
 
#define PUTSLAVE_CMD_ID_IP4   0x08
 
#define PUTSLAVE_CMD_ID_LOCK   0x09
 
#define PUTSLAVE_CMD_ID_TST   0x10
 
#define PUTSLAVE_CMD_ID_TONE   0x11
 
#define PUTSLAVE_CMD_ID_START   0x12
 
#define PUTSLAVE_CMD_ID_STOP   0x13
 
#define PUTSLAVE_CMD_ID_TSTE   0x14
 
#define PUTSLAVE_CMD_ID_EECL   0x20
 
#define PUTSLAVE_CMD_ID_ADC   0xc0
 
#define PUTSLAVE_CMD_ID_GPIO   0xc1
 
#define PUTSLAVE_CMD_ID_GCODE   0xc2
 
#define PUTSLAVE_CMD_ID_PWM   0xc3
 
#define PUTSLAVE_CMD_ID_INVAL   0xc4
 
#define PUTSLAVE_CMD_ID_DIAG   0xc5
 
#define PUTSLAVE_CMD_ID_UART   0xc6
 
#define PUTSLAVE_CMD_ID_I2C   0xc7
 
#define PUTSLAVE_CMD_ID_TEN   0xc8
 
#define PUTSLAVE_CMD_ID_MOVE   0xc9
 
#define PUTSLAVE_CMD_ID_TDG   0xd0
 
#define PUTSLAVE_CMD_ID_GPUP   0xd1
 
#define FLASH_START_ADRESS   0x08020200
 

Functions

void putslave_init (uartslave_t *pslave)
 

Macro Definition Documentation

◆ PUTSLAVE_CMD_ID_RST

#define PUTSLAVE_CMD_ID_RST   0x01

◆ PUTSLAVE_CMD_ID_VER

#define PUTSLAVE_CMD_ID_VER   0x02

◆ PUTSLAVE_CMD_ID_SER

#define PUTSLAVE_CMD_ID_SER   0x03

◆ PUTSLAVE_CMD_ID_BREV

#define PUTSLAVE_CMD_ID_BREV   0x04

◆ PUTSLAVE_CMD_ID_BTIM

#define PUTSLAVE_CMD_ID_BTIM   0x05

◆ PUTSLAVE_CMD_ID_MAC

#define PUTSLAVE_CMD_ID_MAC   0x06

◆ PUTSLAVE_CMD_ID_UID

#define PUTSLAVE_CMD_ID_UID   0x07

◆ PUTSLAVE_CMD_ID_IP4

#define PUTSLAVE_CMD_ID_IP4   0x08

◆ PUTSLAVE_CMD_ID_LOCK

#define PUTSLAVE_CMD_ID_LOCK   0x09

◆ PUTSLAVE_CMD_ID_TST

#define PUTSLAVE_CMD_ID_TST   0x10

◆ PUTSLAVE_CMD_ID_TONE

#define PUTSLAVE_CMD_ID_TONE   0x11

◆ PUTSLAVE_CMD_ID_START

#define PUTSLAVE_CMD_ID_START   0x12

◆ PUTSLAVE_CMD_ID_STOP

#define PUTSLAVE_CMD_ID_STOP   0x13

◆ PUTSLAVE_CMD_ID_TSTE

#define PUTSLAVE_CMD_ID_TSTE   0x14

◆ PUTSLAVE_CMD_ID_EECL

#define PUTSLAVE_CMD_ID_EECL   0x20

◆ PUTSLAVE_CMD_ID_ADC

#define PUTSLAVE_CMD_ID_ADC   0xc0

◆ PUTSLAVE_CMD_ID_GPIO

#define PUTSLAVE_CMD_ID_GPIO   0xc1

◆ PUTSLAVE_CMD_ID_GCODE

#define PUTSLAVE_CMD_ID_GCODE   0xc2

◆ PUTSLAVE_CMD_ID_PWM

#define PUTSLAVE_CMD_ID_PWM   0xc3

◆ PUTSLAVE_CMD_ID_INVAL

#define PUTSLAVE_CMD_ID_INVAL   0xc4

◆ PUTSLAVE_CMD_ID_DIAG

#define PUTSLAVE_CMD_ID_DIAG   0xc5

◆ PUTSLAVE_CMD_ID_UART

#define PUTSLAVE_CMD_ID_UART   0xc6

◆ PUTSLAVE_CMD_ID_I2C

#define PUTSLAVE_CMD_ID_I2C   0xc7

◆ PUTSLAVE_CMD_ID_TEN

#define PUTSLAVE_CMD_ID_TEN   0xc8

◆ PUTSLAVE_CMD_ID_MOVE

#define PUTSLAVE_CMD_ID_MOVE   0xc9

◆ PUTSLAVE_CMD_ID_TDG

#define PUTSLAVE_CMD_ID_TDG   0xd0

◆ PUTSLAVE_CMD_ID_GPUP

#define PUTSLAVE_CMD_ID_GPUP   0xd1

◆ FLASH_START_ADRESS

#define FLASH_START_ADRESS   0x08020200

Function Documentation

◆ putslave_init()

void putslave_init ( uartslave_t pslave)
619  {
621  pslave->do_cmd = putslave_do_cmd;
622  pslave->flags = UARTSLAVE_FLG_ECHO;
623  if (diag_fastboot) {
624  uartslave_printf(pslave, "fastboot\n");
627  NVIC_DisableIRQ(TIM7_IRQn);
630  //SCK - PB10
632  //MISO - PC2
634  //MOSI - PC3
636  }
637 }
Here is the call graph for this function:
Here is the caller graph for this function:
GPIO_MODE_OUTPUT_PP
#define GPIO_MODE_OUTPUT_PP
Definition: stm32f4xx_hal_gpio.h:136
uartslave_printf
int uartslave_printf(uartslave_t *pslave, const char *fmt,...)
Definition: uartslave.c:129
GPIO_SPEED_FREQ_HIGH
#define GPIO_SPEED_FREQ_HIGH
Definition: stm32f4xx_hal_gpio.h:160
PC3
#define PC3
Definition: variant.h:94
_uartslave_t::flags
uint8_t flags
Definition: uartslave.h:34
hwio_pwm_set_val
void hwio_pwm_set_val(int i_pwm, int val)
Definition: hwio_a3ides_2209_02.c:376
marlin_server_stop_processing
void marlin_server_stop_processing(void)
Definition: marlin_server.cpp:293
diag_fastboot
int diag_fastboot
Definition: diag.c:11
GPIO_PULLUP
#define GPIO_PULLUP
Definition: stm32f4xx_hal_gpio.h:171
HAL_SPI_MspDeInit
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
UARTSLAVE_FLG_ECHO
#define UARTSLAVE_FLG_ECHO
Definition: uartslave.h:7
_PWM_HEATER_0
#define _PWM_HEATER_0
Definition: hwio_a3ides.h:41
gpio_init
static void gpio_init(uint8_t pin8, uint32_t mode, uint32_t pull, uint32_t speed)
Definition: gpio.h:102
GPIO_NOPULL
#define GPIO_NOPULL
Definition: stm32f4xx_hal_gpio.h:170
GPIO_SPEED_FREQ_VERY_HIGH
#define GPIO_SPEED_FREQ_VERY_HIGH
Definition: stm32f4xx_hal_gpio.h:161
_PWM_HEATER_BED
#define _PWM_HEATER_BED
Definition: hwio_a3ides.h:40
hspi2
SPI_HandleTypeDef hspi2
Definition: main.c:81
_uartslave_t::do_cmd
uartslave_do_cmd_t * do_cmd
Definition: uartslave.h:40
PB10
#define PB10
Definition: variant.h:116
putslave_do_cmd
int putslave_do_cmd(uartslave_t *pslave, uint16_t mod_msk, char cmd, uint16_t cmd_id, char *pstr)
Definition: putslave.c:538
PC2
#define PC2
Definition: variant.h:93
GPIO_MODE_INPUT
#define GPIO_MODE_INPUT
Definition: stm32f4xx_hal_gpio.h:135
_uartslave_t::parse_cmd_id
uartslave_parse_cmd_id_t * parse_cmd_id
Definition: uartslave.h:39
putslave_parse_cmd_id
int putslave_parse_cmd_id(uartslave_t *pslave, char *pstr, uint16_t *pcmd_id)
Definition: putslave.c:24