Skip to content

Conversation

Razer6
Copy link
Member

@Razer6 Razer6 commented Sep 20, 2025

This PR moves the I2C testutils to the DT API to support generic tops. The same approach was used as in the UART testutils conversion.

Depends on #28316

@Razer6 Razer6 requested a review from a team as a code owner September 20, 2025 07:30
@Razer6 Razer6 requested review from moidx, pamaury, sameo, davidschrammel, AlexJones0 and jwnrt and removed request for a team and moidx September 20, 2025 07:30
@Razer6
Copy link
Member Author

Razer6 commented Sep 20, 2025

There seems to be an issue with the csrng, where there is one dep.

dt_periph_io_t sda_periph_io = dt_i2c_periph_io(i2c_dt, kDtI2cPeriphIoSda);
dt_periph_io_t scl_periph_io = dt_i2c_periph_io(i2c_dt, kDtI2cPeriphIoScl);

// Disconnect SDA and SCL inputs by connecting to constant zero
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says constant zero but the code says constant one.


// Disconnect SDA and SCL inputs by connecting to constant zero
TRY(pinmux_testutils_connect(pinmux, sda_periph_io, kDtPeriphIoDirIn,
kDtPeriphIoConstantOne));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you need a pad but apparently I did not create not create the "constant 0" and "constant 1" pads in the DT. I think what you need to modify the dt_api.h template to add:

/* Pad that is constantly tied to one (input only) */
extern const dt_periph_io_t kDtPadConstantZero;

/* Pad that is constantly tied to zero (input only) */
extern const dt_periph_io_t kDtPadConstantOne;

and in dt_api.c:

/* Pin that is constantly tied to zero (input/output) */
const dt_pad_t kDtPadConstantZero = {
  .__internal = {
    .type = kDtPadTypeMio,
    .mio_out_or_direct_pad = 0,
    .insel = kTopEarlgreyPinmuxInselConstantZero, // Here need one line of python to make that top generic
  }
};

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

Successfully merging this pull request may close these issues.

2 participants