I want to write a library which will work with my device. My device communicates over i2c so I'm going to extend i2c FB from Raspberry Pi Peripherals Library.
I want to communicate with my device (read and write) not only on start and on the end of the cycle so I'm not going to use the existent methods AfterReadInputs and BeforeWriteOutputs.
I've written my own method which use 'write8' and 'read' methods. I have a i2c device which uses 3 different address for different functions so I have to communicate with different address in one cycle. But I cannot change the usiAddress on every method call, at least I cannot understand how to do it. I tried SUPER^.usiAddress:=16#69 but it didn't help.
Then I try to use i2cMaster FB where I can indicate the usiAddress within 'write' and 'read' methods but there are no 'write8' method which is essential for me because I have to write only one register in time.
Could you please help me to understand how to manipulate the usiAddress within my method or how to write a single register with existing 'write' method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now it works fine with 'SUPER^.usiAddress:=' within my method, it seems that I have made some other mistake elsewhere.
But I will highly appreciate if someone will point me how to write not the first register by 'write' method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to write a library which will work with my device. My device communicates over i2c so I'm going to extend i2c FB from Raspberry Pi Peripherals Library.
I want to communicate with my device (read and write) not only on start and on the end of the cycle so I'm not going to use the existent methods AfterReadInputs and BeforeWriteOutputs.
I've written my own method which use 'write8' and 'read' methods. I have a i2c device which uses 3 different address for different functions so I have to communicate with different address in one cycle. But I cannot change the usiAddress on every method call, at least I cannot understand how to do it. I tried SUPER^.usiAddress:=16#69 but it didn't help.
Then I try to use i2cMaster FB where I can indicate the usiAddress within 'write' and 'read' methods but there are no 'write8' method which is essential for me because I have to write only one register in time.
Could you please help me to understand how to manipulate the usiAddress within my method or how to write a single register with existing 'write' method.
Now it works fine with 'SUPER^.usiAddress:=' within my method, it seems that I have made some other mistake elsewhere.
But I will highly appreciate if someone will point me how to write not the first register by 'write' method.