common locks for I2C and SPI