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.

Arduino.h 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. #include <stddef.h>
  24. #include <stdint.h>
  25. #include <math.h>
  26. #include <cstring>
  27. #include <pinmapping.h>
  28. #define HIGH 0x01
  29. #define LOW 0x00
  30. #define INPUT 0x00
  31. #define OUTPUT 0x01
  32. #define INPUT_PULLUP 0x02
  33. #define INPUT_PULLDOWN 0x03
  34. #define LSBFIRST 0
  35. #define MSBFIRST 1
  36. #define CHANGE 0x02
  37. #define FALLING 0x03
  38. #define RISING 0x04
  39. typedef uint8_t byte;
  40. #define PROGMEM
  41. #define PSTR(v) (v)
  42. #define PGM_P const char *
  43. // Used for libraries, preprocessor, and constants
  44. #define abs(x) ((x)>0?(x):-(x))
  45. #ifndef isnan
  46. #define isnan std::isnan
  47. #endif
  48. #ifndef isinf
  49. #define isinf std::isinf
  50. #endif
  51. #define sq(v) ((v) * (v))
  52. #define constrain(value, arg_min, arg_max) ((value) < (arg_min) ? (arg_min) :((value) > (arg_max) ? (arg_max) : (value)))
  53. // Interrupts
  54. void cli(); // Disable
  55. void sei(); // Enable
  56. void attachInterrupt(uint32_t pin, void (*callback)(), uint32_t mode);
  57. void detachInterrupt(uint32_t pin);
  58. extern "C" {
  59. void GpioEnableInt(uint32_t port, uint32_t pin, uint32_t mode);
  60. void GpioDisableInt(uint32_t port, uint32_t pin);
  61. }
  62. // Time functions
  63. extern "C" void delay(const int ms);
  64. void _delay_ms(const int ms);
  65. void delayMicroseconds(unsigned long);
  66. uint32_t millis();
  67. //IO functions
  68. void pinMode(const pin_t, const uint8_t);
  69. void digitalWrite(pin_t, uint8_t);
  70. bool digitalRead(pin_t);
  71. void analogWrite(pin_t, int);
  72. uint16_t analogRead(pin_t);
  73. int32_t random(int32_t);
  74. int32_t random(int32_t, int32_t);
  75. void randomSeed(uint32_t);
  76. char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s);
  77. int map(uint16_t x, uint16_t in_min, uint16_t in_max, uint16_t out_min, uint16_t out_max);