Class Bmm150I2cBmi270
Provides I2C access to a BMM150 magnetometer connected through the BMI270's auxiliary (secondary) I2C master interface.
public class Bmm150I2cBmi270 : Bmm150I2cBase
- Inheritance
-
Bmm150I2cBmi270
Remarks
On the M5Stack CoreS3, the BMM150 (address 0x10) is physically wired to the BMI270's auxiliary I2C bus. This adapter routes Bmm150 register reads and writes through the BMI270's AUX registers so the magnetometer appears as a normal I2C device.
Constructors
Bmm150I2cBmi270(byte)
Initializes a new instance of the Bmm150I2cBmi270 class.
public Bmm150I2cBmi270(byte auxDeviceAddress)
Parameters
auxDeviceAddressbyteThe 7-bit I2C address of the BMM150 on the auxiliary bus (typically 0x10).
Methods
ReadByte(I2cDevice, byte)
Read a byte on a specific register.
public override byte ReadByte(I2cDevice i2cDevice, byte reg)
Parameters
Returns
- byte
The register value.
ReadBytes(I2cDevice, byte, SpanByte)
Read bytes on a specific Bmm150 register.
public override void ReadBytes(I2cDevice i2cDevice, byte reg, SpanByte readBytes)
Parameters
i2cDeviceI2cDeviceregbyteThe register to read.
readBytesSpanByteSpan of byte to store the data read.
WriteRegister(I2cDevice, byte, byte)
Write a register of the Bmm150.
public override void WriteRegister(I2cDevice i2cDevice, byte reg, byte data)