Driver for the Bosch BMA222E and family
Currently this only support I2C configuration as I can't remove the itty bitty package from its home on a populated PCB. If you want to play with one, you can find them in Xfinity XR11 remote controls. 😊
The register maps in this family are very similar and so it should be possible to support the following chips with minimal changes to the code here:
- BMA222 - 8bit resolution
- BMA250 - 10bit resolution
- BMA253 - 12bit resolution
- BMA255 - 12bit resolution
- BMA280 - 14bit resolution
Specifically, these chips should work with the library now, but you wouldn't benefit from the enhanced resolution.
More info on the product line from Bosch's website: https://www.bosch-sensortec.com/bst/products/all_products/bma222e
What's currently supported
- Accessing the chip via I2C
- Reading X, Y, Z axis and whether they've updated since last poll
- Reading the event FIFO for X, Y, Z axis (32 element deep queue version of #1)
- Changing FIFO mode (stream, fifo, bypass) and reading how full the FIFO is
- Checking what data is in the EEPROM and how many writes it has left
- Software reset
- Reading temperature
What's not currently supported
If anything here seems meaningful to you, feel free to reach out and help implement these features. I just didn't need any of them personally.
- Any chip other than the BMA222E
- Accessing the chip via SPI
- Changing which axis are thrown on the FIFO
- Enabling interrupts for slope, tap, FIFO full, orientation, etc
- Tap detection
- Acceleration data filters
- Power modes (normal, deep sleep, low power, suspend)
- Lower power sleep duration
- Whether to shadow acceleration data or not
- Configuration of the INT1 and INT2 pins nor their sources
- Interrupt thresholds for acceleration, slope, etc
- FIFO watermark interrupt level
- Self-test
- Actually programming the EEPROM or setting the values
- Setting the offset compensation
- Offset compensation
- And many more!
Example usage: