Skip to content

Conversation

@dnguye14-adi
Copy link
Contributor

Description

Add OWM example for MAX32690 to read ROM-ID of 1-Wire slave device
Connect 1-Wire pin, VCC and GND to the target.

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

Signed-off-by: Dung Nguyen <dung.nguyen@analog.com>
@github-actions github-actions bot added the MAX32690 Related to the MAX32690 (ME18) label Oct 29, 2025
Copy link
Contributor

@ttmut ttmut left a comment

Choose a reason for hiding this comment

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

Thanks for the work! I’ve left some comments, mostly concerning styling.

void setcrc8(uint8_t reset)
{
utilcrc8 = reset;
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return;

Comment on lines +78 to +79
utilcrc8 = dscrc_table[utilcrc8 ^ x];
return utilcrc8;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
utilcrc8 = dscrc_table[utilcrc8 ^ x];
return utilcrc8;
utilcrc8 = dscrc_table[utilcrc8 ^ x];
return utilcrc8;

For readability.

Comment on lines +101 to +105
if (MXC_OWM_Reset() == 1) {
//printf("OK: 1-wire devices reponded during the presence pulse\n");
} else {
return -2;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (MXC_OWM_Reset() == 1) {
//printf("OK: 1-wire devices reponded during the presence pulse\n");
} else {
return -2;
}
if (MXC_OWM_Reset() == 1) {
printf("OK: 1-wire devices reponded during the presence pulse\n");
} else {
printf("FAIL: Relevant error message here\n");
return -2;
}

Could do this or just

Suggested change
if (MXC_OWM_Reset() == 1) {
//printf("OK: 1-wire devices reponded during the presence pulse\n");
} else {
return -2;
}
if (MXC_OWM_Reset() != 1) {
printf("FAIL: Relevant error message here\n");
return -2;
}

Comment on lines +114 to +118
if (MXC_OWM_Reset() == 1) {
//printf("OK: 1-wire devices reponded during the presence pulse after Overdrive\n");
} else {
return -4;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

/* Read the ROM ID */
memset(buffer, 0, sizeof(buffer));
if (MXC_OWM_Read(buffer, 8) < 0) {
return -5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be a good idea to add an error log here as well.

Comment on lines +33 to +40








Copy link
Contributor

Choose a reason for hiding this comment

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

We only need a single newline.

"__GNUC__"
],
"intelliSenseMode": "gcc-arm",
"compilerPath": "${config:cfs.toolchain.armAArch32GCC.path}/bin/arm-none-eabi-gcc.exe",
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not think this file is supposed to hold CFS references. You can copy from an existing example and adjust accordingly.

{
"configurations": [
{
"name": "CFS: Debug with GDB and OpenOCD (ARM Embedded)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, this file seems to be tailored towards CFS integration. I suggest using launch.json from an existing example as a reference.

"C_Cpp.default.forcedInclude": [
"${workspaceFolder}/build/project_defines.h"
],
"cfs.project.target": "MAX32690",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

#
# Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
# Analog Devices, Inc.),
# Copyright (C) 2023-2024 Analog Devices, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Copyright (C) 2023-2024 Analog Devices, Inc.
# Copyright (C) 2023-2025 Analog Devices, Inc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MAX32690 Related to the MAX32690 (ME18)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants