Skip to content

drivers: adc: Includes MagnTek MT6701 #77801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

viniciusmiguel
Copy link
Contributor

Adds support to the Magnetic Angle Sensor MT6701 from MagnTek.

Datasheet for reference:
https://www.lcsc.com/datasheet/lcsc_datasheet_2109011830_Magn-Tek-MT6701CT-STD_C2856764.pdf

Adds support to the Magnetic Angle Sensor.

Signed-off-by: Vinicius Miguel <[email protected]>
@viniciusmiguel
Copy link
Contributor Author

@uLipe could I have your input on this one?

@uLipe
Copy link
Member

uLipe commented Aug 30, 2024

Please if this driver is not ready for review, change it to draft.

Copy link
Member

@uLipe uLipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far, I have some minor nits/questions.

@@ -0,0 +1,12 @@
# MT6701 Angular position sensor configuration option
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment can be dropped, the menuconfig option is already self explanatory

0x37, 0x34, 0x31, 0x32, 0x13, 0x10, 0x15, 0x16, 0x1F, 0x1C, 0x19,
0x1A, 0x0B, 0x08, 0x0D, 0x0E, 0x07, 0x04, 0x01, 0x02};

static uint8_t mt6701_crc_check(uint32_t input)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zephyr already offers CRC calculators, please use to avoid duplicated code.

int err = spi_read_dt(&dev_cfg->spi_port, &rx);

/* an invalid reading preserves the last good value */
if (!err) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zephyr by convention branch for handling error, please invert the condition and branch to perform the error handling.

* [0:13] Angle data
* [14:17] Magnetic field status
* [18:23] CRC
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment needed? If so is there a way of creating defines with proper index meaning?


dev_data->position = 0;

LOG_INF("Device %s initialized", dev->name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use LOG_DBG instead, this is the kind of information that are used in debugging scenarios

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we're using CODEOWNERS anymore. See #38725 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya it's actually been dropped altogether, now

Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Dec 17, 2024
@uLipe
Copy link
Member

uLipe commented Dec 18, 2024

@viniciusmiguel any update here?

@github-actions github-actions bot removed the Stale label Dec 19, 2024
@kartben
Copy link
Collaborator

kartben commented Dec 20, 2024

looks like this needs a rebase. But not sure you're still available to work on this, @viniciusmiguel?

Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Feb 19, 2025
@uLipe
Copy link
Member

uLipe commented Feb 21, 2025

@kartben I will be taking this from @viniciusmiguel , I have some units of this sensor for testing.

@uLipe uLipe removed the Stale label Feb 21, 2025
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants