MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / begin

Method begin

libraries/FRAM_I2C/FRAM.cpp:42–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41#if defined (ESP8266) || defined(ESP32)
42int FRAM::begin(int sda, int scl, const uint8_t address,
43 const int8_t writeProtectPin)
44{
45 if ((address < 0x50) || (address > 0x57)) return FRAM_ERROR_ADDR;
46
47 _wire = &Wire;
48 _address = address;
49 if ((sda < 255) && (scl < 255))
50 {
51 _wire->begin(sda, scl);
52 } else {
53 _wire->begin();
54 }
55
56 if (writeProtectPin > -1)
57 {
58 _writeProtectPin = writeProtectPin;
59 pinMode(_writeProtectPin, OUTPUT);
60 }
61 if (! isConnected()) return FRAM_ERROR_CONNECT;
62 getSize();
63 return FRAM_OK;
64}
65#endif
66
67

Callers 1

unittestFunction · 0.45

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.36