lophtware

Logo

lophtware projects

GitHub Profile

I2C - ROM Transaction

Report Type: Interrupt IN / OUT
Report Size: 40 Bytes
Acknowledged By: Report 0x19 or Command Acknowledgement for USB failures

Report ID Flags Read Address LSB Read Address MSB Read Count Write Address LSB Write Address MSB Write Count Payload
00011001 t 000000 s rrrrrrrr 000000 rr 000 ccccc wwwwwwww 000000 ww 000 CCCCC 32 bytes

Report ID

HID Report ID. Always 0x19.

Flags

Bits Direction Meaning
t IN / OUT Transaction type; 1 for read-then-write, 0 for write-then-read.
s IN Success flag; 1 if the transaction succeeded without errors, 0 if something went wrong. For OUT Reports set this to zero.

Read Address LSB

The Least Significant Byte of the first address that is to be read from. Addresses beyond the bank size of 1024 bytes will wrap.

Read Address MSB

The Most Significant Byte of the first address that is to be read from. Addresses beyond the bank size of 1024 bytes will wrap.

Read Count

The number of bytes to read and return to the Host in the corresponding IN Report, which can be zero. If the count causes the address to go beyond the end of the bank then it will wrap. If the count is greater than the 32-byte payload allowed then a negative Command Acknowledgement (NACK) will be returned as a response.

Write Address LSB

The Least Significant Byte of the first address that is to be written to. Addresses beyond the bank size of 1024 bytes will wrap.

Write Address MSB

The Most Significant Byte of the first address that is to be written to. Addresses beyond the bank size of 1024 bytes will wrap.

Write Count

The number of bytes to write from Payload into the ROM bank, which can be zero. If the count causes the address to go beyond the end of the bank then it will wrap. If the count is greater than the 32-byte payload allowed then a negative Command Acknowledgement (NACK) will be returned as a response.

Payload

For OUT Reports this is the block of data that will be written to the ROM bank.

For IN Reports this is the block of data that was read from the ROM bank.

Notes

This command does not respect the Protected ROM address mask, nor the Write-Protect flag; ie. you can write to any location in ROM. Those mechanisms are intended to protect the bank from other I2C Masters.

For writes into the ROM it is only possible to change a bit from a 1 to a 0. This means that the entire bank must be erased and re-initialised if any bits need to change from a 0 to a 1; this is the purpose of the ROM Contents command. The ROM bank is closer to an EPROM than an EEPROM for the purposes of this implementation.