A little update:
finally i did (based on wiringPi by Gordon Henderson) a simple programm to read quadrature shaft encoder.
There is simple demo:
https://www.youtube.com/watch?v=YSyvzjOUHlA and also I completed I2C operations in Lazarus on RPi3 and slaves as ATmega8 (programmed by me in Bascom). I've published anything about I2C because still working on it in a little bigger project as usually. Of course using Lazarus