Make soft I2C clock frequency configurable #1928
Open
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.
Necessary to get a RGB LED bulb working (Action LSC SMART GLS A60 SMD 220-240V 8W 700lm RGB + 2700-6500K E27). It has a SM2185N controller, which seems to work with the SM2235 driver. However because the frequency of the CLK line is too high, the SM2185N controller often misinterprets frames. When turning on or off the LED, changing the brightness or color random thing happen.
Therefore, this change makes it possible to lower the clock frequency using a new command:
SoftI2C_SetClkPeriod. The default period is 4, setting it to 40 seems to be fine.This change also removes a duplicate definition of
SM2135_DELAY.I will make a forum post with more details about this device.