My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MarlinSerial.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. *
  18. */
  19. #pragma once
  20. #include "../../inc/MarlinConfigPre.h"
  21. #if ENABLED(EMERGENCY_PARSER)
  22. #include "../../feature/e_parser.h"
  23. #endif
  24. #include "../../core/serial_hook.h"
  25. typedef void (*usart_rx_callback_t)(serial_t * obj);
  26. struct MarlinSerial : public HardwareSerial {
  27. MarlinSerial(void* peripheral, usart_rx_callback_t rx_callback) :
  28. HardwareSerial(peripheral), _rx_callback(rx_callback)
  29. { }
  30. void begin(unsigned long baud, uint8_t config);
  31. inline void begin(unsigned long baud) { begin(baud, SERIAL_8N1); }
  32. void _rx_complete_irq(serial_t* obj);
  33. protected:
  34. usart_rx_callback_t _rx_callback;
  35. };
  36. typedef Serial0Type<MarlinSerial> MSerialT;
  37. extern MSerialT MSerial1;
  38. extern MSerialT MSerial2;
  39. extern MSerialT MSerial3;
  40. extern MSerialT MSerial4;
  41. extern MSerialT MSerial5;
  42. extern MSerialT MSerial6;
  43. extern MSerialT MSerial7;
  44. extern MSerialT MSerial8;
  45. extern MSerialT MSerial9;
  46. extern MSerialT MSerial10;
  47. extern MSerialT MSerialLP1;