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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. wiring.h - Partial implementation of the Wiring API for the ATmega8.
  3. Part of Arduino - http://www.arduino.cc/
  4. Copyright (c) 2005-2006 David A. Mellis
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General
  14. Public License along with this library; if not, write to the
  15. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  16. Boston, MA 02111-1307 USA
  17. $Id$
  18. */
  19. #ifndef Wiring_h
  20. #define Wiring_h
  21. #include <avr/io.h>
  22. #include <stdlib.h>
  23. #include "binary.h"
  24. #ifdef __cplusplus
  25. extern "C"{
  26. #endif
  27. #define HIGH 0x1
  28. #define LOW 0x0
  29. #define INPUT 0x0
  30. #define OUTPUT 0x1
  31. #define true 0x1
  32. #define false 0x0
  33. #define PI 3.1415926535897932384626433832795
  34. #define HALF_PI 1.5707963267948966192313216916398
  35. #define TWO_PI 6.283185307179586476925286766559
  36. #define DEG_TO_RAD 0.017453292519943295769236907684886
  37. #define RAD_TO_DEG 57.295779513082320876798154814105
  38. #define SERIAL 0x0
  39. #define DISPLAY 0x1
  40. #define LSBFIRST 0
  41. #define MSBFIRST 1
  42. #define CHANGE 1
  43. #define FALLING 2
  44. #define RISING 3
  45. #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  46. #define INTERNAL1V1 2
  47. #define INTERNAL2V56 3
  48. #else
  49. #define INTERNAL 3
  50. #endif
  51. #define DEFAULT 1
  52. #define EXTERNAL 0
  53. // undefine stdlib's abs if encountered
  54. #ifdef abs
  55. #undef abs
  56. #endif
  57. #define min(a,b) ((a)<(b)?(a):(b))
  58. #define max(a,b) ((a)>(b)?(a):(b))
  59. #define abs(x) ((x)>0?(x):-(x))
  60. #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
  61. // Removed to work with newer AVRLIBC
  62. //#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
  63. #define radians(deg) ((deg)*DEG_TO_RAD)
  64. #define degrees(rad) ((rad)*RAD_TO_DEG)
  65. #define sq(x) ((x)*(x))
  66. #define interrupts() sei()
  67. #define noInterrupts() cli()
  68. #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
  69. #define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
  70. #define microsecondsToClockCycles(a) ( ((a) * (F_CPU / 1000L)) / 1000L )
  71. #define lowByte(w) ((uint8_t) ((w) & 0xff))
  72. #define highByte(w) ((uint8_t) ((w) >> 8))
  73. #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
  74. #define bitSet(value, bit) ((value) |= (1UL << (bit)))
  75. #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
  76. #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
  77. typedef unsigned int word;
  78. #define bit(b) (1UL << (b))
  79. typedef uint8_t boolean;
  80. typedef uint8_t byte;
  81. void init(void);
  82. void pinMode(uint8_t, uint8_t);
  83. void digitalWrite(uint8_t, uint8_t);
  84. int digitalRead(uint8_t);
  85. int analogRead(uint8_t);
  86. void analogReference(uint8_t mode);
  87. void analogWrite(uint8_t, int);
  88. unsigned long millis(void);
  89. unsigned long micros(void);
  90. void delay(unsigned long);
  91. void delayMicroseconds(unsigned int us);
  92. unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
  93. void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
  94. uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
  95. void attachInterrupt(uint8_t, void (*)(void), int mode);
  96. void detachInterrupt(uint8_t);
  97. void setup(void);
  98. void loop(void);
  99. #ifdef __cplusplus
  100. } // extern "C"
  101. #endif
  102. #endif