UncleRus / esp-idf-lib

Component library for ESP32-xx and ESP8266
https://esp-idf-lib.readthedocs.io/en/latest/
1.35k stars 420 forks source link

Ensure the ODR bit is cleared before setting the INTPOL bit. #557

Closed oisalb closed 11 months ago

oisalb commented 11 months ago

According to the MCP23S17 data sheet:

The Open-Drain (ODR) control bit enables/disables the INT pin for open-drain configuration. Setting this bit overrides the INTPOL bit. The Interrupt Polarity (INTPOL) sets the polarity of the INT pin. This bit is functional only when the ODR bit is cleared, configuring the INT pin as active push-pull.

This PR proposes to clear the ODR bit if INTPOL gets set.

UncleRus commented 11 months ago

Thank you!