Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

i2cioexpander inconsistencies and problems

Đang mở
#11,049 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
c
Lĩnh vực
embedded-iot

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
C
Star
4.6k
Fork
1.4k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
155

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của adafruit/circuitpython

Tất cả issue của adafruit/circuitpython

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.