-
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/cc260x: add I2C implementation #11306
Conversation
I still need to add protection for weird flags that could lock up the device. I would also like to know if I should add a timeout or if we can assume the bits will toggle and while loops are fine? |
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.
btw. PR title is a odd
Many thanks, I will address them shortly |
647d3f6
to
6c06271
Compare
Alright, I think it is in good shape, code style wise do you prefer |
oopsi, my bad according to our Coding Conventions w/o semicolon is correct |
6c06271
to
da1f2fd
Compare
@smlng Should I squash? If I do can I keep @kaspar030 messages? |
cpu/cc26x0/periph/i2c.c
Outdated
ret = -EAGAIN; | ||
} | ||
/* | ||
* If an error if a non-NACK error occurs we must reinit or get stuck. |
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.
sentence starts weird
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.
Heh yup, race condition in my head I guess.
/* enable SERIAL power domain */ | ||
PRCM->PDCTL0SERIAL = 1; | ||
while (!(PRCM->PDSTAT0 & PDSTAT0_SERIAL_ON)) {} | ||
|
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.
extra newlines
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.
minor style nits
Thanks @kaspar030, sorry guys for the silly mistakes. I am maybe rushing it a bit. |
please squash |
4bd17c1
to
c8fe404
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.
cannot test, board configs are missing
This commit cleans up magic number and defines bitfields. Adds error codes for ADDR/DATA NACK and ARBLOSS Adds error handling, it corrects when an error occurs Protects from flags that could lockup the bus
c8fe404
to
4c9890b
Compare
Uggg, error described in #10958. |
I think so, in contrast to #10958 I would suggest to change the macro name in the drivers that fail. Looking in some other drivers, we mostly use |
+1, much better than the |
Due to a name clash the helper macro I2C should be change. Helper macros in other drivers are called DEV. Changing to DEV fixes the naming conflict.
5b4ac7e
to
3ed9060
Compare
Finally. Is everyone happy? |
Thanks for the reviews! |
Thanks again for taking over @MrKevinWeiss! |
Contribution description
Adds a previously missing periph/i2c implementation for TI cc26xx.
Testing procedure
Run the i2c
robot-test
and verify with manually withtests/periph_i2c
or i2c based driver tests.Issues/PRs references
Taken over from #10955