The basic gist of it is that I've got a 2 megabit EEPROM connected to the MicroMod over I2C. This EEPROM chip has 256 byte pages and I want to read or write whole pages at once. I'm caching pages in RAM in order to be able to minimize writes and only write full pages at once. This project is being ported over from the Arduino Due. On the Due what I did was fork the Wire library and increase the buffer size to 258 so I could send my two command bytes + 256 bytes of data all in a single go. I'd like to not pull the same shenanigans this time around if I can help it. So, I suppose I could send 32 bytes (the buffer size in the Wire library) then wait until they send and send 32 more, etc without any stopping until the full 258 bytes is sent. But, that seems crude. The IMXRT chip is pretty powerful and it seems like I ought to be able to use DMA to trigger a buffer write for my own buffer - set it, forget it. But, the library doesn't seem to support this. It seems like perhaps I could use FlexIO to do an I2C DMA transfer. That seems perhaps a little overly complicated since it appears no one has paved the path for me already (yeah... being lazy...)
So, what's the best way to send 258 bytes over I2C with minimal hand holding and polling in code? Should I just fork the library to increase the buffer and thus do the exact same thing I did on the Due? Or is repeatedly writing 32 bytes with no stops in between a decent approach?
So, what's the best way to send 258 bytes over I2C with minimal hand holding and polling in code? Should I just fork the library to increase the buffer and thus do the exact same thing I did on the Due? Or is repeatedly writing 32 bytes with no stops in between a decent approach?