#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_word( port_to_output_PGM + (P))) )
#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
#define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )
the code above is out of the Arduino.h and these lines of code is where i have the the question.
- What is the (P) mean in the code above and what is it reference too? ex. digitalPinToPort(P) does it mean port?
- what does digitalPinToPort(P),digitalPinToBitMask(P),digitalPinToTimer(P),analogInPinToBit(P) (P), portOutputRegister(P), portInputRegister(P), and portModeRegister(P) do?