-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Improvements in STM32 I2C class lib code #685
Improvements in STM32 I2C class lib code #685
Conversation
Hi @josesimoes, I'm nanoFramework bot. A human will be reviewing it shortly. 😉 |
- Remove static write and read buffers for I2C - Add function to compute estimated time to perform I2C transaction - Rework I2C NativeTransmit to use CLR events (or not) depending on transaction time - Remove I2C init and uninit calls (not required anymore) - Remove target configurations for I2C (not required anymore) Signed-off-by: josesimoes <jose.simoes@eclo.solutions>
7a77074
to
bdd08b9
Compare
You seem to have the correct version. That timing you see there between transactions is because of that Thread.Sleep() For such short timing I would recommend either do nothing or do a couple of dummy operations just to respect those 5ms that I guess are required for the write operation to complete. |
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.
LGTM
Description
Motivation and Context
How Has This Been Tested?
All tests reading and writing from/to STMPE811 touch controller in STM32F429I-DISCO.
The writings were performed to setup the touchscreen controller operation which was returning coordinates as expected.
Reading ChipID inside loop (straight through operation, no CLR thread swap)
Time between transactions: 0.228[ms]
Reading 220 bytes from chip inside loop (exceeds thread execution quantum, continuation setup, returning transaction result on following execution)
Time to setup read address and read 220 bytes : ~18[ms]
Time between transactions: 10.81[ms]
Reading ChipID on 10 consecutive transactions (straight through operation, no CLR thread swap)
Time to setup read address and read 2 bytes : ~0.47[ms]
Time between transactions: 0.1924[ms]
Types of changes
Checklist:
Signed-off-by: josesimoes jose.simoes@eclo.solutions