Skip to content

Commit e307b48

Browse files
authored
Merge pull request #47 from raphaelsetin/main
Added support for SAMD51 boards
2 parents faa417b + 510b047 commit e307b48

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/SparkFun_External_EEPROM.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
#define I2C_BUFFER_LENGTH_RX SERIAL_BUFFER_SIZE // SAMD21 uses RingBuffer.h
4646
#define I2C_BUFFER_LENGTH_TX SERIAL_BUFFER_SIZE
4747

48+
#elif defined(__SAMD51__) || defined(ADAFRUIT_METRO_M4_EXPRESS)
49+
50+
// SAMD51 doesn't have a definition, but it does have this as a template size
51+
// in Wire.h: https://github.com/adafruit/ArduinoCore-samd/blob/master/libraries/Wire/Wire.h#L74
52+
#define I2C_BUFFER_LENGTH_RX 256
53+
#define I2C_BUFFER_LENGTH_TX 256
54+
4855
#elif (defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MKL26Z64__) || defined(__MK64FX512__) || \
4956
defined(__MK66FX1M0__) || defined(__IMXRT1062__)) // 3.0/3.1-3.2/LC/3.5/3.6/4.0
5057

@@ -128,7 +135,7 @@ class ExternalEEPROM
128135
int write(uint32_t eepromLocation, const uint8_t *dataToWrite, uint16_t blockSize);
129136

130137
bool begin(uint8_t deviceAddress = 0b1010000, TwoWire &wirePort = Wire, uint8_t WP = 255); // By default use the Wire port
131-
138+
132139
bool isConnected(uint8_t i2cAddress = 255);
133140
bool isBusy(uint8_t i2cAddress = 255);
134141
void erase(uint8_t toWrite = 0x00); // Erase the entire memory. Optional: write a given byte to each spot.

0 commit comments

Comments
 (0)