adds twai_get_bitrate_timings function (IDFGH-6027) #7713
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This function will calculate the brp, tseg1, tseg2 and sjw values that are needed to create the twai interface.
see notes for further information
This is my first PR with esp-idf and as such I am sure there will be things that are not correct with it. I check out the contributing information but all of the links in it are not functional so I couldn't review past the single document. So that is going to need to be fixed.
All feedback is welcome good or bad and if I need to change something please give an example and explain what the benefit of the change is. I know enough C to just about get my toes a little wet. I have a decent understanding of C so not a complete noob. LOL.
I am a firm believer of the easier it is to use the more people will use it. It took me 6 months to fully wrap my brain around the whole CAN packet specification and of that information can be transparent to the user then it should be. The user needs to be able to provide the things that they will know like the target bitrate, length of the BUS and the processing delay of the transceiver which is gotten from the documentation for the transceiver. If an exact match cannot be found for their target bitrate then then next closest bitrate the interface is capable of should be returned. That is what this code does. It makes using a CAN interface as easy as using a serial interface.
Thank you for taking the time to review this