-
Notifications
You must be signed in to change notification settings - Fork 1
begin([I2CSpeed])
This function will scan the available I2C addresses (0x50 through 0x57) for MB85nnn memories. The function makes use of the fact that writing or reading past the end of a memory wraps around to the beginning of the chip to determine the siye of each memory detected and the values are stored as part of the class so that the caller just needs to know how much memory is available rather than have to worry about the individual sizes when using multiple chips. The function returns the number of memory chips found, the total storage size available is available by calling totalBytes and each individual memory size can be retrieved using memSize.
The I2C bus defaults to 100KHz (I2C_STANDARD_MODE), but optionally the speed can be increased to 400KHz when specifying the "I2CSpeed" parameter with a value of I2C_FAST_MODE, or to 1MHz with I2C_FAST_MODE_PLUS_MODE or to 3.4MHz with I2C_HIGH_SPEED_MODE.
###Example
MB85_FRAM_Class FRAM;
...
uint8_t chips_detected = FRAM.begin(); // return number of memories
Serial.print("Found ");
Serial.print(chips_detected);
Serial.println(" MB85nnn memory chips");
...