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.

wiring.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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: wiring.h 387 2008-03-08 21:30:00Z mellis $
  18. */
  19. #ifndef Wiring_h
  20. #define Wiring_h
  21. #include <avr/io.h>
  22. #include "binary.h"
  23. #ifdef __cplusplus
  24. extern "C"{
  25. #endif
  26. #define HIGH 0x1
  27. #define LOW 0x0
  28. #define INPUT 0x0
  29. #define OUTPUT 0x1
  30. #define true 0x1
  31. #define false 0x0
  32. #define PI 3.14159265
  33. #define HALF_PI 1.57079
  34. #define TWO_PI 6.283185
  35. #define DEG_TO_RAD 0.01745329
  36. #define RAD_TO_DEG 57.2957786
  37. #define SERIAL 0x0
  38. #define DISPLAY 0x1
  39. #define LSBFIRST 0
  40. #define MSBFIRST 1
  41. #define CHANGE 1
  42. #define FALLING 2
  43. #define RISING 3
  44. #define INTERNAL 3
  45. #define DEFAULT 1
  46. #define EXTERNAL 0
  47. // undefine stdlib's abs if encountered
  48. #ifdef abs
  49. #undef abs
  50. #endif
  51. #define min(a,b) ((a)<(b)?(a):(b))
  52. #define max(a,b) ((a)>(b)?(a):(b))
  53. #define abs(x) ((x)>0?(x):-(x))
  54. #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
  55. #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
  56. #define radians(deg) ((deg)*DEG_TO_RAD)
  57. #define degrees(rad) ((rad)*RAD_TO_DEG)
  58. #define sq(x) ((x)*(x))
  59. #define interrupts() sei()
  60. #define noInterrupts() cli()
  61. #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
  62. #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
  63. #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
  64. #define lowByte(w) ((w) & 0xff)
  65. #define highByte(w) ((w) >> 8)
  66. #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
  67. #define bitSet(value, bit) ((value) |= (1UL << (bit)))
  68. #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
  69. #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
  70. typedef unsigned int word;
  71. #define bit(b) (1 << (b))
  72. typedef uint8_t boolean;
  73. typedef uint8_t byte;
  74. void init(void);
  75. void pinMode(uint8_t, uint8_t);
  76. void digitalWrite(uint8_t, uint8_t);
  77. int digitalRead(uint8_t);
  78. int analogRead(uint8_t);
  79. void analogReference(uint8_t mode);
  80. void analogWrite(uint8_t, int);
  81. void beginSerial(uint8_t, long);
  82. void serialWrite(uint8_t, unsigned char);
  83. int serialAvailable(uint8_t);
  84. int serialRead(uint8_t);
  85. void serialFlush(uint8_t);
  86. unsigned long millis(void);
  87. unsigned long micros(void);
  88. void delay(unsigned long);
  89. void delayMicroseconds(unsigned int us);
  90. unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
  91. void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, byte val);
  92. void attachInterrupt(uint8_t, void (*)(void), int mode);
  93. void detachInterrupt(uint8_t);
  94. void setup(void);
  95. void loop(void);
  96. #ifdef __cplusplus
  97. } // extern "C"
  98. #endif
  99. #endif