adafruit / Adafruit_FRAM_SPI

Driver for Adafruit's SPI-Based FRAM Breakouts
Other
34 stars 30 forks source link

Multi-byte reads #4

Closed pepijndevos closed 7 years ago

pepijndevos commented 8 years ago

Very straightforward copy-paste of write that allows you to do something like

uint8_t data[16];
fram.read(0, data, 16);
jacky4566 commented 7 years ago

Looks good to me. But i'm thinking maybe you should make it more user friendly. Do two functions. read16 and read32. Thus negating the need to convert a byte array to an int or float.

pepijndevos commented 7 years ago

The point is not just to read larger data types, but read whole arrays as well. IMO, a simple cast and a lot of flexibility outweighs the API clutter of having read/write functions for every possible data type.

ladyada commented 7 years ago

gr8!