wiring_private.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. wiring_private.h - Internal header file.
  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 239 2007-01-12 17:58:39Z mellis $
  18. */
  19. #ifndef WiringPrivate_h
  20. #define WiringPrivate_h
  21. #include <avr/io.h>
  22. #include <avr/interrupt.h>
  23. #include <stdio.h>
  24. #include <stdarg.h>
  25. #include "Arduino.h"
  26. #ifdef __cplusplus
  27. extern "C"{
  28. #endif
  29. #ifndef cbi
  30. #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
  31. #endif
  32. #ifndef sbi
  33. #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
  34. #endif
  35. #define EXTERNAL_INT_0 0
  36. #define EXTERNAL_INT_1 1
  37. #define EXTERNAL_INT_2 2
  38. #define EXTERNAL_INT_3 3
  39. #define EXTERNAL_INT_4 4
  40. #define EXTERNAL_INT_5 5
  41. #define EXTERNAL_INT_6 6
  42. #define EXTERNAL_INT_7 7
  43. #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  44. #define EXTERNAL_NUM_INTERRUPTS 8
  45. #elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644P__)
  46. #define EXTERNAL_NUM_INTERRUPTS 3
  47. #elif defined(__AVR_ATmega32U4__)
  48. #define EXTERNAL_NUM_INTERRUPTS 4
  49. #else
  50. #define EXTERNAL_NUM_INTERRUPTS 2
  51. #endif
  52. typedef void (*voidFuncPtr)(void);
  53. #ifdef __cplusplus
  54. } // extern "C"
  55. #endif
  56. #endif