39 #ifndef EPPL_AVR8_MAPIN_H_INCLUDED
40 #define EPPL_AVR8_MAPIN_H_INCLUDED
66 #define EPPL_avr8_mapInMaskedPins(temp, pos, pin, mask) \
67 EPPL_avr8_LRSH((uint8_t)((uint8_t)(temp) & (uint8_t)((mask)<<EPPL_PINNR(pin))), pos, EPPL_PINNR(pin))
89 #define EPPL_avr8_mapInTempPinsNear1(pout, temp, direct, pos, pin) \
92 if((temp) & (uint8_t)(1U<<EPPL_PINNR(pin))) \
93 *(pout) |= (uint8_t)(1U<<(pos)); \
96 eppl_avr8_asm_bitcpy(*(pout), pos, temp, EPPL_PINNR(pin)); \
100 #define EPPL_avr8_mapInTempPinsNear2(pout, temp, direct, pos, pin) *(pout) |= EPPL_avr8_mapInMaskedPins(temp, pos, pin, 0x03)
102 #define EPPL_avr8_mapInTempPinsNear3(pout, temp, direct, pos, pin) *(pout) |= EPPL_avr8_mapInMaskedPins(temp, pos, pin, 0x07)
104 #define EPPL_avr8_mapInTempPinsNear4(pout, temp, direct, pos, pin) *(pout) |= EPPL_avr8_mapInMaskedPins(temp, pos, pin, 0x0f)
106 #define EPPL_avr8_mapInTempPinsNear5(pout, temp, direct, pos, pin) *(pout) |= EPPL_avr8_mapInMaskedPins(temp, pos, pin, 0x1f)
108 #define EPPL_avr8_mapInTempPinsNear6(pout, temp, direct, pos, pin) *(pout) |= EPPL_avr8_mapInMaskedPins(temp, pos, pin, 0x3f)
110 #define EPPL_avr8_mapInTempPinsNear7(pout, temp, direct, pos, pin) *(pout) |= EPPL_avr8_mapInMaskedPins(temp, pos, pin, 0x7f)
112 #define EPPL_avr8_mapInTempPinsNear8(pout, temp, direct, pos, pin) *(pout) |= EPPL_avr8_mapInMaskedPins(temp, pos, pin, 0xff)
125 static inline void eppl_avr8_mapInFromOnePort1(uint8_t *pout, uint8_t port, uint8_t temp, uint8_t direct,
eppl_pin_t pin1) __attribute__((always_inline));
126 static inline void eppl_avr8_mapInFromOnePort2(uint8_t *pout, uint8_t port, uint8_t temp, uint8_t direct,
eppl_pin_t pin1,
eppl_pin_t pin2) __attribute__((always_inline));
127 static inline void eppl_avr8_mapInFromOnePort3(uint8_t *pout, uint8_t port, uint8_t temp, uint8_t direct,
eppl_pin_t pin1,
eppl_pin_t pin2,
eppl_pin_t pin3) __attribute__((always_inline));
128 static inline void eppl_avr8_mapInFromOnePort4(uint8_t *pout, uint8_t port, uint8_t temp, uint8_t direct,
eppl_pin_t pin1,
eppl_pin_t pin2,
eppl_pin_t pin3,
eppl_pin_t pin4) __attribute__((always_inline));
131 static inline void eppl_avr8_mapInFromOnePort7(uint8_t *pout, uint8_t port, uint8_t temp, uint8_t direct,
eppl_pin_t pin1,
eppl_pin_t pin2,
eppl_pin_t pin3,
eppl_pin_t pin4,
eppl_pin_t pin5,
eppl_pin_t pin6,
eppl_pin_t pin7) __attribute__((always_inline));
132 static inline void eppl_avr8_mapInFromOnePort8(uint8_t *pout, uint8_t port, uint8_t temp, uint8_t direct,
eppl_pin_t pin1,
eppl_pin_t pin2,
eppl_pin_t pin3,
eppl_pin_t pin4,
eppl_pin_t pin5,
eppl_pin_t pin6,
eppl_pin_t pin7,
eppl_pin_t pin8) __attribute__((always_inline));
453 #define EPPL_avr8_mapInFromOnePort(pout, port, temp, direct, pins...) EPPL_LC(eppl_avr8_mapInFromOnePort, EPPL_COUNTARGS(pins))(pout, port, temp, direct, pins)
464 #define EPPL_avr8_generateMapInFromOnePort(repeatcntd, pins...) \
467 if(0 != EPPL_GETSUBSET(EPPL_checkPortNr, repeatcntd, EPPL_extractPinPos, |, pins)) { \
468 if(1 == EPPL_GETSUBSET(EPPL_checkPortNr, repeatcntd, EPPL_extractOne, +, pins)) { \
469 EPPL_avr8_mapInFromOnePort(&out, repeatcntd, *EPPL_avr8_CPORTREG(PIN, repeatcntd), 1, pins); \
472 uint8_t temp = *EPPL_avr8_CPORTREG(PIN, repeatcntd); \
473 EPPL_avr8_mapInFromOnePort(&out, repeatcntd, temp, 0, pins); \