Skip to content

Missing setDefaultFrequency() for Wire.begin() cleanup #5518

@FStefanni

Description

@FStefanni

Hi,

I am looking for a way to cleanup the call to Wire.begin(), as described in the issue #3779,
i.e. to set all relevant parameter before calling the begin() method.
At the moment, I see that the pins can be set with a call to setPins(), which is fine,
but we are missing an equivalent method to set the last parameter, i.e. the frequency.

I have seen the setClock() method, but for what I understand, calling it is not exactly the same, for example:

  • it seems that we cannot just pass 0 to set the default frequency
  • it actually does the frequency configuration, whilst we just want to set a default parameter for the future

Thus, I believe that adding a support method (e.g. setDefaultFrequency(), accepting also zero as default value), would be great,
since imho it will complete/refine the stuff of issue #3779. This change requires also some other code changes to manage the default frequency, where needed in the rest of the TwoWire class code.

Regards.

Metadata

Metadata

Assignees

Labels

Status: SolvedThe issue has been resolved and requires no further action.Type: Feature requestFeature request for Arduino ESP32

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions