Skip to content
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

mcp23017 component, mcp23017_set_pullup function not working properly #453

Closed
3 tasks done
edaspb opened this issue Jan 5, 2025 · 2 comments
Closed
3 tasks done

Comments

@edaspb
Copy link

edaspb commented Jan 5, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

5.3.2

Espressif SoC revision.

ESP32

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

Custom Board

Steps to reproduce.

Hi everyone,

Looks like mcp23017_set_pullup() function doesn't work for mcp23017.
The code

esp_err_t mcp23017_set_pullup(mcp23017_handle_t dev, uint16_t pins)
{
    uint8_t data[] = { MCP23017_PORT_A_BYTE(pins), MCP23017_PORT_B_BYTE(pins) };
    return mcp23017_write(dev, MCP23017_REG_GPIOA, sizeof(data), data); //set REG_GPIOA(); REG_GPIOB();
}

Doesn't look good for me. Shouldn't we write to MCP23017_REG_GPPUA, MCP23017_REG_GPPUB register here?

Build Logs.

No response

More Information.

No response

@github-actions github-actions bot changed the title mcp23017 component, fun mcp23017 component, fun (AEGHB-937) Jan 5, 2025
@edaspb edaspb changed the title mcp23017 component, fun (AEGHB-937) mcp23017 component, mcp23017_set_pullup function not working properly Jan 5, 2025
@YanKE01
Copy link
Contributor

YanKE01 commented Jan 6, 2025

HI, @edaspb . Thank you very much for your feedback. We have noticed that the datasheet indicates the pull-up section needs to control the GPPU register. Therefore, in the original code, when set to input, the mcp23017_set_pullup function does not work. We will update this issue soon, and we will also release the mcp23017 to the ESP Component Registry, allowing you to use the component in a more convenient way.

@YanKE01
Copy link
Contributor

YanKE01 commented Jan 15, 2025

Hi, @edaspb . MCP23017 has been uploaded to the ESP Component Registry. You can easily integrate it into your project.

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

No branches or pull requests

3 participants