-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu, cc2538: adapt periph i2c to GPIO API #7318
Conversation
dbfb1a2
to
3fd6512
Compare
3fd6512
to
b3f97c6
Compare
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.
The code looks fine.
I tested it on the board RE-Mote with the ultrasonic sensor srf02.
b3f97c6
to
99882b3
Compare
99882b3
to
db2c154
Compare
@PeterKietzmann and ... well you know. |
db2c154
to
c8737e1
Compare
rebased on (and includes) #7373 |
c8737e1
to
d7f0726
Compare
d7f0726
to
9658fc2
Compare
9658fc2
to
c76aa54
Compare
rebased, needs squashing and testing |
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.
@smlng thanks for your cc2538 cleanup initiative and this PR as part of it. There are some minor change requests and some (for me) mayer points for clarification which is due to this complex device and its driver (being ported from contiki or something?)
Will test this in a minute.
|
||
#define ENABLE_DEBUG (0) | ||
#include "debug.h" | ||
|
||
/* guard this file in case no I2C device is defined */ | ||
#if I2C_NUMOF | ||
#ifdef I2C_NUMOF |
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 not needed anymore according to #7981
#ifdef MODULE_XTIMER | ||
#include "xtimer.h" | ||
#endif | ||
#else | ||
#include "thread.h" |
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.
I won't NACK this PR for this change but I don't see what this has to do with the i2c implementation
#ifndef I2C_0_SDA_PIN | ||
#define I2C_0_SDA_PIN i2c_config[I2C_0].sda_pin | ||
#endif | ||
#define SDA_TRY_LIMIT (200U) |
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.
- Where is this used and 2. could you spend a line explaining what it does?
/* Return to hardware mode for the I2C pins */ | ||
gpio_hardware_control(I2C_0_SCL_PIN); | ||
gpio_hardware_control(I2C_0_SDA_PIN); | ||
static inline void i2cm_ctrl_write(uint_fast8_t value) { |
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.
Above it was
static void i2cm_ctrl_write(uint_fast8_t value) {
WARN_IF(I2CM_STAT & BUSY);
I2CM_CTRL = value;
}
Why did you remove the WARN_IF
logging? Here and following?
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.
tests/driver_srf02 does not work with this PR but on master it does. Tested on a remote-reva.
@PeterKietzmann thx for testing, but that confirms my failed testing during HnA |
Tested on cc2538dk with same outcome as @PeterKietzmann. Also tried more low-level communication with tests/periph_i2c. But there's no i2c communication at all, either with 100kbit/s or 10kbit/s. |
@smlng fix? |
@smlng, is this PR still waiting for another PR (it doesn't seem to be the case) ? Do you think you could adapt it to the new I2C rework ? The idea would be to rebase it on top of new_i2c_if branch and change the base branch (click 'edit' button at the top right of this page and change the base branch there). And then link this PR in #6577. That would be super nice. |
FYI, @aabadie and all: closing and reopening a new PR against |
Thanks @smlng ! |
This PR requires #7316 and