adafruit / Adafruit_FRAM_SPI

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

Multi-byte reads #4

Closed pepijndevos closed 8 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 8 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 8 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 8 years ago

gr8!