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.

pins_arduino.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. pins_arduino.h - Pin definition functions for Arduino
  3. Part of Arduino - http://www.arduino.cc/
  4. Copyright (c) 2007 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 249 2007-02-03 16:52:51Z mellis $
  18. */
  19. #ifndef Pins_Arduino_h
  20. #define Pins_Arduino_h
  21. #include <avr/pgmspace.h>
  22. #define NOT_A_PIN 0
  23. #define NOT_A_PORT 0
  24. #define NOT_ON_TIMER 0
  25. #define TIMER0A 1
  26. #define TIMER0B 2
  27. #define TIMER1A 3
  28. #define TIMER1B 4
  29. #define TIMER2 5
  30. #define TIMER2A 6
  31. #define TIMER2B 7
  32. extern const uint8_t PROGMEM port_to_mode_PGM[];
  33. extern const uint8_t PROGMEM port_to_input_PGM[];
  34. extern const uint8_t PROGMEM port_to_output_PGM[];
  35. extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
  36. extern const uint8_t PROGMEM digital_pin_to_bit_PGM[];
  37. extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
  38. extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
  39. // Get the bit location within the hardware port of the given virtual pin.
  40. // This comes from the pins_*.c file for the active board configuration.
  41. //
  42. // These perform slightly better as macros compared to inline functions
  43. //
  44. #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
  45. #define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
  46. #define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
  47. #define analogInPinToBit(P) (P)
  48. #define portOutputRegister(P) ( (volatile uint8_t *)( (uint16_t) pgm_read_byte( port_to_output_PGM + (P))) )
  49. #define portInputRegister(P) ( (volatile uint8_t *)( (uint16_t) pgm_read_byte( port_to_input_PGM + (P))) )
  50. #define portModeRegister(P) ( (volatile uint8_t *)( (uint16_t) pgm_read_byte( port_to_mode_PGM + (P))) )
  51. #endif