Prusa MINI Firmware overview
putslave.c File Reference
#include "putslave.h"
#include <string.h>
#include "dbg.h"
#include "version.h"
#include "gpio.h"
#include "hwio_a3ides.h"
#include "sys.h"
#include "diag.h"
#include "app.h"
#include "marlin_server.h"
#include "sim_motion.h"
#include "otp.h"
#include "lwip.h"
#include "eeprom.h"
#include "cmsis_os.h"
#include "uartslave.h"
#include "hwio_pindef.h"
#include "trinamic.h"
#include "main.h"

Functions

int putslave_parse_cmd_id (uartslave_t *pslave, char *pstr, uint16_t *pcmd_id)
 
int putslave_do_cmd_q_ver (uartslave_t *pslave)
 
int putslave_do_cmd_q_ser (uartslave_t *pslave)
 
int putslave_do_cmd_q_brev (uartslave_t *pslave)
 
int putslave_do_cmd_q_btim (uartslave_t *pslave)
 
int putslave_do_cmd_q_mac (uartslave_t *pslave)
 
int putslave_do_cmd_q_uid (uartslave_t *pslave)
 
int putslave_do_cmd_q_ip4 (uartslave_t *pslave)
 
int putslave_do_cmd_q_lock (uartslave_t *pslave)
 
