Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

i2cioexpander inconsistencies and problems

Abierto
#11,049 8 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
c
Área
embedded-iot

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C
Estrellas
4.6k
Forks
1.4k
Merge medio
1 d 8 h
PR fusionados (30 d)
155

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de adafruit/circuitpython

Todos los issues de adafruit/circuitpython

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.