-
Notifications
You must be signed in to change notification settings - Fork 3k
nRF52 I2CSlave Implementation #12161
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
Conversation
@AGlass0fMilk, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why targets.json
involves other platform's change? Others look good to me.
I think there's a merge error in the targets.json as some of the newly introduced changes are being removed. Also our I2CSlave implementation saddens me everytime I look at it... but we didn't have any customer request to making it better. Open for community contributions, if someone needs it and has time. |
Yeah, I must have messed up something with targets.json. I’ll fix it shortly @bulislaw what don’t you like about the I2CSlave API? It is kind of Arduino-like (blocking, wasteful of CPU and power) but at least we have an API... I was thinking it was going to be axed soon. One improvement would be an asynch API for slave operation. I2CSlave is nice for multi-MCU designs where you just need simple communication. I’m using it for collecting beacon data from a BLE SoC and sending it over CAN using an STM32F0. |
@desmond-blue @bulislaw I reverted the unrelated changes in targets.json |
@bulislaw could you address @AGlass0fMilk's comments ? |
Just ranting here... Yeah, current spinning design is not very efficient. I would say asynch is the only reasonable design pattern for slave. |
@bulislaw Does this still need work? Please update the labels accordingly. What's stopping this from being merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 styling issues, otherwise LGTM
targets/targets.json
Outdated
@@ -7472,6 +7472,7 @@ | |||
"FLASH", | |||
"I2C", | |||
"I2C_ASYNCH", | |||
"I2CSLAVE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you fix alignment here and line below?
} else { | ||
|
||
/* Initialze driver in blocking mode. */ | ||
nrfx_twi_init(&nordic_nrf5_instance[instance], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is HAL file, isn't it using spaces as defined in astyle config ? I can see this is 8 spaces at least, or even tabs?
As it was , it was following the style.
Once updated, we will run CI |
Tabs are the bane of my existence... I will revise. I recently discovered Eclipse has TWO settings you need to change to use spaces instead of tabs so hopefully this will be the last time this happens... 🤞 |
Alright! I fixed my configurations for tabs in both my laptop's eclipse instances and my emacs settings! I also untabified targets.json and i2c_api.c. This PR should be good to go when the PR it relies on is fixed up. It may need a rebase though. |
Rebased needed, correct. |
@0xc0170 I realize there are a lot of stupid little whitespace commits/changes in this PR currently. I will deal with those when I rebase. |
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
@AGlass0fMilk as per our guidelines, as this is a feature update the following fields need to be filled in with sufficient information for adopters of this functionality: Thanks. |
@AGlass0fMilk Shall we close and reopen once rebased and fixed or an update incoming anytime soon? |
Rebased. Tested and working. |
@AGlass0fMilk We are making 5.15 CI jobs priority currently, this will be scheduled when we can. |
CI started |
Test run: FAILEDSummary: 2 of 3 test jobs failed Failed test jobs:
|
@0xc0170 Seems like unrelated failures on this target: |
There was an example broken, will restart testing |
CI started |
Test run: FAILEDSummary: 2 of 3 test jobs failed Failed test jobs:
|
@0xc0170 Seems to be another CI issue. Just to be sure, it's not related to the fact that this PR modifies the I2CSlave example? Lines 37 to 126 in 6baab6c
|
Correct, will restart |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
Summary of changes
Implemented I2CSlave functionality for nRF52 targets. Requires PR #12160 .
Impact of changes
Migration actions required
Documentation
Update I2CSlave documentation to reflect new example showing interaction between an Mbed I2C master and I2CSlave.
Pull request type
Test results
Reviewers
@desmond-blue