Skip to content

libraries: Wire: Instantiate Wire following dts configuration #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 2, 2022

Conversation

soburi
Copy link
Member

@soburi soburi commented Oct 11, 2022

Instaintiate Wire with i2c device that defined in 'i2cs' array
under zephyr,user node.
If 'i2cs' array is not defined, tries to instantiate with
i2c device that labeled as 'arduino_i2c'.

As a result of apply new rule, the i2c_dev that declared in pinmap.h
is no more used, remove it.

Copy link
Collaborator

@DhruvaG2000 DhruvaG2000 left a comment

Choose a reason for hiding this comment

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

Review-by: Dhruva Gole

@DhruvaG2000
Copy link
Collaborator

@soburi kindly rebase and resolve conflicts. Thanks

Add member variable i2c_dev to Wire to hold it own i2c
device instance.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Instaintiate Wire with i2c device that defined in 'i2cs' array
under zephyr,user node.
If 'i2cs' array is not defined, tries to instantiate with
i2c device that labeled as 'arduino_i2c'.

As a result of apply new rule, the i2c_dev that declared in pinmap.h
is no more used, remove it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Create multiple Wire instance if i2cs array contains plural elements.
Declare these as 'Wire1', 'Wire2', ..., from second element of the array.
(First element is already declare as 'Wire'.)

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
Add a description for `i2cs`

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
@soburi
Copy link
Member Author

soburi commented Oct 29, 2022

@DhruvaG2000
Update done.

@DhruvaG2000
Copy link
Collaborator

Merged, Thanks!

@DhruvaG2000 DhruvaG2000 merged commit e372b00 into zephyrproject-rtos:main Nov 2, 2022
@soburi soburi deleted the i2cs-array branch November 2, 2022 10:28
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