1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
-
-
- #ifndef Pins_Arduino_h
- #define Pins_Arduino_h
-
- #include <avr/pgmspace.h>
-
- #define NOT_A_PIN 0
- #define NOT_A_PORT 0
-
- #define NOT_ON_TIMER 0
- #define TIMER0A 1
- #define TIMER0B 2
- #define TIMER1A 3
- #define TIMER1B 4
- #define TIMER2 5
- #define TIMER2A 6
- #define TIMER2B 7
-
- extern const uint8_t PROGMEM port_to_mode_PGM[];
- extern const uint8_t PROGMEM port_to_input_PGM[];
- extern const uint8_t PROGMEM port_to_output_PGM[];
-
- extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
- extern const uint8_t PROGMEM digital_pin_to_bit_PGM[];
- extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
-
- extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
-
-
-
-
-
-
- #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
- #define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
- #define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
- #define analogInPinToBit(P) (P)
- #define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_byte( port_to_output_PGM + (P))) )
- #define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_byte( port_to_input_PGM + (P))) )
- #define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_byte( port_to_mode_PGM + (P))) )
-
- #endif
|