This parameter is processed differently according to the bus types:
Address: This is usable for both SPI and I2C buses. The address parameter allows 32 bits to be sent on the bus, before the read and the write process is started. The number of bits to send is set by the ADL_BUS_CMD_SET_ADD_SIZE IOCtl command. If less than 32 bits are required to be sent; only the most significant bits are sent on the bus.
Opcode: This parameter can be used only over the SPI bus. The Opcode parameter allows sending 32 bits over the bus before the read or the write process. The number of bits to send is set by the ADL_BUS_CMD_SET_OP_SIZE IOCtl command. If less than 32 bits are required to be sent; only the most significant bits are sent on the bus. Usable only for SPI bus (ignored for I2C bus).
For example: If “BBB” has to be sent over the bus the Opcode parameter has to be set to 0xBBB00000 value, and the OpcodeLength parameter has to be set to 12.
It’s not that clear - I have recently tried to get some underestanding of this parameter. OpenAT Guide is really misleading.
First: note the difference between SPI and I2C → in I2C you must have an address in transmission. In SPI - you don’t have to.
Since for I2C you set address size & the address itself in the adl_busI2CSettings_t structure it is already setup for the transmission. The adl_busAccess_t is something different and used only for SPI - these are additional address and opcode information that are used for some arbitrary master-slave protocol.
Moreover, there is an App Note “Bus Services Application Note” where it is stated both for Write&Read:
So as you can see the OpenATmanual can really do a mess in your mind …
regards
oscar