Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

i2cioexpander inconsistencies and problems

未关闭
#11,049 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
c
领域
embedded-iot

调研方向

Start by reading reset_board_buses() in shared-module/board/__init__.c and compare its behavior with common_hal_i2cioexpander_ioexpander_construct() and common_hal_i2cdisplaybus_i2cdisplaybus_construct(). Then trace the CIRCUITPY_I2CIOEXPANDER defaults across ports. Done means the intended bus and pin reset behavior is consistent, including for external I2C devices and user-created expanders.

由索引模型根据 Issue 内容生成。

描述

bug digitalio
CircuitPython version and board name
main
Code/REPL
n.a.
Behavior

There are a number of inconsistencies across ports regarding the i2cioexpander module. Also, the behavior is not as intended:

  1. CIRCUITPY_I2CIOEXPANDER defaults to 0 for all ports except raspberrypi. That port sets the value to =1 (instead of ?=1), so it is impossible to override it in a mpconfigboard.mk file. While this sounds like just another module for the raspberrypi port, it also changes behavior as a side effect. Setting CIRCUITPY_I2CIOEXPANDER prevents resetting the board I2C bus (see reset_board_buses() in shared-module/board/__init__.c. So none of the raspberrypi boards reset the board I2C bus, while all espressif boards except the yotas do the reset.
  2. The coding in reset_board_buses() has two additional problems. It silently assumes that the ioexpander is an internal peripheral and not just a normal external i2c device. This assumption can be wrong.
  3. Major problem: not resetting the bus in this way does not prevent resetting the SCL/SDA pins. So although the bus is not explicitely reset, it is still unusable after the cleanup routines from main.c.

(1) is easy to solve.
(2) is debateble: treating ioexpanders as something special is possible, but the current implementation treats them differently if they are not on the board I2C bus.
(3) common_hal_i2cioexpander_ioexpander_construct() could call common_hal_busio_i2c_never_reset(), like common_hal_i2cdisplaybus_i2cdisplaybus_construct() does. As an alternative, this can be added to all boards that create an ioexpander and treat all ioexpander instances created from user code as "normal" i2c devices.

Description

No response

Additional information

No response

主要语言
C
星标
4.6k
派生
1.4k
平均合并
1 天 8 小时
30 天内合并 PR
155

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

adafruit/circuitpython 的其他 Issue

查看 adafruit/circuitpython 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。