I2C Slave device register address map

I'm learning on how to read & write to slave registers. I chose a DS3231 RTC to start with.

I downloaded a library for it and learn it's code. Now I know that I have to supply the slave address to [u]beginTransmission()[/u] and also use [u]write([/u]) to set the start address for reading and [u]endTransmission()[/u] to end the transmission (straightforward for me).

Then after that, I also have to supply the slave address and the number of bytes to read starting from what is supplied to write().

Now, I came across to a line with "& 0x7f". What does it do? This is the whole code used in that particular function.

static uint8_t bcd2bin (uint8_t val) { return val - 6 * (val >> 4); }

DateTime RTClib::now() {
  Wire.write(0);   // This is the first register address (Seconds)
           // We'll read from here on for 7 bytes: secs reg, minutes reg, hours, days, months and years.
  Wire.requestFrom(CLOCK_ADDRESS, 7);
  uint8_t ss = bcd2bin(Wire.read() & 0x7F);
  uint8_t mm = bcd2bin(Wire.read());
  uint8_t hh = bcd2bin(Wire.read());
  uint8_t d = bcd2bin(Wire.read());
  uint8_t m = bcd2bin(Wire.read());
  uint16_t y = bcd2bin(Wire.read()) + 2000;
  return DateTime (y, m, d, hh, mm, ss);

What does & do and what is 0x7F for?

That is 'c' language. The '&' is the bitwise operator: https://www.arduino.cc/reference/en/language/structure/bitwise-operators/bitwiseand/.

When a byte is combined with "& 0x7F", that means that the lowest 7 bits are kept and the highest bit is cleared.

0x7F in binary is 0b01111111.