Add rotation support to CO5300 display driver, and BMI270 IMU support for M5AtomS3R targets#1605
Open
kitazaki wants to merge 3 commits intoModdable-OpenSource:publicfrom
Open
Add rotation support to CO5300 display driver, and BMI270 IMU support for M5AtomS3R targets#1605kitazaki wants to merge 3 commits intoModdable-OpenSource:publicfrom
kitazaki wants to merge 3 commits intoModdable-OpenSource:publicfrom
Conversation
## Summary Add rotation support to the CO5300 display driver used by `esp32/waveshare_amoled_206`. The driver now supports `rotation` values of `0`, `90`, `180`, and `270`, consistent with other Moddable display drivers. ## Changes - Added a `rotation` getter/setter to `modules/drivers/co5300/co5300.js`. - Added native rotation state handling in `modCo5300.c`. - Updated `width` and `height` getters for 90/270 degree rotation. - Added validation for unsupported rotation values. - Added software pixel rearrangement for 90, 180, and 270 degree rotation. - Preserved the existing fast path for 0 degree rotation. ## Notes The CO5300 does not appear to provide a MADCTL-style row/column exchange mode suitable for 90/270 degree rotation. Non-zero rotations are therefore handled in software before pixel data is sent to the display. Rotated modes may be slower than the default 0 degree mode, but existing behavior is unchanged when `rotation` is not set. ## Testing Tested on `esp32/waveshare_amoled_206`, which uses the CO5300 display driver. Verified the following rotation values with `examples/piu/clock`: - `0` - `90` - `180` - `270`
## Summary This PR adds BMI270 IMU support to the M5AtomS3R target family. Moddable SDK 8.1.0 added support for the BMI270 sensor device. Since the M5AtomS3R family uses the same BMI270 IMU, this PR updates the corresponding target definitions. Updated targets: - `esp32/m5atom_s3r` - `esp32/m5atom_s3r_cam` - `esp32/m5atom_s3r_m12` ## Changes - Added the BMI270 sensor driver manifest to the M5AtomS3R target manifests. - Added `device.sensor.IMU` definitions for M5AtomS3R targets. - Added axis correction for `m5atom_s3r` so the IMU orientation matches `m5atom_s3`. - Scaled BMI270 accelerometer values from `m/s^2` to `g` for compatibility with existing AtomS3 IMU(MPU6886) examples. - Updated `examples/drivers/atoms3-imu` to handle samples that may not include accelerometer or gyroscope data immediately. - Added `examples/drivers/atoms3r-imu-console` for console-based IMU verification on displayless M5AtomS3R variants. ## Verification - `examples/drivers/atoms3-imu` with `esp32/m5atom_s3r` - `examples/drivers/atoms3r-imu-console` with `esp32/m5atom_s3r` - `examples/drivers/atoms3r-imu-console` with `esp32/m5atom_s3r_cam` - `examples/drivers/atoms3r-imu-console` with `esp32/m5atom_s3r_m12` ## Note M5Stack Core2 v1.3 also uses the BMI270 IMU. However, the Core2 hardware configuration changed between v1.1 and v1.3: the IMU changed from MPU6886 to BMI270, and the PMU changed from AXP2101 to AXP192. I plan to submit a separate PR for Core2 v1.3 after verifying the detection logic for these hardware differences.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Add rotation support to the CO5300 display driver used by
esp32/waveshare_amoled_206.The driver now supports
rotationvalues of0,90,180, and270, consistent with other Moddable display drivers.Changes
rotationgetter/setter tomodules/drivers/co5300/co5300.js.modCo5300.c.widthandheightgetters for 90/270 degree rotation.Notes
The CO5300 does not appear to provide a MADCTL-style row/column exchange mode suitable for 90/270 degree rotation. Non-zero rotations are therefore handled in software before pixel data is sent to the display.
Rotated modes may be slower than the default 0 degree mode, but existing behavior is unchanged when
rotationis not set.Testing
Tested on
esp32/waveshare_amoled_206, which uses the CO5300 display driver.Verified the following rotation values with
examples/piu/cards:090180270