int putslave_do_cmd_q_adc (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_q_gpio (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_q_pwm (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_q_tste (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_q_diag (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_q_gpup (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_q_uart (uartslave_t *pslave)
 
int putslave_do_cmd_q_tdg (uartslave_t *pslave)
 
int putslave_do_cmd_a_rst (uartslave_t *pslave)
 
int _validate_serial (const char *str)
 
int putslave_do_cmd_a_ser (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_brev (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_btim (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_mac (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_tone (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_start (uartslave_t *pslave)
 
int putslave_do_cmd_a_stop (uartslave_t *pslave)
 
int putslave_do_cmd_a_eecl (uartslave_t *pslave)
 
int putslave_do_cmd_a_gpio (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_gcode (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_pwm (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_lock (uartslave_t *pslave)
 
int putslave_do_cmd_a_tst (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_inval (uartslave_t *pslave)
 
int putslave_do_cmd_a_i2c (uartslave_t *pslave)
 
int putslave_do_cmd_a_ten (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd_a_move (uartslave_t *pslave, char *pstr)
 
int putslave_do_cmd (uartslave_t *pslave, uint16_t mod_msk, char cmd, uint16_t cmd_id, char *pstr)
 
void putslave_init (uartslave_t *pslave)
 

Variables

osThreadId defaultTaskHandle
 
osThreadId displayTaskHandle
 
osThreadId idleTaskHandle
 
osThreadId webServerTaskHandle
 
SPI_HandleTypeDef hspi2
 
int put_setup_done = 0
 
I2C_HandleTypeDef hi2c1
 

Function Documentation

◆ putslave_parse_cmd_id()

int putslave_parse_cmd_id ( uartslave_t pslave,
char *  pstr,
uint16_t *  pcmd_id 
)
24  {
25  int ret;
26  uint16_t cmd_id = UARTSLAVE_CMD_ID_UNK;
27  if (pstr[0] == 0) {
28  *pcmd_id = UARTSLAVE_CMD_ID_0;
29  return 0;
30  } else if ((pstr[3] == 0) || (pstr[3] == ' ')) {
31  ret = 3;
32  if (strncmp(pstr, "rst", 3) == 0)
33  cmd_id = PUTSLAVE_CMD_ID_RST;
34  else if (strncmp(pstr, "ver", 3) == 0)
35  cmd_id = PUTSLAVE_CMD_ID_VER;
36  else if (strncmp(pstr, "ser", 3) == 0)
37  cmd_id = PUTSLAVE_CMD_ID_SER;
38  else if (strncmp(pstr, "mac", 3) == 0)
39  cmd_id = PUTSLAVE_CMD_ID_MAC;
40  else if (strncmp(pstr, "uid", 3) == 0)
41  cmd_id = PUTSLAVE_CMD_ID_UID;
42  else if (strncmp(pstr, "ip4", 3) == 0)
43  cmd_id = PUTSLAVE_CMD_ID_IP4;
44  else if (strncmp(pstr, "tst", 3) == 0)
45  cmd_id = PUTSLAVE_CMD_ID_TST;
46  else if (strncmp(pstr, "adc", 3) == 0)
47  cmd_id = PUTSLAVE_CMD_ID_ADC;
48  else if (strncmp(pstr, "pwm", 3) == 0)
49  cmd_id = PUTSLAVE_CMD_ID_PWM;
50  else if (strncmp(pstr, "i2c", 3) == 0)
51  cmd_id = PUTSLAVE_CMD_ID_I2C;
52  else if (strncmp(pstr, "ten", 3) == 0)
53  cmd_id = PUTSLAVE_CMD_ID_TEN;
54  else if (strncmp(pstr, "tdg", 3) == 0)
55  cmd_id = PUTSLAVE_CMD_ID_TDG;
56  } else if ((pstr[4] == 0) || (pstr[4] == ' ')) {
57  ret = 4;
58  if (strncmp(pstr, "brev", 4) == 0)
59  cmd_id = PUTSLAVE_CMD_ID_BREV;
60  else if (strncmp(pstr, "btim", 4) == 0)
61  cmd_id = PUTSLAVE_CMD_ID_BTIM;
62  else if (strncmp(pstr, "lock", 4) == 0)
63  cmd_id = PUTSLAVE_CMD_ID_LOCK;
64  else if (strncmp(pstr, "tone", 4) == 0)
65  cmd_id = PUTSLAVE_CMD_ID_TONE;
66  else if (strncmp(pstr, "gpio", 4) == 0)
67  cmd_id = PUTSLAVE_CMD_ID_GPIO;
68  else if (strncmp(pstr, "stop", 4) == 0)
69  cmd_id = PUTSLAVE_CMD_ID_STOP;
70  else if (strncmp(pstr, "tste", 4) == 0)
71  cmd_id = PUTSLAVE_CMD_ID_TSTE;
72  else if (strncmp(pstr, "eecl", 4) == 0)
73  cmd_id = PUTSLAVE_CMD_ID_EECL;
74  else if (strncmp(pstr, "diag", 4) == 0)
75  cmd_id = PUTSLAVE_CMD_ID_DIAG;
76  else if (strncmp(pstr, "uart", 4) == 0)
77  cmd_id = PUTSLAVE_CMD_ID_UART;
78  else if (strncmp(pstr, "move", 4) == 0)
79  cmd_id = PUTSLAVE_CMD_ID_MOVE;
80  else if (strncmp(pstr, "gpup", 4) == 0)
81  cmd_id = PUTSLAVE_CMD_ID_GPUP;
82  } else if ((pstr[5] == 0) || (pstr[5] == ' ')) {
83  ret = 5;
84  if (strncmp(pstr, "gcode", 5) == 0)
85  cmd_id = PUTSLAVE_CMD_ID_GCODE;
86  else if (strncmp(pstr, "start", 5) == 0)
87  cmd_id = PUTSLAVE_CMD_ID_START;
88  else if (strncmp(pstr, "inval", 5) == 0)
89  cmd_id = PUTSLAVE_CMD_ID_INVAL;
90  }
91  if (cmd_id != UARTSLAVE_CMD_ID_UNK) {
92  *pcmd_id = cmd_id;
93  return ret;
94  }
95  return UARTSLAVE_ERR_SYN;
96 }
Here is the caller graph for this function:

◆ putslave_do_cmd_q_ver()

int putslave_do_cmd_q_ver ( uartslave_t pslave)
98  {
100  return UARTSLAVE_OK;
101 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_ser()

int putslave_do_cmd_q_ser ( uartslave_t pslave)
103  {
104  char *ptr = (char *)OTP_SERIAL_NUMBER_ADDR;
105  uartslave_printf(pslave, "CZPX%.15s ", ptr);
106  return UARTSLAVE_OK;
107 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_brev()

int putslave_do_cmd_q_brev ( uartslave_t pslave)
109  {
111  uartslave_printf(pslave, "%d.%d.%d ", ptr[0], ptr[1], ptr[2]);
112  return UARTSLAVE_OK;
113 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_btim()

int putslave_do_cmd_q_btim ( uartslave_t pslave)
115  {
116  uint32_t *pui32 = (uint32_t *)OTP_BOARD_TIME_STAMP_ADDR;
117  uartslave_printf(pslave, "%lu ", pui32[0]);
118  return UARTSLAVE_OK;
119 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_mac()

int putslave_do_cmd_q_mac ( uartslave_t pslave)
121  {
123  uartslave_printf(pslave, "%02X:%02X:%02X:%02X:%02X:%02X ",
124  ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]);
125  return UARTSLAVE_OK;
126 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_uid()

int putslave_do_cmd_q_uid ( uartslave_t pslave)
128  {
129  uint32_t *ptr = (uint32_t *)OTP_STM32_UUID_ADDR;
130  uartslave_printf(pslave, "%08lx-%08lx-%08lx ", ptr[0], ptr[1], ptr[2]);
131  return UARTSLAVE_OK;
132 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_ip4()

int putslave_do_cmd_q_ip4 ( uartslave_t pslave)
134  {
135 #ifdef ETHERNET
136  uint8_t *ptr = (uint8_t *)(&netif_default->ip_addr);
137  uartslave_printf(pslave, "%u.%u.%u.%u ", ptr[0], ptr[1], ptr[2], ptr[3]);
138  return UARTSLAVE_OK;
139 #else
140  return UARTSLAVE_ERR_ONP;
141 #endif
142 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_lock()

int putslave_do_cmd_q_lock ( uartslave_t pslave)
144  {
146  uartslave_printf(pslave, "%d ", (ptr[0] == 0) ? 1 : 0);
147  return UARTSLAVE_OK;
148 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_adc()

int putslave_do_cmd_q_adc ( uartslave_t pslave,
char *  pstr 
)
150  {
151  int adc = 0;
152  if (sscanf(pstr, "%d", &adc) != 1)
153  return UARTSLAVE_ERR_SYN;
154  if ((adc < 0) || (adc > 4))
155  return UARTSLAVE_ERR_OOR;
156  uartslave_printf(pslave, "%d ", hwio_adc_get_val(adc));
157  return UARTSLAVE_OK;
158 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_gpio()

int putslave_do_cmd_q_gpio ( uartslave_t pslave,
char *  pstr 
)
160  {
161  int gpio = 0;
162  if (sscanf(pstr, "%d", &gpio) != 1)
163  return UARTSLAVE_ERR_SYN;
164  if ((gpio < PA0) || (gpio > PE15))
165  return UARTSLAVE_ERR_OOR;
166  uartslave_printf(pslave, "%d ", gpio_get(gpio));
167  return UARTSLAVE_OK;
168 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_pwm()

int putslave_do_cmd_q_pwm ( uartslave_t pslave,
char *  pstr 
)
170  {
171  int pwm = 0;
172  if (sscanf(pstr, "%d", &pwm) != 1)
173  return UARTSLAVE_ERR_SYN;
174  if ((pwm < 0) || (pwm > 3))
175  return UARTSLAVE_ERR_OOR;
176  uartslave_printf(pslave, "%d ", hwio_pwm_get_max(pwm));
177  return UARTSLAVE_OK;
178 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_tste()

int putslave_do_cmd_q_tste ( uartslave_t pslave,
char *  pstr 
)
179  {
180 
181  unsigned int bytes;
182  int8_t res_flag;
183  if (sscanf(pstr, "%u", &bytes) != 1 || bytes < 16) {
184  res_flag = eeprom_test_PUT(2048);
185  } else {
186  res_flag = eeprom_test_PUT(bytes);
187  }
188  if (res_flag)
189  return UARTSLAVE_OK;
190  else
191  return UARTSLAVE_ERR_UNK;
192 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_diag()

int putslave_do_cmd_q_diag ( uartslave_t pslave,
char *  pstr 
)
194  {
195 
196  diag_test();
197  uartslave_printf(pslave, "%d ", diag_error);
198  return UARTSLAVE_OK;
199 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_gpup()

int putslave_do_cmd_q_gpup ( uartslave_t pslave,
char *  pstr 
)
201  {
202  int gpio = 0;
203  if (sscanf(pstr, "%d", &gpio) != 1)
204  return UARTSLAVE_ERR_SYN;
205  if ((gpio < PA0) || (gpio > PE15))
206  return UARTSLAVE_ERR_OOR;
207  gpio_init(gpio, GPIO_MODE_INPUT, GPIO_PULLUP, GPIO_SPEED_LOW);
208  uartslave_printf(pslave, "%d ", gpio_get(gpio));
209  return UARTSLAVE_OK;
210 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_uart()

int putslave_do_cmd_q_uart ( uartslave_t pslave)
212  {
213  uint8_t uart1rx_data[32] = { 0 };
214  uint8_t data_out[2] = "i";
215  HAL_UART_Transmit(uart1rxbuff.phuart, (uint8_t *)data_out, sizeof(data_out), HAL_MAX_DELAY);
216  if (uart1rx_data[0] == data_out[0])
217  return UARTSLAVE_OK;
218  uart1rx_data[0] = 0;
219  return UARTSLAVE_ERR_ONP;
220 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_q_tdg()

int putslave_do_cmd_q_tdg ( uartslave_t pslave)
222  {
223  tmc_set_sgthrs(255);
224  int tmc_stg = 0;
225  tmc_stg = tmc_get_diag();
226  if (tmc_stg == 15)
227  return UARTSLAVE_OK;
228  uartslave_printf(pslave, "%d ", tmc_stg);
229  return UARTSLAVE_ERR_ONP;
230 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_rst()

int putslave_do_cmd_a_rst ( uartslave_t pslave)
232  {
233  sys_reset();
234  return UARTSLAVE_OK;
235 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _validate_serial()

int _validate_serial ( const char *  str)
237  {
238  unsigned int w2 = 0; // week of year (1-52)
239  unsigned int y2 = 0; // year since 2000 (19-25)
240  unsigned int p3 = 0; // product - 017 for MINI
241  char t1 = 0; // type - 'K' or 'C' (kit or complete)
242  unsigned int n5 = 0; // number - 0..99999
243  if (sscanf(str, "%2u%2uX%3uX%c%5u", &w2, &y2, &p3, &t1, &n5) != 5)
244  return 0;
245  if (w2 > 52)
246  return 0;
247  if ((y2 < 19) || (y2 > 25))
248  return 0;
249  if (p3 != 17)
250  return 0;
251  if ((t1 != 'K') && (t1 != 'C'))
252  return 0;
253  if (n5 > 99999)
254  return 0;
255  return 1;
256 }
Here is the caller graph for this function:

◆ putslave_do_cmd_a_ser()

int putslave_do_cmd_a_ser ( uartslave_t pslave,
char *  pstr 
)
258  {
259  char *ptr = (char *)OTP_SERIAL_NUMBER_ADDR;
260  char ser[OTP_SERIAL_NUMBER_SIZE];
262  memset(ser, 0, OTP_SERIAL_NUMBER_SIZE);
263  if (sscanf(pstr, " CZPX%15s", ser) != 1)
264  return UARTSLAVE_ERR_SYN;
265  if (strlen(ser) != 15)
266  return UARTSLAVE_ERR_OOR;
267  if (!_validate_serial(ser))
268  return UARTSLAVE_ERR_OOR;
270  return UARTSLAVE_ERR_UNK;
271  return UARTSLAVE_OK;
272  }
273  return UARTSLAVE_ERR_ONP;
274 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_brev()

int putslave_do_cmd_a_brev ( uartslave_t pslave,
char *  pstr 
)
276  {
277  uint8_t *ptr = (uint8_t *)OTP_BOARD_REVISION_ADDR; // OTP memory - board revision
280  if (sscanf(pstr, "%hhu.%hhu.%hhu", rev + 0, rev + 1, rev + 2) != 3)
281  return UARTSLAVE_ERR_SYN;
282  //TODO: parameter range check
284  return UARTSLAVE_ERR_UNK;
285  return UARTSLAVE_OK;
286  }
287  return UARTSLAVE_ERR_ONP;
288 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_btim()

int putslave_do_cmd_a_btim ( uartslave_t pslave,
char *  pstr 
)
290  {
291  uint32_t *ptr = (uint32_t *)OTP_BOARD_TIME_STAMP_ADDR; // OTP memory - time stamp
292  uint32_t time_stamp;
294  if (sscanf(pstr, "%lu", &time_stamp) != 1)
295  return UARTSLAVE_ERR_SYN;
296  //TODO: parameter range check
298  return UARTSLAVE_ERR_UNK;
299  return UARTSLAVE_OK;
300  }
301  return UARTSLAVE_ERR_ONP;
302 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_mac()

int putslave_do_cmd_a_mac ( uartslave_t pslave,
char *  pstr 
)
304  {
305  uint32_t *ptr = (uint32_t *)OTP_MAC_ADDRESS_ADDR; // OTP memory - mac address
308  if (sscanf(pstr, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
309  mac + 0, mac + 1, mac + 2, mac + 3, mac + 4, mac + 5)
310  != 6
311  || sscanf(pstr, "%02hhX:%02hhX:%02hhX:%02hhX:%02hhX:%02hhX",
312  mac + 0, mac + 1, mac + 2, mac + 3, mac + 4, mac + 5)
313  != 6)
314  return UARTSLAVE_ERR_SYN;
315  //TODO: parameter range check
317  return UARTSLAVE_ERR_UNK;
318  return UARTSLAVE_OK;
319  }
320  return UARTSLAVE_ERR_ONP;
321 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_tone()

int putslave_do_cmd_a_tone ( uartslave_t pslave,
char *  pstr 
)
323  {
324  float frq = 0.0F;
325  unsigned int del = 0;
326  float vol = 1.0F;
327  int s = sscanf(pstr, "%f %u %f", &frq, &del, &vol);
328  if (s < 2)
329  return UARTSLAVE_ERR_SYN;
330  if (s == 3)
331  hwio_beeper_set_vol(vol);
332  hwio_beeper_tone(frq, del);
333  return UARTSLAVE_OK;
334 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_start()

int putslave_do_cmd_a_start ( uartslave_t pslave)
345  {
346  if (!marlin_server_processing()) {
347  NVIC_EnableIRQ(TIM7_IRQn);
351 #ifdef ETHERNET
353 #endif //ETHERNET
354  if (diag_fastboot && !put_setup_done) {
355  app_setup();
356  put_setup_done = 1;
357  }
358  }
359  return UARTSLAVE_OK;
360 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_stop()

int putslave_do_cmd_a_stop ( uartslave_t pslave)
362  {
363  if (marlin_server_processing()) {
366 #ifdef ETHERNET
368 #endif //ETHERNET
370  NVIC_DisableIRQ(TIM7_IRQn);
373  //SCK - PB10
375  //MISO - PC2
377  //MOSI - PC3
379  }
380  return UARTSLAVE_OK;
381 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_eecl()

int putslave_do_cmd_a_eecl ( uartslave_t pslave)
383  {
384  eeprom_clear();
385  return UARTSLAVE_OK;
386 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_gpio()

int putslave_do_cmd_a_gpio ( uartslave_t pslave,
char *  pstr 
)
388  {
389  int gpio = 0;
390  int state = 0;
391  int n = 0;
392  if (sscanf(pstr, "%d%n", &gpio, &n) != 1)
393  return UARTSLAVE_ERR_SYN;
394  if ((gpio < PA0) || (gpio > PE15))
395  return UARTSLAVE_ERR_OOR;
396  pstr += n;
397  if (sscanf(pstr, "%d%n", &state, &n) != 1)
398  return UARTSLAVE_ERR_SYN;
399  if ((state < 0) || (state > 1))
400  return UARTSLAVE_ERR_OOR;
401  if (gpio == PA0) {
402  if (state)
403  hwio_beeper_set_pwm(255, 255); // 1
404  else
405  hwio_beeper_set_pwm(255, 0); // 0
406  } else
407  gpio_set(gpio, state);
408  return UARTSLAVE_OK;
409 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_gcode()

int putslave_do_cmd_a_gcode ( uartslave_t pslave,
char *  pstr 
)
411  {
412  char gcode[32];
413  int n = 0;
414  if (sscanf(pstr + 1, "%31[^\n]%n", gcode, &n) != 1)
415  return UARTSLAVE_ERR_SYN;
417  return UARTSLAVE_OK;
418 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_pwm()

int putslave_do_cmd_a_pwm ( uartslave_t pslave,
char *  pstr 
)
420  {
421  int pwm = 0;
422  int value = 0;
423  int n = 0;
424  if (sscanf(pstr, "%d%n", &pwm, &n) != 1)
425  return UARTSLAVE_ERR_SYN;
426  if ((pwm < 0) || (pwm > 3))
427  return UARTSLAVE_ERR_OOR;
428  pstr += n;
429  if (sscanf(pstr, "%d%n", &value, &n) != 1)
430  return UARTSLAVE_ERR_SYN;
431  if ((value < 0) || (value > hwio_pwm_get_max(pwm)))
432  return UARTSLAVE_ERR_OOR;
433  hwio_pwm_set_val(pwm, value);
434  return UARTSLAVE_OK;
435 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_lock()

int putslave_do_cmd_a_lock ( uartslave_t pslave)
437  {
438  uint8_t zero = 0;
439  if (sys_flash_is_empty((void *)OTP_LOCK_BLOCK_ADDR, 1)) {
440  if (sys_flash_write((void *)OTP_LOCK_BLOCK_ADDR, &zero, 1) != 1)
441  return UARTSLAVE_ERR_UNK;
442  return UARTSLAVE_OK;
443  }
444  return UARTSLAVE_ERR_ONP;
445 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_tst()

int putslave_do_cmd_a_tst ( uartslave_t pslave,
char *  pstr 
)
447  {
448  int run_selftest = 0;
449  int run_xyzcalib = 0;
450  int run_firstlay = 0;
451  if (strlen(pstr))
452  if (sscanf(pstr, "%d %d %d", &run_selftest, &run_xyzcalib, &run_firstlay) <= 0)
453  return UARTSLAVE_ERR_SYN;
457 #ifdef SIM_MOTION
458 // sim_motion_print_buff();
459 #endif //SIM_MOTION
460  return UARTSLAVE_OK;
461 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_inval()

int putslave_do_cmd_a_inval ( uartslave_t pslave)
463  {
464  if (sys_fw_is_valid()) {
465  if (sys_fw_invalidate())
466  return UARTSLAVE_OK;
467  return UARTSLAVE_ERR_UNK;
468  }
469 // for testing - format last flash sector in case of invalid firmware
470 // not working in Debug_Boot because firmware is too big
471 #if 0
472  else
473  {
474  if (sys_fw_validate())
475  return UARTSLAVE_OK;
476  return UARTSLAVE_ERR_UNK;
477  }
478 #endif
479  return UARTSLAVE_ERR_ONP;
480 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_i2c()

int putslave_do_cmd_a_i2c ( uartslave_t pslave)
484  {
485  uint8_t ret;
486  uint8_t _out[3] = { 0 >> 8, 0 & 0xff, 0x56 };
487  ret = HAL_I2C_Master_Transmit(&hi2c1, 0x02, _out, 3, HAL_MAX_DELAY);
488  if (ret == 0)
489  return UARTSLAVE_OK;
490  return UARTSLAVE_ERR_ONP;
491 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_ten()

int putslave_do_cmd_a_ten ( uartslave_t pslave,
char *  pstr 
)
493  {
494  int state;
495  if (sscanf(pstr, "%d", &state) != 1)
496  return UARTSLAVE_ERR_SYN;
497  if ((state < 0) || (state > 1))
498  return UARTSLAVE_ERR_OOR;
499  tmc_set_mres();
500  gpio_set(PD3, state); //X
501  gpio_set(PD14, state); //Y
502  gpio_set(PD2, state); //Z
503  gpio_set(PD10, state); //E
504  return UARTSLAVE_OK;
505 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd_a_move()

int putslave_do_cmd_a_move ( uartslave_t pslave,
char *  pstr 
)
507  {
508  int stepper = 0;
509  int dir = 0;
510  int speed = 0;
511  int steps = 0;
512  int n = 0;
513 
514  if (sscanf(pstr, "%d%n", &stepper, &n) != 1)
515  return UARTSLAVE_ERR_SYN;
516  if ((stepper < 0) || (stepper > 15))
517  return UARTSLAVE_ERR_OOR;
518  pstr += n;
519  if (sscanf(pstr, "%d%n", &steps, &n) != 1)
520  return UARTSLAVE_ERR_SYN;
521  if ((steps < 0) || (steps > 10000))
522  return UARTSLAVE_ERR_OOR;
523  pstr += n;
524  if (sscanf(pstr, "%d%n", &dir, &n) != 1)
525  return UARTSLAVE_ERR_SYN;
526  if ((dir < 0) || (dir > 10))
527  return UARTSLAVE_ERR_OOR;
528  pstr += n;
529  if (sscanf(pstr, "%d%n", &speed, &n) != 1)
530  return UARTSLAVE_ERR_SYN;
531  if ((speed < 0) || (speed > 10))
532  return UARTSLAVE_ERR_OOR;
533 
534  tmc_set_move(stepper, steps, dir, speed);
535  return UARTSLAVE_OK;
536 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putslave_do_cmd()

int putslave_do_cmd ( uartslave_t pslave,
uint16_t  mod_msk,
char  cmd,
uint16_t  cmd_id,
char *  pstr 
)
538  {
539  if (cmd == '?') {
540  if (mod_msk == 0)
541  switch (cmd_id) {
542  case PUTSLAVE_CMD_ID_VER:
543  return putslave_do_cmd_q_ver(pslave);
544  case PUTSLAVE_CMD_ID_SER:
545  return putslave_do_cmd_q_ser(pslave);
547  return putslave_do_cmd_q_brev(pslave);
549  return putslave_do_cmd_q_btim(pslave);
550  case PUTSLAVE_CMD_ID_MAC:
551  return putslave_do_cmd_q_mac(pslave);
552  case PUTSLAVE_CMD_ID_UID:
553  return putslave_do_cmd_q_uid(pslave);
554  case PUTSLAVE_CMD_ID_IP4:
555  return putslave_do_cmd_q_ip4(pslave);
557  return putslave_do_cmd_q_lock(pslave);
558  case PUTSLAVE_CMD_ID_ADC:
559  return putslave_do_cmd_q_adc(pslave, pstr);
561  return putslave_do_cmd_q_gpio(pslave, pstr);
562  case PUTSLAVE_CMD_ID_PWM:
563  return putslave_do_cmd_q_pwm(pslave, pstr);
565  return putslave_do_cmd_q_tste(pslave, pstr);
567  return putslave_do_cmd_q_diag(pslave, pstr);
569  return putslave_do_cmd_q_uart(pslave);
570  case PUTSLAVE_CMD_ID_TDG:
571  return putslave_do_cmd_q_tdg(pslave);
573  return putslave_do_cmd_q_gpup(pslave, pstr);
574  }
575  } else if (cmd == '!') {
576  if (mod_msk == 0)
577  switch (cmd_id) {
578  case PUTSLAVE_CMD_ID_RST:
579  return putslave_do_cmd_a_rst(pslave);
580  case PUTSLAVE_CMD_ID_SER:
581  return putslave_do_cmd_a_ser(pslave, pstr);
583  return putslave_do_cmd_a_brev(pslave, pstr);
585  return putslave_do_cmd_a_btim(pslave, pstr);
586  case PUTSLAVE_CMD_ID_MAC:
587  return putslave_do_cmd_a_mac(pslave, pstr);
589  return putslave_do_cmd_a_lock(pslave);
590  case PUTSLAVE_CMD_ID_TST:
591  return putslave_do_cmd_a_tst(pslave, pstr);
593  return putslave_do_cmd_a_tone(pslave, pstr);
595  return putslave_do_cmd_a_start(pslave);
597  return putslave_do_cmd_a_stop(pslave);
599  return putslave_do_cmd_a_eecl(pslave);
601  return putslave_do_cmd_a_gpio(pslave, pstr);
603  return putslave_do_cmd_a_gcode(pslave, pstr);
604  case PUTSLAVE_CMD_ID_PWM:
605  return putslave_do_cmd_a_pwm(pslave, pstr);
607  return putslave_do_cmd_a_inval(pslave);
608  case PUTSLAVE_CMD_ID_I2C:
609  return putslave_do_cmd_a_i2c(pslave);
610  case PUTSLAVE_CMD_ID_TEN:
611  return putslave_do_cmd_a_ten(pslave, pstr);
613  return putslave_do_cmd_a_move(pslave, pstr);
614  }
615  }
616  return UARTSLAVE_ERR_CNF;
617 }
Here is the call graph for this function:
Here is the caller graph for this function:

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

Variable Documentation

◆ defaultTaskHandle

osThreadId defaultTaskHandle

◆ displayTaskHandle

osThreadId displayTaskHandle

◆ idleTaskHandle

osThreadId idleTaskHandle

◆ webServerTaskHandle

osThreadId webServerTaskHandle

◆ hspi2

◆ put_setup_done

int put_setup_done = 0

◆ hi2c1

PUTSLAVE_CMD_ID_MOVE
#define PUTSLAVE_CMD_ID_MOVE
Definition: putslave.h:31
putslave_do_cmd_a_brev
int putslave_do_cmd_a_brev(uartslave_t *pslave, char *pstr)
Definition: putslave.c:276
putslave_do_cmd_a_tst
int putslave_do_cmd_a_tst(uartslave_t *pslave, char *pstr)
Definition: putslave.c:447
putslave_do_cmd_q_ver
int putslave_do_cmd_q_ver(uartslave_t *pslave)
Definition: putslave.c:98
UARTSLAVE_ERR_OOR
#define UARTSLAVE_ERR_OOR
Definition: uartslave.h:18
OTP_MAC_ADDRESS_ADDR
#define OTP_MAC_ADDRESS_ADDR
Definition: otp.h:18
PUTSLAVE_CMD_ID_GCODE
#define PUTSLAVE_CMD_ID_GCODE
Definition: putslave.h:24
putslave_do_cmd_a_gcode
int putslave_do_cmd_a_gcode(uartslave_t *pslave, char *pstr)
Definition: putslave.c:411
putslave_do_cmd_a_rst
int putslave_do_cmd_a_rst(uartslave_t *pslave)
Definition: putslave.c:232
putslave_do_cmd_q_uart
int putslave_do_cmd_q_uart(uartslave_t *pslave)
Definition: putslave.c:212
eeprom_test_PUT
int8_t eeprom_test_PUT(const unsigned int bytes)
Definition: eeprom.c:208
hwio_beeper_set_pwm
void hwio_beeper_set_pwm(uint32_t per, uint32_t pul)
Definition: hwio_a3ides_2209_02.c:491
GPIO_MODE_OUTPUT_PP
#define GPIO_MODE_OUTPUT_PP
Definition: stm32f4xx_hal_gpio.h:136
putslave_do_cmd_q_mac
int putslave_do_cmd_q_mac(uartslave_t *pslave)
Definition: putslave.c:121
PUTSLAVE_CMD_ID_STOP
#define PUTSLAVE_CMD_ID_STOP
Definition: putslave.h:19
variant8_ui8
variant8_t variant8_ui8(uint8_t ui8)
Definition: variant8.c:18
uartslave_printf
int uartslave_printf(uartslave_t *pslave, const char *fmt,...)
Definition: uartslave.c:129
UARTSLAVE_ERR_SYN
#define UARTSLAVE_ERR_SYN
Definition: uartslave.h:17
GPIO_SPEED_FREQ_HIGH
#define GPIO_SPEED_FREQ_HIGH
Definition: stm32f4xx_hal_gpio.h:160
uart1rx_data
static uint8_t uart1rx_data[200]
Definition: main.c:145
PUTSLAVE_CMD_ID_TSTE
#define PUTSLAVE_CMD_ID_TSTE
Definition: putslave.h:20
PUTSLAVE_CMD_ID_MAC
#define PUTSLAVE_CMD_ID_MAC
Definition: putslave.h:12
sys_reset
void sys_reset(void)
Definition: sys.cpp:20
HAL_SPI_MspInit
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
putslave_do_cmd_a_inval
int putslave_do_cmd_a_inval(uartslave_t *pslave)
Definition: putslave.c:463
PUTSLAVE_CMD_ID_ADC
#define PUTSLAVE_CMD_ID_ADC
Definition: putslave.h:22
PC3
#define PC3
Definition: variant.h:94
g29_auto.gcode
list gcode
Definition: g29_auto.py:44
PUTSLAVE_CMD_ID_INVAL
#define PUTSLAVE_CMD_ID_INVAL
Definition: putslave.h:26
PUTSLAVE_CMD_ID_RST
#define PUTSLAVE_CMD_ID_RST
Definition: putslave.h:7
PD3
#define PD3
Definition: variant.h:58
hwio_beeper_set_vol
void hwio_beeper_set_vol(float vol)
Definition: hwio_a3ides_2209_02.c:483
tmc_set_move
void tmc_set_move(uint8_t tmc, uint32_t step, uint8_t dir, uint8_t speed)
stepper
Stepper stepper
Definition: stepper.cpp:82
marlin_server_enqueue_gcode
int marlin_server_enqueue_gcode(const char *gcode)
Definition: marlin_server.cpp:318
_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
PD10
#define PD10
Definition: variant.h:80
osThreadResume
osStatus osThreadResume(osThreadId thread_id)
Resume execution of a suspended thread.
Definition: cmsis_os.c:1494
marlin_server_stop_processing
void marlin_server_stop_processing(void)
Definition: marlin_server.cpp:293
sys_fw_validate
int sys_fw_validate(void)
Definition: sys.cpp:281
_validate_serial
int _validate_serial(const char *str)
Definition: putslave.c:237
EEVAR_RUN_FIRSTLAY
#define EEVAR_RUN_FIRSTLAY
Definition: eeprom.h:16
PUTSLAVE_CMD_ID_TST
#define PUTSLAVE_CMD_ID_TST
Definition: putslave.h:16
hwio_adc_get_val
int hwio_adc_get_val(int i_adc)
Definition: hwio_a3ides_2209_02.c:245
state
static volatile fsensor_t state
Definition: filament_sensor.c:23
tmc_set_mres
void tmc_set_mres()
putslave_do_cmd_q_pwm
int putslave_do_cmd_q_pwm(uartslave_t *pslave, char *pstr)
Definition: putslave.c:170
version_firmware_name
const char version_firmware_name[]
Definition: version.c:24
putslave_do_cmd_q_btim
int putslave_do_cmd_q_btim(uartslave_t *pslave)
Definition: putslave.c:115
eeprom_set_var
void eeprom_set_var(uint8_t id, variant8_t var)
Definition: eeprom.c:88
PUTSLAVE_CMD_ID_GPIO
#define PUTSLAVE_CMD_ID_GPIO
Definition: putslave.h:23
eeprom_clear
void eeprom_clear(void)
Definition: eeprom.c:201
putslave_do_cmd_a_mac
int putslave_do_cmd_a_mac(uartslave_t *pslave, char *pstr)
Definition: putslave.c:304
OTP_SERIAL_NUMBER_ADDR
#define OTP_SERIAL_NUMBER_ADDR
Definition: otp.h:14
diag_fastboot
int diag_fastboot
Definition: diag.c:11
putslave_do_cmd_a_start
int putslave_do_cmd_a_start(uartslave_t *pslave)
Definition: putslave.c:345
PUTSLAVE_CMD_ID_SER
#define PUTSLAVE_CMD_ID_SER
Definition: putslave.h:9
putslave_do_cmd_a_pwm
int putslave_do_cmd_a_pwm(uartslave_t *pslave, char *pstr)
Definition: putslave.c:420
OTP_MAC_ADDRESS_SIZE
#define OTP_MAC_ADDRESS_SIZE
Definition: otp.h:19
putslave_do_cmd_a_ten
int putslave_do_cmd_a_ten(uartslave_t *pslave, char *pstr)
Definition: putslave.c:493
putslave_do_cmd_a_eecl
int putslave_do_cmd_a_eecl(uartslave_t *pslave)
Definition: putslave.c:383
putslave_do_cmd_q_brev
int putslave_do_cmd_q_brev(uartslave_t *pslave)
Definition: putslave.c:109
app_setup
void app_setup(void)
Definition: appmain.cpp:51
_uartrxbuff_t::phuart
UART_HandleTypeDef * phuart
Definition: uartrxbuff.h:17
putslave_do_cmd_a_gpio
int putslave_do_cmd_a_gpio(uartslave_t *pslave, char *pstr)
Definition: putslave.c:388
UARTSLAVE_CMD_ID_UNK
#define UARTSLAVE_CMD_ID_UNK
Definition: uartslave.h:12
diag_test
void diag_test(void)
Definition: diag.c:49
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
gpio_get
static int gpio_get(uint8_t pin8)
Definition: gpio.h:94
UARTSLAVE_FLG_ECHO
#define UARTSLAVE_FLG_ECHO
Definition: uartslave.h:7
putslave_do_cmd_q_ip4
int putslave_do_cmd_q_ip4(uartslave_t *pslave)
Definition: putslave.c:134
_PWM_HEATER_0
#define _PWM_HEATER_0
Definition: hwio_a3ides.h:41
sys_flash_write
int sys_flash_write(void *dst, void *src, int size)
Definition: sys.cpp:293
UARTSLAVE_ERR_ONP
#define UARTSLAVE_ERR_ONP
Definition: uartslave.h:19
putslave_do_cmd_q_ser
int putslave_do_cmd_q_ser(uartslave_t *pslave)
Definition: putslave.c:103
PUTSLAVE_CMD_ID_TDG
#define PUTSLAVE_CMD_ID_TDG
Definition: putslave.h:32
putslave_do_cmd_q_lock
int putslave_do_cmd_q_lock(uartslave_t *pslave)
Definition: putslave.c:144
EEVAR_RUN_XYZCALIB
#define EEVAR_RUN_XYZCALIB
Definition: eeprom.h:15
hwio_beeper_tone
void hwio_beeper_tone(float frq, uint32_t del)
Definition: hwio_a3ides_2209_02.c:514
UARTSLAVE_ERR_CNF
#define UARTSLAVE_ERR_CNF
Definition: uartslave.h:21
EEVAR_RUN_SELFTEST
#define EEVAR_RUN_SELFTEST
Definition: eeprom.h:14
gpio_init
static void gpio_init(uint8_t pin8, uint32_t mode, uint32_t pull, uint32_t speed)
Definition: gpio.h:102
putslave_do_cmd_a_i2c
int putslave_do_cmd_a_i2c(uartslave_t *pslave)
Definition: putslave.c:484
PUTSLAVE_CMD_ID_TEN
#define PUTSLAVE_CMD_ID_TEN
Definition: putslave.h:30
sys_fw_is_valid
int sys_fw_is_valid(void)
Definition: sys.cpp:266
PUTSLAVE_CMD_ID_START
#define PUTSLAVE_CMD_ID_START
Definition: putslave.h:18
putslave_do_cmd_a_stop
int putslave_do_cmd_a_stop(uartslave_t *pslave)
Definition: putslave.c:362
OTP_BOARD_TIME_STAMP_SIZE
#define OTP_BOARD_TIME_STAMP_SIZE
Definition: otp.h:11
hwio_pwm_get_max
int hwio_pwm_get_max(int i_pwm)
Definition: hwio_a3ides_2209_02.c:276
putslave_do_cmd_q_gpup
int putslave_do_cmd_q_gpup(uartslave_t *pslave, char *pstr)
Definition: putslave.c:201
putslave_do_cmd_q_uid
int putslave_do_cmd_q_uid(uartslave_t *pslave)
Definition: putslave.c:128
PUTSLAVE_CMD_ID_EECL
#define PUTSLAVE_CMD_ID_EECL
Definition: putslave.h:21
putslave_do_cmd_a_btim
int putslave_do_cmd_a_btim(uartslave_t *pslave, char *pstr)
Definition: putslave.c:290
GPIO_NOPULL
#define GPIO_NOPULL
Definition: stm32f4xx_hal_gpio.h:170
osThreadSuspend
osStatus osThreadSuspend(osThreadId thread_id)
Suspend execution of a thread.
Definition: cmsis_os.c:1478
netif_default
struct netif * netif_default
Definition: netif.c:105
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
PUTSLAVE_CMD_ID_BTIM
#define PUTSLAVE_CMD_ID_BTIM
Definition: putslave.h:11
uart1rxbuff
uartrxbuff_t uart1rxbuff
Definition: main.c:144
putslave_do_cmd_q_adc
int putslave_do_cmd_q_adc(uartslave_t *pslave, char *pstr)
Definition: putslave.c:150
OTP_LOCK_BLOCK_ADDR
#define OTP_LOCK_BLOCK_ADDR
Definition: otp.h:22
sys_flash_is_empty
int sys_flash_is_empty(void *ptr, int size)
Definition: sys.cpp:285
uint8_t
const uint8_t[]
Definition: 404_html.c:3
sys_fw_invalidate
int sys_fw_invalidate(void)
Definition: sys.cpp:271
putslave_do_cmd_q_diag
int putslave_do_cmd_q_diag(uartslave_t *pslave, char *pstr)
Definition: putslave.c:194
hspi2
SPI_HandleTypeDef hspi2
Definition: main.c:81
HAL_I2C_Master_Transmit
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
putslave_do_cmd_a_ser
int putslave_do_cmd_a_ser(uartslave_t *pslave, char *pstr)
Definition: putslave.c:258
tmc_get_diag
uint8_t tmc_get_diag()
PUTSLAVE_CMD_ID_UART
#define PUTSLAVE_CMD_ID_UART
Definition: putslave.h:28
putslave_do_cmd_a_lock
int putslave_do_cmd_a_lock(uartslave_t *pslave)
Definition: putslave.c:437
putslave_do_cmd_q_gpio
int putslave_do_cmd_q_gpio(uartslave_t *pslave, char *pstr)
Definition: putslave.c:160
hi2c1
I2C_HandleTypeDef hi2c1
Definition: main.c:77
PUTSLAVE_CMD_ID_PWM
#define PUTSLAVE_CMD_ID_PWM
Definition: putslave.h:25
OTP_BOARD_REVISION_SIZE
#define OTP_BOARD_REVISION_SIZE
Definition: otp.h:7
OTP_STM32_UUID_ADDR
#define OTP_STM32_UUID_ADDR
Definition: otp.h:26
PUTSLAVE_CMD_ID_BREV
#define PUTSLAVE_CMD_ID_BREV
Definition: putslave.h:10
OTP_BOARD_TIME_STAMP_ADDR
#define OTP_BOARD_TIME_STAMP_ADDR
Definition: otp.h:10
PA0
#define PA0
Definition: variant.h:95
_uartslave_t::do_cmd
uartslave_do_cmd_t * do_cmd
Definition: uartslave.h:40
PB10
#define PB10
Definition: variant.h:116
UARTSLAVE_ERR_UNK
#define UARTSLAVE_ERR_UNK
Definition: uartslave.h:15
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
UARTSLAVE_OK
#define UARTSLAVE_OK
Definition: uartslave.h:14
gpio_set
static void gpio_set(uint8_t pin8, int state)
Definition: gpio.h:98
put_setup_done
int put_setup_done
Definition: putslave.c:343
PUTSLAVE_CMD_ID_GPUP
#define PUTSLAVE_CMD_ID_GPUP
Definition: putslave.h:33
putslave_do_cmd_q_tste
int putslave_do_cmd_q_tste(uartslave_t *pslave, char *pstr)
Definition: putslave.c:179
PD14
#define PD14
Definition: variant.h:76
marlin_server_start_processing
void marlin_server_start_processing(void)
Definition: marlin_server.cpp:288
version_version
const char version_version[]
semantic version (https://semver.org) is Prusa3D standard
Definition: version.c:31
putslave_do_cmd_a_move
int putslave_do_cmd_a_move(uartslave_t *pslave, char *pstr)
Definition: putslave.c:507
diag_error
int diag_error
Definition: diag.c:13
PC2
#define PC2
Definition: variant.h:93
OTP_BOARD_REVISION_ADDR
#define OTP_BOARD_REVISION_ADDR
Definition: otp.h:6
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f4xx_hal_def.h:76
PUTSLAVE_CMD_ID_UID
#define PUTSLAVE_CMD_ID_UID
Definition: putslave.h:13
GPIO_MODE_INPUT
#define GPIO_MODE_INPUT
Definition: stm32f4xx_hal_gpio.h:135
PD2
#define PD2
Definition: variant.h:59
UARTSLAVE_CMD_ID_0
#define UARTSLAVE_CMD_ID_0
Definition: uartslave.h:11
OTP_SERIAL_NUMBER_SIZE
#define OTP_SERIAL_NUMBER_SIZE
Definition: otp.h:15
webServerTaskHandle
osThreadId webServerTaskHandle
Definition: main.c:100
PUTSLAVE_CMD_ID_I2C
#define PUTSLAVE_CMD_ID_I2C
Definition: putslave.h:29
PUTSLAVE_CMD_ID_LOCK
#define PUTSLAVE_CMD_ID_LOCK
Definition: putslave.h:15
putslave_do_cmd_q_tdg
int putslave_do_cmd_q_tdg(uartslave_t *pslave)
Definition: putslave.c:222
tmc_set_sgthrs
void tmc_set_sgthrs(uint8_t SGT)
displayTaskHandle
osThreadId displayTaskHandle
Definition: main.c:98
_uartslave_t::parse_cmd_id
uartslave_parse_cmd_id_t * parse_cmd_id
Definition: uartslave.h:39
PUTSLAVE_CMD_ID_VER
#define PUTSLAVE_CMD_ID_VER
Definition: putslave.h:8
putslave_do_cmd_a_tone
int putslave_do_cmd_a_tone(uartslave_t *pslave, char *pstr)
Definition: putslave.c:323
PUTSLAVE_CMD_ID_TONE
#define PUTSLAVE_CMD_ID_TONE
Definition: putslave.h:17
PUTSLAVE_CMD_ID_IP4
#define PUTSLAVE_CMD_ID_IP4
Definition: putslave.h:14
putslave_parse_cmd_id
int putslave_parse_cmd_id(uartslave_t *pslave, char *pstr, uint16_t *pcmd_id)
Definition: putslave.c:24
PUTSLAVE_CMD_ID_DIAG
#define PUTSLAVE_CMD_ID_DIAG
Definition: putslave.h:27
PE15
#define PE15
Definition: variant.h:115
HAL_UART_Transmit
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
marlin_server_processing
int marlin_server_processing(void)
Definition: marlin_server.cpp:284