remove not working EEPROM EIU read code
This commit is contained in:
parent
8b496d9df4
commit
643352ce80
@ -55,7 +55,6 @@ Depending on board hardware following features are supported:
|
||||
- OLED Display (shows detailed status)
|
||||
- RGB LED (shows colorized status)
|
||||
- Button (short press: flip display page / long press: send alarm message)
|
||||
- Silicon unique ID
|
||||
- Battery voltage monitoring (analog read / AXP192 / IP5306)
|
||||
- GPS (Generic serial NMEA, or Quectel L76 I2C)
|
||||
- Environmental sensors (Bosch BMP180/BME280/BME680 I2C; SDS011 serial)
|
||||
|
@ -105,8 +105,4 @@
|
||||
#define LORA_IO1 (33)
|
||||
#define LORA_IO2 LMIC_UNUSED_PIN
|
||||
|
||||
// I2C config for Microchip 24AA02E64 DEVEUI unique address
|
||||
#define MCP_24AA02E64_I2C_ADDRESS 0x50 // I2C address for the 24AA02E64
|
||||
#define MCP_24AA02E64_MAC_ADDRESS 0xF8 // Memory adress of unique deveui 64 bits
|
||||
|
||||
#endif
|
||||
|
@ -162,49 +162,7 @@ void os_getDevEui(u1_t *buf) {
|
||||
} else {
|
||||
gen_lora_deveui(buf); // generate DEVEUI from device's MAC
|
||||
}
|
||||
|
||||
// Get MCP 24AA02E64 hardware DEVEUI (override default settings if found)
|
||||
#ifdef MCP_24AA02E64_I2C_ADDRESS
|
||||
get_hard_deveui(buf);
|
||||
RevBytes(buf, 8); // swap bytes to LSB format
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void get_hard_deveui(uint8_t *pdeveui) {
|
||||
// read DEVEUI from Microchip 24AA02E64 2Kb serial eeprom if present
|
||||
#ifdef MCP_24AA02E64_I2C_ADDRESS
|
||||
|
||||
uint8_t i2c_ret;
|
||||
|
||||
// Init this just in case, no more to 100KHz
|
||||
Wire.begin(SDA, SCL, 100000);
|
||||
Wire.beginTransmission(MCP_24AA02E64_I2C_ADDRESS);
|
||||
Wire.write(MCP_24AA02E64_MAC_ADDRESS);
|
||||
i2c_ret = Wire.endTransmission();
|
||||
|
||||
// check if device was seen on i2c bus
|
||||
if (i2c_ret == 0) {
|
||||
char deveui[32] = "";
|
||||
uint8_t data;
|
||||
|
||||
Wire.beginTransmission(MCP_24AA02E64_I2C_ADDRESS);
|
||||
Wire.write(MCP_24AA02E64_MAC_ADDRESS);
|
||||
Wire.endTransmission();
|
||||
|
||||
Wire.requestFrom(MCP_24AA02E64_I2C_ADDRESS, 8);
|
||||
while (Wire.available()) {
|
||||
data = Wire.read();
|
||||
sprintf(deveui + strlen(deveui), "%02X ", data);
|
||||
*pdeveui++ = data;
|
||||
}
|
||||
ESP_LOGI(TAG, "Serial EEPROM found, read DEVEUI %s", deveui);
|
||||
} else
|
||||
ESP_LOGI(TAG, "Could not read DEVEUI from serial EEPROM");
|
||||
|
||||
// Set back to 400KHz to speed up OLED
|
||||
Wire.setClock(400000);
|
||||
#endif // MCP 24AA02E64
|
||||
}
|
||||
|
||||
#if (VERBOSE)
|
||||
|
Loading…
Reference in New Issue
Block a user